Add support for matching mem operands. This fixes PR1133, patch by
authorChris Lattner <sabre@nondot.org>
Thu, 21 Feb 2008 05:27:19 +0000 (05:27 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 21 Feb 2008 05:27:19 +0000 (05:27 +0000)
Eli Friedman.  This implements CodeGen/Generic/2008-02-20-MatchingMem.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47428 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index f36a12078c35ab4a7d9a4307caad50fa7989b64f..d4e33b0d1036c6a09d8aa4780aadcaf2380742df 100644 (file)
@@ -3846,7 +3846,13 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
           break;
         } else {
           assert((NumOps & 7) == 4/*MEM*/ && "Unknown matching constraint!");
-          assert(0 && "matching constraints for memory operands unimp");
+          assert((NumOps >> 3) == 1 && "Unexpected number of operands"); 
+          // Add information to the INLINEASM node to know about this input.
+          unsigned ResOpType = 4/*MEM*/ | (1 << 3);
+          AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
+                                                          TLI.getPointerTy()));
+          AsmNodeOperands.push_back(AsmNodeOperands[CurOp+1]);
+          break;
         }
       }