File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -482,16 +482,11 @@ bool llvm::wouldInstructionBeTriviallyDead(const Instruction *I,
482482
483483 if (II->isLifetimeStartOrEnd ()) {
484484 auto *Arg = II->getArgOperand (1 );
485- // Lifetime intrinsics are dead when their right-hand is undef.
486- if (isa<UndefValue>(Arg))
487- return true ;
488- // If the right-hand is an alloc, global, or argument and the only uses
489- // are lifetime intrinsics then the intrinsics are dead.
490- if (isa<AllocaInst>(Arg) || isa<GlobalValue>(Arg) || isa<Argument>(Arg))
491- return llvm::all_of (Arg->uses (), [](Use &Use) {
492- return isa<LifetimeIntrinsic>(Use.getUser ());
493- });
494- return false ;
485+ // If the only uses of the alloca are lifetime intrinsics, then the
486+ // intrinsics are dead.
487+ return llvm::all_of (Arg->uses (), [](Use &Use) {
488+ return isa<LifetimeIntrinsic>(Use.getUser ());
489+ });
495490 }
496491
497492 // Assumptions are dead if their condition is trivially true.
You can’t perform that action at this time.
0 commit comments