summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-18 04:28:19 +0000
committerChris Lattner <sabre@nondot.org>2010-08-18 04:28:19 +0000
commit91b2307a89b836f9452cf867e077ce9762d0845b (patch)
tree0b7b08dcecc5d39f7f317f28b9b45576d10b1f10 /test
parent903175096e35a9e32dbe2392425f8fa9e33e9787 (diff)
downloadllvm-91b2307a89b836f9452cf867e077ce9762d0845b.tar.gz
llvm-91b2307a89b836f9452cf867e077ce9762d0845b.tar.bz2
llvm-91b2307a89b836f9452cf867e077ce9762d0845b.tar.xz
fix PR7589: In brief:
gep P, (zext x) != gep P, (sext x) DecomposeGEPExpression was getting this wrong, confusing basicaa. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/BasicAA/featuretest.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/featuretest.ll b/test/Analysis/BasicAA/featuretest.ll
index ce71e9af95..47d278fab1 100644
--- a/test/Analysis/BasicAA/featuretest.ll
+++ b/test/Analysis/BasicAA/featuretest.ll
@@ -104,3 +104,24 @@ define i32 @constexpr_test() {
; CHECK: @constexpr_test
; CHECK: ret i32 0
}
+
+
+
+; PR7589
+; These two index expressions are different, this cannot be CSE'd.
+define i16 @zext_sext_confusion(i16* %row2col, i5 %j) nounwind{
+entry:
+ %sum5.cast = zext i5 %j to i64 ; <i64> [#uses=1]
+ %P1 = getelementptr i16* %row2col, i64 %sum5.cast
+ %row2col.load.1.2 = load i16* %P1, align 1 ; <i16> [#uses=1]
+
+ %sum13.cast31 = sext i5 %j to i6 ; <i6> [#uses=1]
+ %sum13.cast = zext i6 %sum13.cast31 to i64 ; <i64> [#uses=1]
+ %P2 = getelementptr i16* %row2col, i64 %sum13.cast
+ %row2col.load.1.6 = load i16* %P2, align 1 ; <i16> [#uses=1]
+
+ %.ret = sub i16 %row2col.load.1.6, %row2col.load.1.2 ; <i16> [#uses=1]
+ ret i16 %.ret
+; CHECK: @zext_sext_confusion
+; CHECK: ret i16 %.ret
+}