diff options
author | Jim Grosbach <grosbach@apple.com> | 2014-04-09 23:28:11 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2014-04-09 23:28:11 +0000 |
commit | e9915738beed0d8b4b50dca8c0ed8c76e7d320db (patch) | |
tree | 246222ddaa0805566f60a11dbe446b3b0828efca /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 34d14bb5343753b6418dd2302349497c48db95eb (diff) | |
download | llvm-e9915738beed0d8b4b50dca8c0ed8c76e7d320db.tar.gz llvm-e9915738beed0d8b4b50dca8c0ed8c76e7d320db.tar.bz2 llvm-e9915738beed0d8b4b50dca8c0ed8c76e7d320db.tar.xz |
SelectionDAG: Don't constant fold target-specific nodes.
FoldConstantArithmetic() only knows how to deal with a few target independent
ISD opcodes. Bail early if it sees a target-specific ISD node. These node do
funny things with operand types which may break the assumptions of the code
that follows, and there's no actual folding that can be done anyway. For example,
non-constant 256 bit vector shifts on X86 have a shift-amount operand that's a
128-bit v4i32 vector regardless of what the first operand type is and that breaks
the assumption that the operand types must match.
rdar://16530923
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 8f62450839..e85739688c 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2811,6 +2811,12 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, EVT VT, SDNode *Cst1, SDNode *Cst2) { + // If the opcode is a target-specific ISD node, there's nothing we can + // do here and the operand rules may not line up with the below, so + // bail early. + if (Opcode >= ISD::BUILTIN_OP_END) + return SDValue(); + SmallVector<std::pair<ConstantSDNode *, ConstantSDNode *>, 4> Inputs; SmallVector<SDValue, 4> Outputs; EVT SVT = VT.getScalarType(); |