[llvm] [VPlan] Extend CSE to eliminate GEPs (PR #156699)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 8 04:12:40 PDT 2025


================
@@ -136,7 +136,7 @@ define void @vectorize_without_optsize(ptr %p, i32 %x, i64 %n) {
 ; DEFAULT:       [[VECTOR_BODY]]:
 ; DEFAULT-NEXT:    [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
 ; DEFAULT-NEXT:    [[TMP1:%.*]] = getelementptr inbounds i32, ptr [[P]], i64 [[INDEX]]
-; DEFAULT-NEXT:    [[TMP3:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i32 4
+; DEFAULT-NEXT:    [[TMP3:%.*]] = getelementptr i32, ptr [[TMP1]], i32 4
----------------
lukel97 wrote:

You can just manually inspect the codegen with the ./utils/tdiff.py script, it should show you where instructions changed etc.

https://github.com/llvm/llvm-project/pull/156699


More information about the llvm-commits mailing list