[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Jan 29 20:22:40 PST 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.295 -> 1.296
---
Log message:
don't insert an and node if it isn't needed here, this can prevent folding
of lowered target nodes.
---
Diffs of the changes: (+3 -1)
LegalizeDAG.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.295 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.296
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.295 Sun Jan 29 15:02:23 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sun Jan 29 22:22:28 2006
@@ -1284,7 +1284,9 @@
} else {
// Make sure the condition is either zero or one. It may have been
// promoted from something else.
- Tmp1 = DAG.getZeroExtendInReg(Tmp1, MVT::i1);
+ unsigned NumBits = MVT::getSizeInBits(Tmp1.getValueType());
+ if (!TLI.MaskedValueIsZero(Tmp1, (~0ULL >> (64-NumBits))^1))
+ Tmp1 = DAG.getZeroExtendInReg(Tmp1, MVT::i1);
Result = DAG.getSelectCC(Tmp1,
DAG.getConstant(0, Tmp1.getValueType()),
Tmp2, Tmp3, ISD::SETNE);
More information about the llvm-commits
mailing list