summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-11-18 20:05:18 +0000
committerDuncan Sands <baldrick@free.fr>2010-11-18 20:05:18 +0000
commit12f3b3b44fabdd242da46eeb16b299b8c696709e (patch)
tree2cd018703f664fa5704a9bca08806c3a19d7c991 /llvm/test
parentaef146b890e8d22153c3a2fa196126adc722961a (diff)
downloadbcm5719-llvm-12f3b3b44fabdd242da46eeb16b299b8c696709e.tar.gz
bcm5719-llvm-12f3b3b44fabdd242da46eeb16b299b8c696709e.zip
The DAGCombiner was threading select over pairs of extending loads even
if the extension types were not the same. The result was that if you fed a select with sext and zext loads, as in the testcase, then it would get turned into a zext (or sext) of the select, which is wrong in the cases when it should have been an sext (resp. zext). Reported and diagnosed by Sebastien Deldon. llvm-svn: 119728
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/2010-11-18-SelectOfExtload.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/2010-11-18-SelectOfExtload.ll b/llvm/test/CodeGen/X86/2010-11-18-SelectOfExtload.ll
new file mode 100644
index 00000000000..a1074b6b8f3
--- /dev/null
+++ b/llvm/test/CodeGen/X86/2010-11-18-SelectOfExtload.ll
@@ -0,0 +1,15 @@
+; RUN: llc < %s -march=x86 | FileCheck %s
+; Both values were being zero extended.
+@u = external global i8
+@s = external global i8
+define i32 @foo(i1 %cond) {
+; CHECK: @foo
+ %u_base = load i8* @u
+ %u_val = zext i8 %u_base to i32
+; CHECK: movzbl
+; CHECK: movsbl
+ %s_base = load i8* @s
+ %s_val = sext i8 %s_base to i32
+ %val = select i1 %cond, i32 %u_val, i32 %s_val
+ ret i32 %val
+}
OpenPOWER on IntegriCloud