[llvm] r255191 - [WebAssembly] Also legalize sign_extend_inreg of i32->i64.
Dan Gohman via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 9 17:00:19 PST 2015
Author: djg
Date: Wed Dec 9 19:00:19 2015
New Revision: 255191
URL: http://llvm.org/viewvc/llvm-project?rev=255191&view=rev
Log:
[WebAssembly] Also legalize sign_extend_inreg of i32->i64.
Modified:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/trunk/test/CodeGen/WebAssembly/legalize.ll
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp?rev=255191&r1=255190&r2=255191&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp Wed Dec 9 19:00:19 2015
@@ -159,7 +159,7 @@ WebAssemblyTargetLowering::WebAssemblyTa
// 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.
Modified: llvm/trunk/test/CodeGen/WebAssembly/legalize.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/legalize.ll?rev=255191&r1=255190&r2=255191&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/legalize.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/legalize.ll Wed Dec 9 19:00:19 2015
@@ -22,3 +22,12 @@ define i53 @shl_i53(i53 %a, i53 %b, i53*
%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
+}
More information about the llvm-commits
mailing list