[Mlir-commits] [flang] [llvm] [mlir] [Flang]Fix for changed code at the end of AllocaIP. (PR #92430)

Tom Eccles llvmlistbot at llvm.org
Wed May 29 10:43:29 PDT 2024


================
@@ -2137,10 +2137,9 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createReductions(
   unsigned NumReductions = ReductionInfos.size();
   Type *RedArrayTy = ArrayType::get(Builder.getPtrTy(), NumReductions);
   Builder.SetInsertPoint(AllocaIP.getBlock()->getTerminator());
-  //  Builder.restoreIP(AllocaIP);
   Value *RedArray = Builder.CreateAlloca(RedArrayTy, nullptr, "red.array");
 
-  Builder.SetInsertPoint(InsertBlock, InsertBlock->end());
+  Builder.SetInsertPoint(InsertBlock, InsertBlock->begin());
----------------
tblah wrote:

Why did you change this one to go at the beginning when it used to be at the end? Couldn't you set the insertion point just before the terminator instead?

https://github.com/llvm/llvm-project/pull/92430


More information about the Mlir-commits mailing list