From f862ce890893c82721232f09e46c5e38b235dcde Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 10 Jul 2014 11:37:28 +0000 Subject: 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 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'llvm/lib/CodeGen') 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 -- cgit v1.2.3