diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-01-20 08:35:56 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-01-20 08:35:56 +0000 |
commit | 9450fcfff145cd20dc2bddad938d19dce1cc74eb (patch) | |
tree | 67722a61fcff86be92dfd741d8aa70cd14983fc6 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 87a736ca9fa0007d5590b111011b0b40bd2042dd (diff) | |
download | bcm5719-llvm-9450fcfff145cd20dc2bddad938d19dce1cc74eb.tar.gz bcm5719-llvm-9450fcfff145cd20dc2bddad938d19dce1cc74eb.zip |
Revert 172708.
The optimization handles esoteric cases but adds a lot of complexity both to the X86 backend and to other backends.
This optimization disables an important canonicalization of chains of SEXT nodes and makes SEXT and ZEXT asymmetrical.
Disabling the canonicalization of consecutive SEXT nodes into a single node disables other DAG optimizations that assume
that there is only one SEXT node. The AVX mask optimizations is one example. Additionally this optimization does not update the cost model.
llvm-svn: 172968
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 91491bfe802..344d1447a8d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2554,7 +2554,9 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, VT.getVectorNumElements() == Operand.getValueType().getVectorNumElements()) && "Vector element count mismatch!"); - if (OpOpcode == ISD::UNDEF) + if (OpOpcode == ISD::SIGN_EXTEND || OpOpcode == ISD::ZERO_EXTEND) + return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0)); + else if (OpOpcode == ISD::UNDEF) // sext(undef) = 0, because the top bits will all be the same. return getConstant(0, VT); break; |