Skip to content

Commit 96e8828

Browse files
committed
Tweak heuristic to limit the maximum cluster size
1 parent 5785636 commit 96e8828

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,8 +2287,9 @@ bool RISCVInstrInfo::shouldClusterMemOps(
22872287
// Assume a cache line size of 64 bytes if no size is set in RISCVSubtarget.
22882288
CacheLineSize = CacheLineSize ? CacheLineSize : 64;
22892289
// Cluster if the memory operations are on the same or a neighbouring cache
2290-
// line.
2291-
return std::abs(Offset1 - Offset2) < CacheLineSize;
2290+
// line, but limit the maximum ClusterSize to avoid creating too much
2291+
// additional register pressure.
2292+
return ClusterSize <= 4 && std::abs(Offset1 - Offset2) < CacheLineSize;
22922293
}
22932294

22942295
// Set BaseReg (the base register operand), Offset (the byte offset being

0 commit comments

Comments
 (0)