Skip to content

Commit a562e0b

Browse files
committed
Undo store change
1 parent 3961eb9 commit a562e0b

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

polygeist/tools/cgeist/Lib/ValueCategory.cc

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,21 @@ void ValueCategory::store(mlir::OpBuilder &builder, mlir::Value toStore) const {
142142

143143
if (toStore.getType() != pt.getElementType()) {
144144
if (auto mt = toStore.getType().dyn_cast<MemRefType>()) {
145-
auto spt = pt.getElementType().cast<mlir::LLVM::LLVMPointerType>();
146-
CGEIST_WARNING({
147-
if (mt.getElementType() != spt.getElementType()) {
148-
// llvm::errs() << " func: " <<
149-
// val.getDefiningOp()->getParentOfType<FuncOp>() << "\n";
150-
llvm::WithColor::warning()
151-
<< "potential store type mismatch:\n"
152-
<< "val: " << val << " tosval: " << toStore << "\n"
153-
<< "mt: " << mt << "spt: " << spt << "\n";
154-
}
155-
});
156-
toStore =
157-
builder.create<polygeist::Memref2PointerOp>(loc, spt, toStore);
145+
if (auto spt =
146+
pt.getElementType().dyn_cast<mlir::LLVM::LLVMPointerType>()) {
147+
CGEIST_WARNING({
148+
if (mt.getElementType() != spt.getElementType()) {
149+
// llvm::errs() << " func: " <<
150+
// val.getDefiningOp()->getParentOfType<FuncOp>() << "\n";
151+
llvm::WithColor::warning()
152+
<< "potential store type mismatch:\n"
153+
<< "val: " << val << " tosval: " << toStore << "\n"
154+
<< "mt: " << mt << "spt: " << spt << "\n";
155+
}
156+
});
157+
toStore =
158+
builder.create<polygeist::Memref2PointerOp>(loc, spt, toStore);
159+
}
158160
}
159161
} else { // toStore.getType() == pt.getElementType()
160162
assert(toStore.getType() == pt.getElementType() && "expect same type");

0 commit comments

Comments
 (0)