@@ -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