diff options
Diffstat (limited to 'llvm/lib/IR/Instruction.cpp')
-rw-r--r-- | llvm/lib/IR/Instruction.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp index f077957969f..d861b528859 100644 --- a/llvm/lib/IR/Instruction.cpp +++ b/llvm/lib/IR/Instruction.cpp @@ -598,6 +598,14 @@ bool Instruction::isSafeToRemove() const { !this->isTerminator(); } +bool Instruction::isLifetimeStartOrEnd() const { + auto II = dyn_cast<IntrinsicInst>(this); + if (!II) + return false; + Intrinsic::ID ID = II->getIntrinsicID(); + return ID == Intrinsic::lifetime_start || ID == Intrinsic::lifetime_end; +} + const Instruction *Instruction::getNextNonDebugInstruction() const { for (const Instruction *I = getNextNode(); I; I = I->getNextNode()) if (!isa<DbgInfoIntrinsic>(I)) |