[PATCH] D27413: Simplify gep (gep p, a), (b-a)

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 12:07:46 PST 2016


davide added inline comments.


================
Comment at: test/Transforms/InstCombine/getelementptr.ll:886-893
+define i32* @test47(i32* %I, i64 %C, i64 %D) {
+  %sub = sub i64 %D, %C
+  %A = getelementptr i32, i32* %I, i64 %C
+  %B = getelementptr i32, i32* %A, i64 %sub
+  ret i32* %B
+; CHECK-LABEL: @test47(
+; CHECK: %B = getelementptr i32, i32* %I, i64 %D
----------------
My understanding of the transform is that the first `gep` will be removed right?
So, maybe add
`CHECK-NOT: getelementptr i32, i32* %I, i64 %C` 
here and in the other tests?


https://reviews.llvm.org/D27413





More information about the llvm-commits mailing list