diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index d1d7e14454a4..b5575260cab1 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -1519,7 +1519,7 @@ bool AllocaInst::isStaticAlloca() const { // Must be in the entry block. const BasicBlock *Parent = getParent(); - return Parent == &Parent->getParent()->front() && !isUsedWithInAlloca(); + return Parent->isEntryBlock() && !isUsedWithInAlloca(); } //===----------------------------------------------------------------------===// diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index e4948b1d8280..0067491d9511 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -5250,8 +5250,8 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) { break; case Intrinsic::localescape: { BasicBlock *BB = Call.getParent(); - Check(BB == &BB->getParent()->front(), - "llvm.localescape used outside of entry block", Call); + Check(BB->isEntryBlock(), "llvm.localescape used outside of entry block", + Call); Check(!SawFrameEscape, "multiple calls to llvm.localescape in one function", Call); for (Value *Arg : Call.args()) {