aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-12 05:58:43 +0000
committerChris Lattner <sabre@nondot.org>2007-04-12 05:58:43 +0000
commit4829b1c6ab810ee274a104985915988b4f92aa7a (patch)
tree0ca8ea62f615854c46290b8b198d8582830fce31 /lib/CodeGen
parent1780d861ac8251c78f71df8af4ed39d97cf919bb (diff)
downloadexternal_llvm-4829b1c6ab810ee274a104985915988b4f92aa7a.zip
external_llvm-4829b1c6ab810ee274a104985915988b4f92aa7a.tar.gz
external_llvm-4829b1c6ab810ee274a104985915988b4f92aa7a.tar.bz2
fold noop vbitconvert instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index a51f79f..7c8a94e 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1484,6 +1484,15 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
MVT::getVectorNumElements(VT) == N3.getNumOperands() &&
"Illegal VECTOR_SHUFFLE node!");
break;
+ case ISD::VBIT_CONVERT:
+ // Fold vbit_convert nodes from a type to themselves.
+ if (N1.getValueType() == MVT::Vector) {
+ assert(isa<ConstantSDNode>(*(N1.Val->op_end()-2)) &&
+ isa<VTSDNode>(*(N1.Val->op_end()-1)) && "Malformed vector input!");
+ if (*(N1.Val->op_end()-2) == N2 && *(N1.Val->op_end()-1) == N3)
+ return N1;
+ }
+ break;
}
// Memoize node if it doesn't produce a flag.