summaryrefslogtreecommitdiff
path: root/test/Transforms/SLPVectorizer
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-08-02 18:40:24 +0000
committerNadav Rotem <nrotem@apple.com>2013-08-02 18:40:24 +0000
commitf2855f88864cb00c774114b80b78f2388821b8ca (patch)
tree5565f4a8c08d17ccacd27bbba6a0444f474a3d5a /test/Transforms/SLPVectorizer
parent38140c2bbe80d146f59863b96947e83f4942bda0 (diff)
downloadllvm-f2855f88864cb00c774114b80b78f2388821b8ca.tar.gz
llvm-f2855f88864cb00c774114b80b78f2388821b8ca.tar.bz2
llvm-f2855f88864cb00c774114b80b78f2388821b8ca.tar.xz
SLPVectorizer: Fix PR16777. PHInodes may use multiple extracted values that come from different blocks.
Thanks Alexey Samsonov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SLPVectorizer')
-rw-r--r--test/Transforms/SLPVectorizer/X86/phi3.ll35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/Transforms/SLPVectorizer/X86/phi3.ll b/test/Transforms/SLPVectorizer/X86/phi3.ll
new file mode 100644
index 0000000000..fd8d361372
--- /dev/null
+++ b/test/Transforms/SLPVectorizer/X86/phi3.ll
@@ -0,0 +1,35 @@
+; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.8.0"
+
+%struct.GPar.0.16.26 = type { [0 x double], double }
+
+@d = external global double, align 8
+
+declare %struct.GPar.0.16.26* @Rf_gpptr(...)
+
+define void @Rf_GReset() {
+entry:
+ %sub = fsub double -0.000000e+00, undef
+ %0 = load double* @d, align 8
+ %sub1 = fsub double -0.000000e+00, %0
+ br i1 icmp eq (%struct.GPar.0.16.26* (...)* inttoptr (i64 115 to %struct.GPar.0.16.26* (...)*), %struct.GPar.0.16.26* (...)* @Rf_gpptr), label %if.then, label %if.end7
+
+if.then: ; preds = %entry
+ %sub2 = fsub double %sub, undef
+ %div.i = fdiv double %sub2, undef
+ %sub4 = fsub double %sub1, undef
+ %div.i16 = fdiv double %sub4, undef
+ %cmp = fcmp ogt double %div.i, %div.i16
+ br i1 %cmp, label %if.then6, label %if.end7
+
+if.then6: ; preds = %if.then
+ br label %if.end7
+
+if.end7: ; preds = %if.then6, %if.then, %entry
+ %g.0 = phi double [ 0.000000e+00, %if.then6 ], [ %sub, %if.then ], [ %sub, %entry ]
+ ret void
+}
+
+