[flang-commits] [flang] [OpenMPIRBuilder] Remove wrapper function in `createTask`, `createTeams` (PR #67723)
Kiran Chandramohan via flang-commits
flang-commits at lists.llvm.org
Thu Oct 5 04:03:12 PDT 2023
================
@@ -340,6 +340,44 @@ BasicBlock *llvm::splitBBWithSuffix(IRBuilderBase &Builder, bool CreateBranch,
return splitBB(Builder, CreateBranch, Old->getName() + Suffix);
}
+// This function creates a fake integer value and a fake use for the integer
+// value. It returns the fake value created. This is useful in modeling the
+// extra arguments to the outlined functions.
+Value *createFakeIntVal(IRBuilder<> &Builder,
+ OpenMPIRBuilder::InsertPointTy OuterAllocaIP,
+ std::stack<Instruction *> &ToBeDeleted,
+ OpenMPIRBuilder::InsertPointTy InnerAllocaIP,
+ const Twine &Name = "", bool AsPtr = true) {
+ Builder.restoreIP(OuterAllocaIP);
+ Instruction *FakeVal;
+ AllocaInst *FakeValAddr =
+ Builder.CreateAlloca(Builder.getInt32Ty(), nullptr, Name + ".addr");
+ ToBeDeleted.push(FakeValAddr);
+
+ if (AsPtr)
+ FakeVal = FakeValAddr;
+ else {
----------------
kiranchandramohan wrote:
Nit: braces to match else. Same for tid below.
https://github.com/llvm/llvm-project/pull/67723
More information about the flang-commits
mailing list