[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:29:41 PDT 2025


================
@@ -52880,7 +52880,7 @@ static SDValue combineConstantPoolLoads(SDNode *N, const SDLoc &dl,
         (User->getOpcode() == X86ISD::SUBV_BROADCAST_LOAD ||
          User->getOpcode() == X86ISD::VBROADCAST_LOAD ||
          ISD::isNormalLoad(User)) &&
-        UserLd->getChain() == Chain && !User->hasAnyUseOfValue(1) &&
+        UserLd->getChain() == Chain && User->hasAnyUseOfValue(0) &&
----------------
RKSimon wrote:

Yes, even if we're removed uses of the loaded value, there might be cases where the output chain is still in a TokenFactor node, leading to infinite loops.

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


More information about the llvm-commits mailing list