diff options
| author | Tim Northover <tnorthover@apple.com> | 2013-06-01 09:55:14 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2013-06-01 09:55:14 +0000 |
| commit | 3a1fd4c0ac7f5a17d271c895a1597273ac8252c8 (patch) | |
| tree | 0e3993ea8d5465f7be504741c2ef9e178073a885 /llvm/test/ExecutionEngine | |
| parent | 3521dcdcc453c887bf8f170a9742d36c93b18a10 (diff) | |
| download | bcm5719-llvm-3a1fd4c0ac7f5a17d271c895a1597273ac8252c8.tar.gz bcm5719-llvm-3a1fd4c0ac7f5a17d271c895a1597273ac8252c8.zip | |
X86: change MOV64ri64i32 into MOV32ri64
The MOV64ri64i32 instruction required hacky MCInst lowering because it
was allocated as setting a GR64, but the eventual instruction ("movl")
only set a GR32. This converts it into a so-called "MOV32ri64" which
still accepts a (appropriate) 64-bit immediate but defines a GR32.
This is then converted to the full GR64 by a SUBREG_TO_REG operation,
thus keeping everyone happy.
This fixes a typo in the opcode field of the original patch, which
should make the legact JIT work again (& adds test for that problem).
llvm-svn: 183068
Diffstat (limited to 'llvm/test/ExecutionEngine')
| -rw-r--r-- | llvm/test/ExecutionEngine/mov64zext32.ll | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/ExecutionEngine/mov64zext32.ll b/llvm/test/ExecutionEngine/mov64zext32.ll new file mode 100644 index 00000000000..00241c81bed --- /dev/null +++ b/llvm/test/ExecutionEngine/mov64zext32.ll @@ -0,0 +1,17 @@ +; RUN: %lli %s > /dev/null + +define i64 @foo() { + ret i64 42 +} + +define i32 @main() { + %val = call i64 @foo() + %is42 = icmp eq i64 %val, 42 + br i1 %is42, label %good, label %bad + +good: + ret i32 0 + +bad: + ret i32 1 +}
\ No newline at end of file |

