[llvm] [CGP] Reassociate GEPs to separate scalar and vector indexing (PR #146379)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 3 15:01:12 PDT 2025


================
@@ -112,7 +112,9 @@ define void @splat_ptr_scatter(ptr %ptr, <4 x i1> %mask, <4 x i32> %val) {
 
 define <4 x i32> @scalar_prefix(ptr %base, i64 %index, <4 x i64> %vecidx) {
 ; CHECK-LABEL: @scalar_prefix(
-; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr [256 x i32], ptr [[BASE:%.*]], i64 [[INDEX:%.*]], <4 x i64> [[VECIDX:%.*]]
+; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr [256 x i32], ptr [[BASE:%.*]], i64 [[INDEX:%.*]], i64 0
+; CHECK-NEXT:    [[TMP3:%.*]] = bitcast ptr [[TMP1]] to ptr
----------------
topperc wrote:

Why did it get created? Was the type different at some point that required a bitcast and then it got replaced?

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


More information about the llvm-commits mailing list