From b264d69de7dfcb94da9719a59bdd2fd3a8063b6a Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Fri, 21 Dec 2018 21:49:40 +0000 Subject: [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 --- llvm/lib/Transforms/Utils/Local.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Utils/Local.cpp') diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 831fb57..499e611 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(II->getArgOperand(1)); // Assumptions are dead if their condition is trivially true. Guards on -- cgit v1.1