aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChristopher Lamb <christopher.lamb@gmail.com>2007-08-10 21:48:46 +0000
committerChristopher Lamb <christopher.lamb@gmail.com>2007-08-10 21:48:46 +0000
commitc59e52108bbfca50b23c5d10706484d4b012c344 (patch)
tree66ef3643772f9ca45555550bf33a82adfa46f1ea /test
parent6f41435879ccf860aaceef51a2e06bf3f6d25188 (diff)
downloadexternal_llvm-c59e52108bbfca50b23c5d10706484d4b012c344.zip
external_llvm-c59e52108bbfca50b23c5d10706484d4b012c344.tar.gz
external_llvm-c59e52108bbfca50b23c5d10706484d4b012c344.tar.bz2
Increase efficiency of sign_extend_inreg by using subregisters for truncation. As the README suggests sign_extend_subreg is selected to (sext(trunc)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/2007-08-10-SignExtSubreg.ll10
-rw-r--r--test/CodeGen/X86/shl_elim.ll4
2 files changed, 12 insertions, 2 deletions
diff --git a/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll b/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
new file mode 100644
index 0000000..c94096a
--- /dev/null
+++ b/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep {movsbl .al, .eax}
+
+@X = global i32 0 ; <i32*> [#uses=1]
+
+define i8 @_Z3fooi(i32 %x) signext {
+entry:
+ store i32 %x, i32* @X, align 4
+ %retval67 = trunc i32 %x to i8 ; <i8> [#uses=1]
+ ret i8 %retval67
+} \ No newline at end of file
diff --git a/test/CodeGen/X86/shl_elim.ll b/test/CodeGen/X86/shl_elim.ll
index 3c447f7..d3616f4 100644
--- a/test/CodeGen/X86/shl_elim.ll
+++ b/test/CodeGen/X86/shl_elim.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 | grep {movl 8(.esp), %eax}
-; RUN: llvm-as < %s | llc -march=x86 | grep {shll .15, .eax}
-; RUN: llvm-as < %s | llc -march=x86 | grep {sarl .16, .eax}
+; RUN: llvm-as < %s | llc -march=x86 | grep {shrl .eax}
+; RUN: llvm-as < %s | llc -march=x86 | grep {movswl .ax, .eax}
define i32 @test1(i64 %a) {
%tmp29 = lshr i64 %a, 24 ; <i64> [#uses=1]