[llvm] [mlir] [OpenMP][MLIR][OMPIRBuilder] Add a small optional constant alloca raise function pass to finalize, utilised in convertTarget (PR #78818)

Kiran Chandramohan via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 18 06:52:13 PST 2024


================
@@ -5043,6 +5088,12 @@ static Function *createOutlinedFunction(
 
   BasicBlock *UserCodeEntryBB = Builder.GetInsertBlock();
 
+  // As we embed the user code in the middle of our target region after we
+  // generate entry code, we must move what allocas we can into the entry
+  // block to avoid possible breaking optimisations for device
+  if (OMPBuilder.Config.isTargetDevice())
+    OMPBuilder.ConstantAllocaRaiseCandidates.emplace_back(Func);
----------------
kiranchandramohan wrote:

We do not have target specific code here at the moment. So no need to check this here.

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


More information about the llvm-commits mailing list