aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2012-07-11 06:38:55 +0000
committerOwen Anderson <resistor@mac.com>2012-07-11 06:38:55 +0000
commit45299995d6a1273d644d127b4aeaf4e7eb365292 (patch)
tree32cb420abe49d314cea22674897d802a66dfe133
parentba584fe8feb840a82ad5966cb9eca6df0eeaafc2 (diff)
downloadexternal_llvm-45299995d6a1273d644d127b4aeaf4e7eb365292.zip
external_llvm-45299995d6a1273d644d127b4aeaf4e7eb365292.tar.gz
external_llvm-45299995d6a1273d644d127b4aeaf4e7eb365292.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160036 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 153f643..e2c7dec 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -5975,7 +5975,8 @@ SDValue DAGCombiner::visitSINT_TO_FP(SDNode *N) {
}
// 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[] =