summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
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
commit5b510c14742650615c9a3129a97fb4a634c1f77a (patch)
tree8acc2f3f7f227b357d195436d0bfb5dc480d36bb /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parent454ea716a3d2e7adfd779f236e66e247e50e7cd2 (diff)
downloadbcm5719-llvm-5b510c14742650615c9a3129a97fb4a634c1f77a.tar.gz
bcm5719-llvm-5b510c14742650615c9a3129a97fb4a634c1f77a.zip
An Instruction has a trivial kill only if its use is in the same
basic block. llvm-svn: 103725
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 24456504ccf..253ceca15eb 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud