[llvm-commits] CVS: llvm/lib/Target/TargetLowering.cpp

Nate Begeman natebegeman at mac.com
Fri Feb 3 14:38:18 PST 2006



Changes in directory llvm/lib/Target:

TargetLowering.cpp updated: 1.27 -> 1.28
---
Log message:

Implement some feedback from sabre


---
Diffs of the changes:  (+5 -5)

 TargetLowering.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/TargetLowering.cpp
diff -u llvm/lib/Target/TargetLowering.cpp:1.27 llvm/lib/Target/TargetLowering.cpp:1.28
--- llvm/lib/Target/TargetLowering.cpp:1.27	Fri Feb  3 16:24:05 2006
+++ llvm/lib/Target/TargetLowering.cpp	Fri Feb  3 16:38:07 2006
@@ -135,14 +135,14 @@
 /// set operation such as a sign extend or or/xor with constant whose only
 /// use is Op.  If it returns true, the old node that sets bits which are
 /// not demanded is returned in Old, and its replacement node is returned in
-/// New, such that callers of SetBitsAreZero may call CombineTo on them if
+/// New, such that callers of DemandedBitsAreZero may call CombineTo on them if
 /// desired.
 bool TargetLowering::DemandedBitsAreZero(const SDOperand &Op, uint64_t Mask, 
                                          SDOperand &Old, SDOperand &New,
                                          SelectionDAG &DAG) {
   // If the operation has more than one use, we're not interested in it.
   // Tracking down and checking all uses would be problematic and slow.
-  if (!Op.hasOneUse())
+  if (!Op.Val->hasOneUse())
     return false;
   
   switch (Op.getOpcode()) {
@@ -164,11 +164,11 @@
     MVT::ValueType EVT = cast<VTSDNode>(Op.getOperand(1))->getVT();
     unsigned ExtendBits = MVT::getSizeInBits(EVT);
     // If we're extending from something smaller than MVT::i64 and all of the
-    // sign extension bits are masked, return true and set New to be a zero
-    // extend inreg from the same type.
+    // sign extension bits are masked, return true and set New to be the
+    // first operand, since we no longer care what the high bits are.
     if (ExtendBits < 64 && ((Mask & (~0ULL << ExtendBits)) == 0)) {
       Old = Op;
-      New = DAG.getZeroExtendInReg(Op.getOperand(0), EVT);
+      New = Op.getOperand(0);
       return true;
     }
     break;






More information about the llvm-commits mailing list