Skip to content

Commit 322b9f0

Browse files
committed
Fix the fix
1 parent 882c027 commit 322b9f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mlir/lib/Dialect/OpenMP/Transforms/OpenMPOffloadPrivatizationPrepare.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ class PrepareForOMPOffloadPrivatizationPass
252252
// variable, rewrite all the uses of the original variable with
253253
// the heap-allocated variable.
254254
rewriter.setInsertionPoint(targetOp);
255-
mapInfoOp = cloneModifyAndErase(mapInfoOp);
256-
rewriter.setInsertionPoint(mapInfoOp);
255+
auto clonedOp = cast<omp::MapInfoOp>(cloneModifyAndErase(mapInfoOp));
256+
rewriter.setInsertionPoint(clonedOp);
257257

258258
// Fix any members that may use varPtr to now use heapMem
259-
for (auto member : mapInfoOp.getMembers()) {
259+
for (auto member : clonedOp.getMembers()) {
260260
auto memberMapInfoOp = cast<omp::MapInfoOp>(member.getDefiningOp());
261261
if (!usesVarPtr(memberMapInfoOp))
262262
continue;
@@ -276,7 +276,7 @@ class PrepareForOMPOffloadPrivatizationPass
276276
// targetOp.
277277
if (isPrivatizedByValue) {
278278
rewriter.setInsertionPoint(targetOp);
279-
auto newPrivVar = LLVM::LoadOp::create(rewriter, mapInfoOp.getLoc(),
279+
auto newPrivVar = LLVM::LoadOp::create(rewriter, clonedOp.getLoc(),
280280
varType, heapMem);
281281
newPrivVars.push_back(newPrivVar);
282282
}

0 commit comments

Comments
 (0)