summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/pr3243.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-01-20 21:25:12 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-01-20 21:25:12 +0000
commita894ae130b6e69a367aa691eec7e96973a20e901 (patch)
treebea608a84ccd26f40b52d9c017d2ab0b4f7f79f0 /test/CodeGen/X86/pr3243.ll
parent9c70819da0cb4e418adfff4e6610317dd7209eda (diff)
downloadllvm-a894ae130b6e69a367aa691eec7e96973a20e901.tar.gz
llvm-a894ae130b6e69a367aa691eec7e96973a20e901.tar.bz2
llvm-a894ae130b6e69a367aa691eec7e96973a20e901.tar.xz
Fix PR3243: a LiveVariables bug. When HandlePhysRegKill is checking whether the last reference is also the last def (i.e. dead def), it should also check if last reference is the current machine instruction being processed. This can happen when it is processing a physical register use and setting the current machine instruction as sub-register's last ref.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62617 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/pr3243.ll')
-rw-r--r--test/CodeGen/X86/pr3243.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/X86/pr3243.ll b/test/CodeGen/X86/pr3243.ll
new file mode 100644
index 0000000000..7be887b38e
--- /dev/null
+++ b/test/CodeGen/X86/pr3243.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=x86
+; PR3243
+
+declare signext i16 @safe_mul_func_int16_t_s_s(i16 signext, i32) nounwind readnone optsize
+
+define i32 @func_120(i32 %p_121) nounwind optsize {
+entry:
+ %0 = trunc i32 %p_121 to i16 ; <i16> [#uses=1]
+ %1 = urem i16 %0, -15461 ; <i16> [#uses=1]
+ %phitmp1 = trunc i16 %1 to i8 ; <i8> [#uses=1]
+ %phitmp2 = urem i8 %phitmp1, -1 ; <i8> [#uses=1]
+ %phitmp3 = zext i8 %phitmp2 to i16 ; <i16> [#uses=1]
+ %2 = tail call signext i16 @safe_mul_func_int16_t_s_s(i16 signext %phitmp3, i32 1) nounwind ; <i16> [#uses=0]
+ unreachable
+}