[llvm] [X86][SelectionDAG] Fix the Gather's base and index by modifying the Scale value (PR #134979)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 10:01:27 PDT 2025


================
@@ -56508,6 +56508,120 @@ static SDValue rebuildGatherScatter(MaskedGatherScatterSDNode *GorS,
                               Scatter->isTruncatingStore());
 }
 
+// Target override this function to decide whether it want to update the base
+// and index value of a non-uniform gep
+static bool updateBaseAndIndex(SDValue &Base, SDValue &Index, SDValue &Scale,
----------------
RKSimon wrote:

I'm not convinced the updateBaseAndIndex method is going to be necessary - its a very monolithic combine, which can be handled already with some of the focussed folds inside combineGatherScatter - it looks like we're just needing to address a few corner cases.

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


More information about the llvm-commits mailing list