[llvm] r255788 - [WebAssembly] Use the new offset syntax for memory operands in inline asm.

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 10:14:50 PST 2015


Author: djg
Date: Wed Dec 16 12:14:49 2015
New Revision: 255788

URL: http://llvm.org/viewvc/llvm-project?rev=255788&view=rev
Log:
[WebAssembly] Use the new offset syntax for memory operands in inline asm.

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
    llvm/trunk/test/CodeGen/WebAssembly/inline-asm.ll

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp?rev=255788&r1=255787&r2=255788&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp Wed Dec 16 12:14:49 2015
@@ -260,7 +260,9 @@ bool WebAssemblyAsmPrinter::PrintAsmMemo
     report_fatal_error("There are no defined alternate asm variants");
 
   if (!ExtraCode) {
-    OS << regToString(MI->getOperand(OpNo));
+    // TODO: For now, we just hard-code 0 as the constant offset; teach
+    // SelectInlineAsmMemoryOperand how to do address mode matching.
+    OS << "0(" + regToString(MI->getOperand(OpNo)) + ')';
     return false;
   }
 

Modified: llvm/trunk/test/CodeGen/WebAssembly/inline-asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/inline-asm.ll?rev=255788&r1=255787&r2=255788&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/inline-asm.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/inline-asm.ll Wed Dec 16 12:14:49 2015
@@ -21,7 +21,7 @@ entry:
 ; CHECK-LABEL: bar:
 ; CHECK-NEXT: .param i32, i32{{$}}
 ; CHECK-NEXT: #APP{{$}}
-; CHECK-NEXT: # $1 = bbb($0){{$}}
+; CHECK-NEXT: # 0($1) = bbb(0($0)){{$}}
 ; CHECK-NEXT: #NO_APP{{$}}
 ; CHECK-NEXT: return{{$}}
 define void @bar(i32* %r, i32* %s) {




More information about the llvm-commits mailing list