summaryrefslogtreecommitdiff
path: root/test/Transforms/SLPVectorizer
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2013-10-16 16:09:00 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2013-10-16 16:09:00 +0000
commitc4e2060ecc5b74021c5639f7e8b1a063b598feac (patch)
tree7e72c5eae993e405c3dbe04fced441dae4df0cd2 /test/Transforms/SLPVectorizer
parenta24cd7206d08372e453438222e33d1ebf7284579 (diff)
downloadllvm-c4e2060ecc5b74021c5639f7e8b1a063b598feac.tar.gz
llvm-c4e2060ecc5b74021c5639f7e8b1a063b598feac.tar.bz2
llvm-c4e2060ecc5b74021c5639f7e8b1a063b598feac.tar.xz
SLPVectorizer: Don't vectorize volatile memory operations
radar://15231682 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SLPVectorizer')
-rw-r--r--test/Transforms/SLPVectorizer/X86/simplebb.ll43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/Transforms/SLPVectorizer/X86/simplebb.ll b/test/Transforms/SLPVectorizer/X86/simplebb.ll
index 0b76bec07b..7d682e5e46 100644
--- a/test/Transforms/SLPVectorizer/X86/simplebb.ll
+++ b/test/Transforms/SLPVectorizer/X86/simplebb.ll
@@ -44,3 +44,46 @@ entry:
store double %mul5, double* %arrayidx5, align 8
ret void
}
+
+; Don't vectorize volatile loads.
+; CHECK: test_volatile_load
+; CHECK-NOT: load <2 x double>
+; CHECK: store <2 x double>
+; CHECK: ret
+define void @test_volatile_load(double* %a, double* %b, double* %c) {
+entry:
+ %i0 = load volatile double* %a, align 8
+ %i1 = load volatile double* %b, align 8
+ %mul = fmul double %i0, %i1
+ %arrayidx3 = getelementptr inbounds double* %a, i64 1
+ %i3 = load double* %arrayidx3, align 8
+ %arrayidx4 = getelementptr inbounds double* %b, i64 1
+ %i4 = load double* %arrayidx4, align 8
+ %mul5 = fmul double %i3, %i4
+ store double %mul, double* %c, align 8
+ %arrayidx5 = getelementptr inbounds double* %c, i64 1
+ store double %mul5, double* %arrayidx5, align 8
+ ret void
+}
+
+; Don't vectorize volatile stores.
+; CHECK: test_volatile_store
+; CHECK-NOT: store <2 x double>
+; CHECK: ret
+define void @test_volatile_store(double* %a, double* %b, double* %c) {
+entry:
+ %i0 = load double* %a, align 8
+ %i1 = load double* %b, align 8
+ %mul = fmul double %i0, %i1
+ %arrayidx3 = getelementptr inbounds double* %a, i64 1
+ %i3 = load double* %arrayidx3, align 8
+ %arrayidx4 = getelementptr inbounds double* %b, i64 1
+ %i4 = load double* %arrayidx4, align 8
+ %mul5 = fmul double %i3, %i4
+ store volatile double %mul, double* %c, align 8
+ %arrayidx5 = getelementptr inbounds double* %c, i64 1
+ store volatile double %mul5, double* %arrayidx5, align 8
+ ret void
+}
+
+