aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-07-30 06:44:31 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-07-30 06:44:31 +0000
commitfe1b227c1a71616281beb6dc6981caeafefe13b9 (patch)
treeb866b05db2593ef00bbfbcbea9a2bafdee9979ce /test
parent5c49ddb5a2323f480c1ea3603b42637f30263cc9 (diff)
downloadexternal_llvm-fe1b227c1a71616281beb6dc6981caeafefe13b9.zip
external_llvm-fe1b227c1a71616281beb6dc6981caeafefe13b9.tar.gz
external_llvm-fe1b227c1a71616281beb6dc6981caeafefe13b9.tar.bz2
Fix for bug reported by Evzen Muller on llvm-commits: make sure to correctly
check the range of the constant when optimizing a comparison between a constant and a sign_extend_inreg node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/2010-07-29-SetccSimplify.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2010-07-29-SetccSimplify.ll b/test/CodeGen/X86/2010-07-29-SetccSimplify.ll
new file mode 100644
index 0000000..96016cf
--- /dev/null
+++ b/test/CodeGen/X86/2010-07-29-SetccSimplify.ll
@@ -0,0 +1,14 @@
+; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
+
+define i32 @extend2bit_v2(i32 %val) {
+entry:
+ %0 = trunc i32 %val to i2 ; <i2> [#uses=1]
+ %1 = sext i2 %0 to i32 ; <i32> [#uses=1]
+ %2 = icmp eq i32 %1, 3 ; <i1> [#uses=1]
+ %3 = zext i1 %2 to i32 ; <i32> [#uses=1]
+ ret i32 %3
+}
+
+; CHECK: extend2bit_v2:
+; CHECK: xorl %eax, %eax
+; CHECK-NEXT: ret