[llvm-commits] [llvm] r103725 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Dan Gohman gohman at apple.com
Thu May 13 12:19:32 PDT 2010


Author: djg
Date: Thu May 13 14:19:32 2010
New Revision: 103725

URL: http://llvm.org/viewvc/llvm-project?rev=103725&view=rev
Log:
An Instruction has a trivial kill only if its use is in the same
basic block.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=103725&r1=103724&r2=103725&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu May 13 14:19:32 2010
@@ -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) {





More information about the llvm-commits mailing list