[llvm] [X86][CostModel] Cost gathers by the instructions CodeGen emits (PR #220565)

Sumukh J Bharadwaj via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 06:23:20 PDT 2026


================
@@ -227,6 +227,22 @@ Makes programs 10x faster by doing Special New Thing.
 
 ### Changes to the X86 Backend
 
+* Masked gather/scatter operations that are split across several registers are
+  costed more accurately. Lanes in a vector whose length is not a multiple of
+  its split factor are no longer dropped, so a `v9i32` gather is costed as nine
+  lanes rather than eight. The index width is also chosen for the operation as
+  a whole rather than recomputed for each part, so a wide gather through a
+  32-bit-index GEP is no longer priced as if it used 64-bit indices. Both
+  corrections apply to every X86 subtarget and every cost kind. Lengths that do
----------------
amd-subharad wrote:

Modified this to state the conditions

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


More information about the llvm-commits mailing list