aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-25 01:00:22 +0000
committerChris Lattner <sabre@nondot.org>2007-08-25 01:00:22 +0000
commit09ec1b058331aadb29a348091611d23892b5c492 (patch)
tree32ae21f29093e209c4e27beb852b1f31b201f666 /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parent4a69da9cb01bae8f90c444722afa51f15d067ea4 (diff)
Allow target constants to be illegal types. The target should
know how to handle them. This fixes test/CodeGen/Generic/asm-large-immediate.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index e370e4a897..8e4d09af11 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -457,6 +457,8 @@ void SelectionDAGLegalize::HandleOp(SDOperand Op) {
// If this is an illegal scalar, expand it into its two component
// pieces.
SDOperand X, Y;
+ if (Op.getOpcode() == ISD::TargetConstant)
+ break; // Allow illegal target nodes.
ExpandOp(Op, X, Y);
} else if (MVT::getVectorNumElements(VT) == 1) {
// If this is an illegal single element vector, convert it to a
@@ -644,6 +646,9 @@ SDOperand ExpandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG,
/// is legal, recursively ensuring that the operands' operations remain
/// legal.
SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
+ if (Op.getOpcode() == ISD::TargetConstant) // Allow illegal target nodes.
+ return Op;
+
assert(isTypeLegal(Op.getValueType()) &&
"Caller should expand or promote operands that are not legal!");
SDNode *Node = Op.Val;