diff options
author | Dan Gohman <dan433584@gmail.com> | 2015-12-10 00:17:35 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2015-12-10 00:17:35 +0000 |
commit | df00a9ebc266744566fdb63d450fccc396e4b5c3 (patch) | |
tree | 7e41af03fc816df36949e8577d94b6e621d5f942 /llvm/test/CodeGen/WebAssembly/conv.ll | |
parent | 201c08f811cc2804e855185fbc52ca386a430d94 (diff) | |
download | bcm5719-llvm-df00a9ebc266744566fdb63d450fccc396e4b5c3.tar.gz bcm5719-llvm-df00a9ebc266744566fdb63d450fccc396e4b5c3.zip |
[WebAssembly] Implement anyext.
llvm-svn: 255179
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/conv.ll')
-rw-r--r-- | llvm/test/CodeGen/WebAssembly/conv.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/conv.ll b/llvm/test/CodeGen/WebAssembly/conv.ll index 2674a335a13..76fa38090a1 100644 --- a/llvm/test/CodeGen/WebAssembly/conv.ll +++ b/llvm/test/CodeGen/WebAssembly/conv.ll @@ -214,3 +214,14 @@ define float @f32_demote_f64(double %x) { %a = fptrunc double %x to float ret float %a } + +; If the high its are unused, LLVM will optimize sext/zext into anyext, which +; we need to patterm-match back to a specific instruction. + +; CHECK-LABEL: anyext: +; CHECK: i64.extend_u/i32 $push0=, $0{{$}} +define i64 @anyext(i32 %x) { + %y = sext i32 %x to i64 + %w = shl i64 %y, 32 + ret i64 %w +} |