[llvm] [CGP] Scalarize non-constant indices for geps feeding gather/scatter (PR #145952)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 26 12:08:22 PDT 2025


================
@@ -139,7 +139,8 @@ define <4 x i32> @scalar_prefix_with_splat(ptr %base, i64 %index, <4 x i64> %vec
 
 define <4 x i32> @scalar_prefix_with_constant_splat(ptr %base, <4 x i64> %vecidx) {
 ; CHECK-LABEL: @scalar_prefix_with_constant_splat(
-; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr [256 x i32], ptr [[BASE:%.*]], <4 x i64> splat (i64 20), <4 x i64> [[VECIDX:%.*]]
+; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr [256 x i32], ptr [[BASE:%.*]], i64 20, i64 0
----------------
preames wrote:

This slightly surprising diff is because we weren't setting RewriteGEP when scalarizing constants for indices except the first and last.

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


More information about the llvm-commits mailing list