Skip to content

Commit de96633

Browse files
Address comment
Signed-off-by: Mikhail R. Gadelha <[email protected]>
1 parent 75f4caa commit de96633

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3522,7 +3522,7 @@ class TargetLoweringBase {
35223522

35233523
/// Returns true if it's profitable to allow merging store of loads when there
35243524
/// are functions calls between the load and the store.
3525-
virtual bool shouldMergeStoreOfLoadsOverCall(EVT) const { return true; }
3525+
virtual bool shouldMergeStoreOfLoadsOverCall(EVT, EVT) const { return true; }
35263526

35273527
//===----------------------------------------------------------------------===//
35283528
// GlobalISel Hooks

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21647,7 +21647,7 @@ bool DAGCombiner::tryStoreMergeOfLoads(SmallVectorImpl<MemOpLink> &StoreNodes,
2164721647
}
2164821648

2164921649
// Check if there is a call in the load/store chain.
21650-
if (!TLI.shouldMergeStoreOfLoadsOverCall(JointMemOpVT) &&
21650+
if (!TLI.shouldMergeStoreOfLoadsOverCall(MemVT, JointMemOpVT) &&
2165121651
hasCallInLdStChain(StoreNodes, LoadNodes, NumElem)) {
2165221652
StoreNodes.erase(StoreNodes.begin(), StoreNodes.begin() + NumElem);
2165321653
LoadNodes.erase(LoadNodes.begin(), LoadNodes.begin() + NumElem);

llvm/lib/Target/RISCV/RISCVISelLowering.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,8 +1073,8 @@ class RISCVTargetLowering : public TargetLowering {
10731073
/// Disables storing and loading vectors by default when there are function
10741074
/// calls between the load and store, since these are more expensive than just
10751075
/// using scalars
1076-
bool shouldMergeStoreOfLoadsOverCall(EVT VT) const override {
1077-
return VT.isScalarInteger();
1076+
bool shouldMergeStoreOfLoadsOverCall(EVT SrcVT, EVT MergedVT) const override {
1077+
return SrcVT.isScalarInteger() == MergedVT.isScalarInteger();
10781078
}
10791079

10801080
/// For available scheduling models FDIV + two independent FMULs are much

0 commit comments

Comments
 (0)