[llvm] [VPlan] Extend CSE to eliminate GEPs (PR #156699)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 8 03:32:44 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
----------------
artagnon wrote:
Yes, they are, as mentioned in the commit message. In general, we have to drop GEP no-wrap flags to perform a replacement, and the legacy CSE doesn't do this, which I would argue is incorrect?
https://github.com/llvm/llvm-project/pull/156699
More information about the llvm-commits
mailing list