[llvm] [SelectionDAG][RISCV] Avoid store merging across function calls (PR #130430)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 18 12:57:49 PDT 2025


================
@@ -21553,6 +21601,15 @@ bool DAGCombiner::tryStoreMergeOfLoads(SmallVectorImpl<MemOpLink> &StoreNodes,
       JointMemOpVT = EVT::getIntegerVT(Context, SizeInBits);
     }
 
+    // Check if there is a call in the load/store chain.
----------------
preames wrote:

I just noticed there is a better integration here.  The way you have this phrased, we either can merge to the vector type, or we don't merge at all.

I think what you actually want to do here is to add a couple parameters to the existing canMergeStoresTo interface.  If you add both the SrcVT, and a "IsOverCall" boolean, then that interface returning the answer suggested above in the IsOverCall case will result in a wider scalar type being chosen if one is available.  

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


More information about the llvm-commits mailing list