[IR] Add Instruction::isLifetimeStartOrEnd, NFC

Instruction::isLifetimeStartOrEnd() checks whether an Instruction is an
llvm.lifetime.start or an llvm.lifetime.end intrinsic.

This was suggested as a cleanup in D55967.

Differential Revision: https://reviews.llvm.org/D56019

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349964 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vedant Kumar
2018-12-21 21:49:40 +00:00
parent 3995aa63f6
commit eeb1971b1c
18 changed files with 41 additions and 69 deletions
+2 -4
View File
@@ -206,10 +206,8 @@ const Instruction* BasicBlock::getFirstNonPHIOrDbgOrLifetime() const {
if (isa<PHINode>(I) || isa<DbgInfoIntrinsic>(I))
continue;
if (auto *II = dyn_cast<IntrinsicInst>(&I))
if (II->getIntrinsicID() == Intrinsic::lifetime_start ||
II->getIntrinsicID() == Intrinsic::lifetime_end)
continue;
if (I.isLifetimeStartOrEnd())
continue;
return &I;
}