[llvm-commits] [llvm] r41388 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/Generic/asm-large-immediate.ll

Chris Lattner sabre at nondot.org
Fri Aug 24 18:00:22 PDT 2007


Author: lattner
Date: Fri Aug 24 20:00:22 2007
New Revision: 41388

URL: http://llvm.org/viewvc/llvm-project?rev=41388&view=rev
Log:
Allow target constants to be illegal types.  The target should
know how to handle them.  This fixes 
test/CodeGen/Generic/asm-large-immediate.ll

Added:
    llvm/trunk/test/CodeGen/Generic/asm-large-immediate.ll
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=41388&r1=41387&r2=41388&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Aug 24 20:00:22 2007
@@ -457,6 +457,8 @@
       // 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 @@
 /// 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;

Added: llvm/trunk/test/CodeGen/Generic/asm-large-immediate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/asm-large-immediate.ll?rev=41388&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/Generic/asm-large-immediate.ll (added)
+++ llvm/trunk/test/CodeGen/Generic/asm-large-immediate.ll Fri Aug 24 20:00:22 2007
@@ -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
+}
+





More information about the llvm-commits mailing list