summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-07-10 11:37:28 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-07-10 11:37:28 +0000
commitf862ce890893c82721232f09e46c5e38b235dcde (patch)
tree3cd5503406e14bc697f5d523ca814b9d7050f957 /llvm/lib/CodeGen
parent909aa3ad21d8e83b4b5dac1b02ab5189e7568315 (diff)
downloadbcm5719-llvm-f862ce890893c82721232f09e46c5e38b235dcde.tar.gz
bcm5719-llvm-f862ce890893c82721232f09e46c5e38b235dcde.zip
Revert r212640, "Add trunc (select c, a, b) -> select c (trunc a), (trunc b) combine."
This caused miscompilation on, at least, x86-64. SExt(i1 cond) confused other optimizations. llvm-svn: 212708
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index df273659e49..f6077b07d8d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -6022,20 +6022,6 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
}
}
- // trunc (select c, a, b) -> select c, (trunc a), (trunc b)
- if (N0.getOpcode() == ISD::SELECT) {
- EVT SrcVT = N0.getValueType();
- if ((!LegalOperations || TLI.isOperationLegal(ISD::SELECT, SrcVT)) &&
- TLI.isTruncateFree(SrcVT, VT)) {
- SDLoc SL(N0);
- SDValue TruncOp0 = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(1));
- SDValue TruncOp1 = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(2));
- EVT SetCCVT = getSetCCResultType(VT);
- SDValue Cond = DAG.getSExtOrTrunc(N0.getOperand(0), SL, SetCCVT);
- return DAG.getNode(ISD::SELECT, SDLoc(N), VT, Cond, TruncOp0, TruncOp1);
- }
- }
-
// Fold a series of buildvector, bitcast, and truncate if possible.
// For example fold
// (2xi32 trunc (bitcast ((4xi32)buildvector x, x, y, y) 2xi64)) to
OpenPOWER on IntegriCloud