[llvm] [X86] combineConstantPoolLoads - correctly merge constant pool loads by pointer and chain (PR #139575)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 07:31:52 PDT 2025


================
@@ -52902,6 +52902,7 @@ static SDValue combineConstantPoolLoads(SDNode *N, const SDLoc &dl,
               getTargetConstantBitsFromNode(SDValue(User, 0), NumBits,
                                             UserUndefs, UserBits)) {
             if (MatchingBits(Undefs, UserUndefs, Bits, UserBits)) {
+              DAG.makeEquivalentMemoryOrdering(SDValue(N, 1), SDValue(User, 1));
----------------
RKSimon wrote:

I don't think this one is necessary as both should be constant pool loads so shouldn't be affected by later stores, but I felt it was good practice to include it.

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


More information about the llvm-commits mailing list