[llvm-commits] [llvm] r160036 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Owen Anderson resistor at mac.com
Tue Jul 10 23:38:55 PDT 2012


Author: resistor
Date: Wed Jul 11 01:38:55 2012
New Revision: 160036

URL: http://llvm.org/viewvc/llvm-project?rev=160036&view=rev
Log:
Only apply the SETCC+SITOFP -> SELECTCC optimization when the SETCC returns an MVT::i1, i.e. before type legalization.
This is a speculative fix for a problem on Mips reported by Akira Hatanaka.

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

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=160036&r1=160035&r2=160036&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Jul 11 01:38:55 2012
@@ -5975,7 +5975,8 @@
   }
 
   // fold (sint_to_fp (setcc x, y, cc)) -> (select_cc x, y, -1.0, 0.0,, cc)
-  if (N0.getOpcode() == ISD::SETCC && !VT.isVector() &&
+  if (N0.getOpcode() == ISD::SETCC && N0.getValueType() == MVT::i1 &&
+      !VT.isVector() &&
       (!LegalOperations ||
        TLI.isOperationLegalOrCustom(llvm::ISD::ConstantFP, VT))) {
     SDValue Ops[] =





More information about the llvm-commits mailing list