summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-12-21 21:49:40 +0000
committerVedant Kumar <vsk@apple.com>2018-12-21 21:49:40 +0000
commitb264d69de7dfcb94da9719a59bdd2fd3a8063b6a (patch)
treef5440f9e50894ba9cea733d240fbc14627ea424a /llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
parent8ed73c20586e073221b4e712a399b10fdb290fa4 (diff)
downloadbcm5719-llvm-b264d69de7dfcb94da9719a59bdd2fd3a8063b6a.tar.gz
bcm5719-llvm-b264d69de7dfcb94da9719a59bdd2fd3a8063b6a.zip
[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 llvm-svn: 349964
Diffstat (limited to 'llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index a53083c31e3..91e4f4254b3 100644
--- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -82,8 +82,7 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) {
if (SI->isVolatile())
return false;
} else if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(U)) {
- if (II->getIntrinsicID() != Intrinsic::lifetime_start &&
- II->getIntrinsicID() != Intrinsic::lifetime_end)
+ if (!II->isLifetimeStartOrEnd())
return false;
} else if (const BitCastInst *BCI = dyn_cast<BitCastInst>(U)) {
if (BCI->getType() != Type::getInt8PtrTy(U->getContext(), AS))
OpenPOWER on IntegriCloud