Skip to content

Commit f568ba2

Browse files
committed
[NFC] Small update based on reviewer comments
- Fix badly written comment - Remove unneccesary function - remove unrequired llvm:: prefix
1 parent 0a18964 commit f568ba2

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,13 +1516,6 @@ class OpenMPIRBuilder {
15161516
/// Add a new region that will be outlined later.
15171517
void addOutlineInfo(OutlineInfo &&OI) { OutlineInfos.emplace_back(OI); }
15181518

1519-
/// Add a function that's constant allocas will attempt to be raised on a
1520-
/// call of finalize after all currently enqueued outline info's have been
1521-
/// processed.
1522-
void addConstantAllocaRaiseCandidates(Function *F) {
1523-
ConstantAllocaRaiseCandidates.emplace_back(F);
1524-
}
1525-
15261519
/// An ordered map of auto-generated variables to their unique names.
15271520
/// It stores variables with the following names: 1) ".gomp_critical_user_" +
15281521
/// <critical_section_name> + ".var" for "omp critical" directives; 2)

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,13 @@ static void raiseUserConstantDataAllocasToEntryBlock(IRBuilderBase &Builder,
638638
BasicBlock &EntryBlock = Function->getEntryBlock();
639639
Instruction *MoveLocInst = EntryBlock.getFirstNonPHI();
640640

641-
// Loop over blocks looking for allocas, skip the entry block allocas here are
642-
// in the appropriate place.
641+
// Loop over blocks looking for constant allocas, skipping the entry block
642+
// as any allocas there are already in the desired location.
643643
for (auto Block = std::next(Function->begin(), 1); Block != Function->end();
644644
Block++) {
645645
for (auto Inst = Block->getReverseIterator()->begin();
646646
Inst != Block->getReverseIterator()->end();) {
647-
if (auto *AllocaInst =
648-
llvm::dyn_cast_if_present<llvm::AllocaInst>(Inst)) {
647+
if (auto *AllocaInst = dyn_cast_if_present<llvm::AllocaInst>(Inst)) {
649648
Inst++;
650649
if (!isa<ConstantData>(AllocaInst->getArraySize()))
651650
continue;
@@ -5093,7 +5092,7 @@ static Function *createOutlinedFunction(
50935092
// generate entry code, we must move what allocas we can into the entry
50945093
// block to avoid possible breaking optimisations for device
50955094
if (OMPBuilder.Config.isTargetDevice())
5096-
OMPBuilder.addConstantAllocaRaiseCandidates(Func);
5095+
OMPBuilder.ConstantAllocaRaiseCandidates.emplace_back(Func);
50975096

50985097
// Insert target deinit call in the device compilation pass.
50995098
Builder.restoreIP(CBFunc(Builder.saveIP(), Builder.saveIP()));

0 commit comments

Comments
 (0)