summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.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/Local.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/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 831fb5751de..499e611acb5 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -393,8 +393,7 @@ bool llvm::wouldInstructionBeTriviallyDead(Instruction *I,
return true;
// Lifetime intrinsics are dead when their right-hand is undef.
- if (II->getIntrinsicID() == Intrinsic::lifetime_start ||
- II->getIntrinsicID() == Intrinsic::lifetime_end)
+ if (II->isLifetimeStartOrEnd())
return isa<UndefValue>(II->getArgOperand(1));
// Assumptions are dead if their condition is trivially true. Guards on
OpenPOWER on IntegriCloud