diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
4 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 1523f01f377..12f02f758ec 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -9946,7 +9946,8 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) { if (isa<PHINode>(I) || I->mayWriteToMemory()) return false; // Do not sink alloca instructions out of the entry block. - if (isa<AllocaInst>(I) && I->getParent() == &DestBlock->getParent()->front()) + if (isa<AllocaInst>(I) && I->getParent() == + &DestBlock->getParent()->getEntryBlock()) return false; // We can only sink load instructions if there is nothing between the load and diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 7a578a8fb42..482ac773537 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -471,7 +471,7 @@ void LICM::sink(Instruction &I) { if (I.getType() != Type::VoidTy) AI = new AllocaInst(I.getType(), 0, I.getName(), - I.getParent()->getParent()->front().begin()); + I.getParent()->getParent()->getEntryBlock().begin()); // Secondly, insert load instructions for each use of the instruction // outside of the loop. diff --git a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp index a26fcbefe81..a29fe4ad3eb 100644 --- a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -891,7 +891,7 @@ void SROA::ConvertToScalar(AllocationInst *AI, const Type *ActualTy) { ++NumConverted; BasicBlock *EntryBlock = AI->getParent(); - assert(EntryBlock == &EntryBlock->getParent()->front() && + assert(EntryBlock == &EntryBlock->getParent()->getEntryBlock() && "Not in the entry block!"); EntryBlock->getInstList().remove(AI); // Take the alloca out of the program. diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp index c1ce9d4d3dd..cd3b79aab6c 100644 --- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -108,7 +108,7 @@ static bool CheckForEscapingAllocas(BasicBlock *BB, // If this alloca is in the body of the function, or if it is a variable // sized allocation, we cannot tail call eliminate calls marked 'tail' // with this mechanism. - if (BB != &BB->getParent()->front() || + if (BB != &BB->getParent()->getEntryBlock() || !isa<ConstantInt>(AI->getArraySize())) CannotTCETailMarkedCall = true; } |

