diff options
| author | Heejin Ahn <aheejin@gmail.com> | 2018-09-12 21:34:39 +0000 |
|---|---|---|
| committer | Heejin Ahn <aheejin@gmail.com> | 2018-09-12 21:34:39 +0000 |
| commit | 300f42fbce713633f77aee0c16e84f1ce840102b (patch) | |
| tree | 1faf12a01bdb3319321c5442bb20234603c3f282 /llvm/test/CodeGen/WebAssembly | |
| parent | d341988c86ce45a138ff78732dbbb80b78df2ad4 (diff) | |
| download | bcm5719-llvm-300f42fbce713633f77aee0c16e84f1ce840102b.tar.gz bcm5719-llvm-300f42fbce713633f77aee0c16e84f1ce840102b.zip | |
[WebAssembly] Make tied inline asm operands work again
Summary:
rL341389 broke code with tied register operands in inline assembly. For
example, `asm("" : "=r"(var) : "0"(var));`
The code above specifies the input operand to be in the same register
with the output operand, tying the two register. This patch makes this
kind of code work again.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, eraman, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D51991
llvm-svn: 342084
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly')
| -rw-r--r-- | llvm/test/CodeGen/WebAssembly/inline-asm.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/inline-asm.ll b/llvm/test/CodeGen/WebAssembly/inline-asm.ll index 0a20423d7c8..5f674f1b4de 100644 --- a/llvm/test/CodeGen/WebAssembly/inline-asm.ll +++ b/llvm/test/CodeGen/WebAssembly/inline-asm.ll @@ -97,6 +97,15 @@ entry: ret i32 %t0 } +; CHECK-LABEL: tied_operands +; CHECK: get_local $push0=, 0 +; CHECK: return $pop0 +define i32 @tied_operands(i32 %var) { +entry: + %ret = call i32 asm "", "=r,0"(i32 %var) + ret i32 %ret +} + attributes #0 = { nounwind } !0 = !{i32 47} |

