From e1308d86ed2402483aa9d056af531fd773e1121f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 13 May 2010 19:19:32 +0000 Subject: [PATCH] An Instruction has a trivial kill only if its use is in the same basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103725 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/FastISel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 24456504ccf..253ceca15eb 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -57,9 +57,12 @@ using namespace llvm; bool FastISel::hasTrivialKill(const Value *V) const { - // Don't consider constants or arguments to have trivial kills. + // Don't consider constants or arguments to have trivial kills. Only + // instructions with a single use in the same basic block. const Instruction *I = dyn_cast(V); - return I && I->hasOneUse(); + return I && + I->hasOneUse() && + cast(I->use_begin())->getParent() == I->getParent(); } unsigned FastISel::getRegForValue(const Value *V) { -- 2.34.1