summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2014-08-26 19:06:41 +0000
committerJoerg Sonnenberger <joerg@bec.de>2014-08-26 19:06:41 +0000
commitcb5674b9c2e4d7944bd8fe0ed92f316e8e5d5f30 (patch)
treee8ebd36657839d78d042fc5c2f9aa0a4350b0e06 /llvm/test/Transforms
parentbb9a858b25de526dc59701693a05b401c75fa0ed (diff)
downloadbcm5719-llvm-cb5674b9c2e4d7944bd8fe0ed92f316e8e5d5f30.tar.gz
bcm5719-llvm-cb5674b9c2e4d7944bd8fe0ed92f316e8e5d5f30.zip
Revert r210342 and r210343, add test case for the crasher.
PR 20642. llvm-svn: 216475
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/SLPVectorizer/X86/crash_gep.ll19
-rw-r--r--llvm/test/Transforms/SLPVectorizer/X86/gep.ll41
2 files changed, 19 insertions, 41 deletions
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/crash_gep.ll b/llvm/test/Transforms/SLPVectorizer/X86/crash_gep.ll
new file mode 100644
index 00000000000..dd4034c116e
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/crash_gep.ll
@@ -0,0 +1,19 @@
+; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-unknown-linux-gnu
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+@a = common global i64* null, align 8
+
+; Function Attrs: nounwind uwtable
+define i32 @fn1() {
+entry:
+ %0 = load i64** @a, align 8
+ %add.ptr = getelementptr inbounds i64* %0, i64 1
+ %1 = ptrtoint i64* %add.ptr to i64
+ %arrayidx = getelementptr inbounds i64* %0, i64 2
+ store i64 %1, i64* %arrayidx, align 8
+ %2 = ptrtoint i64* %arrayidx to i64
+ store i64 %2, i64* %add.ptr, align 8
+ ret i32 undef
+}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/gep.ll b/llvm/test/Transforms/SLPVectorizer/X86/gep.ll
deleted file mode 100644
index 9e105ec9848..00000000000
--- a/llvm/test/Transforms/SLPVectorizer/X86/gep.ll
+++ /dev/null
@@ -1,41 +0,0 @@
-; RUN: opt < %s -basicaa -slp-vectorizer -S |FileCheck %s
-target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-
-; Test if SLP can handle GEP expressions.
-; The test perform the following action:
-; x->first = y->first + 16
-; x->second = y->second + 16
-
-; CHECK-LABEL: foo1
-; CHECK: <2 x i32*>
-define void @foo1 ({ i32*, i32* }* noalias %x, { i32*, i32* }* noalias %y) {
- %1 = getelementptr inbounds { i32*, i32* }* %y, i64 0, i32 0
- %2 = load i32** %1, align 8
- %3 = getelementptr inbounds i32* %2, i64 16
- %4 = getelementptr inbounds { i32*, i32* }* %x, i64 0, i32 0
- store i32* %3, i32** %4, align 8
- %5 = getelementptr inbounds { i32*, i32* }* %y, i64 0, i32 1
- %6 = load i32** %5, align 8
- %7 = getelementptr inbounds i32* %6, i64 16
- %8 = getelementptr inbounds { i32*, i32* }* %x, i64 0, i32 1
- store i32* %7, i32** %8, align 8
- ret void
-}
-
-; Test that we don't vectorize GEP expressions if indexes are not constants.
-; We can't produce an efficient code in that case.
-; CHECK-LABEL: foo2
-; CHECK-NOT: <2 x i32*>
-define void @foo2 ({ i32*, i32* }* noalias %x, { i32*, i32* }* noalias %y, i32 %i) {
- %1 = getelementptr inbounds { i32*, i32* }* %y, i64 0, i32 0
- %2 = load i32** %1, align 8
- %3 = getelementptr inbounds i32* %2, i32 %i
- %4 = getelementptr inbounds { i32*, i32* }* %x, i64 0, i32 0
- store i32* %3, i32** %4, align 8
- %5 = getelementptr inbounds { i32*, i32* }* %y, i64 0, i32 1
- %6 = load i32** %5, align 8
- %7 = getelementptr inbounds i32* %6, i32 %i
- %8 = getelementptr inbounds { i32*, i32* }* %x, i64 0, i32 1
- store i32* %7, i32** %8, align 8
- ret void
-}
OpenPOWER on IntegriCloud