aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-13 19:19:32 +0000
committerDan Gohman <gohman@apple.com>2010-05-13 19:19:32 +0000
commit1ffc159c03023848aefac15da5fc351c0d0eff84 (patch)
treee733006eaa5fbc10eeb8d5224d6ae33fdbe042c0
parentb7edd8f7fdc1e3efa21a94a49f52f3462399e044 (diff)
downloadexternal_llvm-1ffc159c03023848aefac15da5fc351c0d0eff84.zip
external_llvm-1ffc159c03023848aefac15da5fc351c0d0eff84.tar.gz
external_llvm-1ffc159c03023848aefac15da5fc351c0d0eff84.tar.bz2
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
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 2445650..253ceca 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<Instruction>(V);
- return I && I->hasOneUse();
+ return I &&
+ I->hasOneUse() &&
+ cast<Instruction>(I->use_begin())->getParent() == I->getParent();
}
unsigned FastISel::getRegForValue(const Value *V) {