summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-12-10 01:00:19 +0000
committerDan Gohman <dan433584@gmail.com>2015-12-10 01:00:19 +0000
commita5603b835ba1ef0dec4b57d93d156c9914f30f79 (patch)
tree2b59bf512e4078c22819b76cf1bf397b774ffa3c /llvm
parent71d0eae609e2860578ec322695e08f2934086f6c (diff)
downloadbcm5719-llvm-a5603b835ba1ef0dec4b57d93d156c9914f30f79.tar.gz
bcm5719-llvm-a5603b835ba1ef0dec4b57d93d156c9914f30f79.zip
[WebAssembly] Also legalize sign_extend_inreg of i32->i64.
llvm-svn: 255191
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp2
-rw-r--r--llvm/test/CodeGen/WebAssembly/legalize.ll9
2 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
index 37b82d6385a..21a28e3b767 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -159,7 +159,7 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(
// As a special case, these operators use the type to mean the type to
// sign-extend from.
- for (auto T : {MVT::i1, MVT::i8, MVT::i16})
+ for (auto T : {MVT::i1, MVT::i8, MVT::i16, MVT::i32})
setOperationAction(ISD::SIGN_EXTEND_INREG, T, Expand);
// Dynamic stack allocation: use the default expansion.
diff --git a/llvm/test/CodeGen/WebAssembly/legalize.ll b/llvm/test/CodeGen/WebAssembly/legalize.ll
index 4bfec212cf7..5279f4fa7a5 100644
--- a/llvm/test/CodeGen/WebAssembly/legalize.ll
+++ b/llvm/test/CodeGen/WebAssembly/legalize.ll
@@ -22,3 +22,12 @@ define i53 @shl_i53(i53 %a, i53 %b, i53* %p) {
%t = shl i53 %a, %b
ret i53 %t
}
+
+; CHECK-LABEL: sext_in_reg_i32_i64:
+; CHECK: i64.shl
+; CHECK: i64.shr_s
+define i64 @sext_in_reg_i32_i64(i64 %a) {
+ %b = shl i64 %a, 32
+ %c = ashr i64 %b, 32
+ ret i64 %c
+}
OpenPOWER on IntegriCloud