Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.297 -> 1.298
---
Log message:

Only insert an AND when converting from BR_COND to BRCC if needed.


---
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.297 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.298
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.297 Mon Jan 30 16:43:50 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp       Mon Jan 30 23:04:52 2006
@@ -703,7 +703,9 @@
       } else {
         // Make sure the condition is either zero or one.  It may have been
         // promoted from something else.
-        Tmp2 = DAG.getZeroExtendInReg(Tmp2, MVT::i1);
+        unsigned NumBits = MVT::getSizeInBits(Tmp2.getValueType());
+        if (!TLI.MaskedValueIsZero(Tmp2, (~0ULL >> (64-NumBits))^1))
+          Tmp2 = DAG.getZeroExtendInReg(Tmp2, MVT::i1);
         
         Result = DAG.getNode(ISD::BR_CC, MVT::Other, Tmp1, 
                              DAG.getCondCode(ISD::SETNE), Tmp2,



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to