mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-09 07:24:39 +00:00
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
This commit is contained in:
@ -457,6 +457,8 @@ void SelectionDAGLegalize::HandleOp(SDOperand Op) {
|
|||||||
// If this is an illegal scalar, expand it into its two component
|
// If this is an illegal scalar, expand it into its two component
|
||||||
// pieces.
|
// pieces.
|
||||||
SDOperand X, Y;
|
SDOperand X, Y;
|
||||||
|
if (Op.getOpcode() == ISD::TargetConstant)
|
||||||
|
break; // Allow illegal target nodes.
|
||||||
ExpandOp(Op, X, Y);
|
ExpandOp(Op, X, Y);
|
||||||
} else if (MVT::getVectorNumElements(VT) == 1) {
|
} else if (MVT::getVectorNumElements(VT) == 1) {
|
||||||
// If this is an illegal single element vector, convert it to a
|
// 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
|
/// is legal, recursively ensuring that the operands' operations remain
|
||||||
/// legal.
|
/// legal.
|
||||||
SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||||
|
if (Op.getOpcode() == ISD::TargetConstant) // Allow illegal target nodes.
|
||||||
|
return Op;
|
||||||
|
|
||||||
assert(isTypeLegal(Op.getValueType()) &&
|
assert(isTypeLegal(Op.getValueType()) &&
|
||||||
"Caller should expand or promote operands that are not legal!");
|
"Caller should expand or promote operands that are not legal!");
|
||||||
SDNode *Node = Op.Val;
|
SDNode *Node = Op.Val;
|
||||||
|
8
test/CodeGen/Generic/asm-large-immediate.ll
Normal file
8
test/CodeGen/Generic/asm-large-immediate.ll
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
; RUN: llvm-as < %s | llc | grep 68719476738
|
||||||
|
|
||||||
|
define void @test() {
|
||||||
|
entry:
|
||||||
|
tail call void asm sideeffect "/* result: ${0:c} */", "i,~{dirflag},~{fpsr},~{flags}"( i64 68719476738 )
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user