@@ -142,19 +142,21 @@ void ValueCategory::store(mlir::OpBuilder &builder, mlir::Value toStore) const {
142
142
143
143
if (toStore.getType () != pt.getElementType ()) {
144
144
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
+ }
158
160
}
159
161
} else { // toStore.getType() == pt.getElementType()
160
162
assert (toStore.getType () == pt.getElementType () && " expect same type" );
0 commit comments