aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorJingu Kang <jingu.kang@arm.com>2023-08-03 08:26:37 +0100
committerJingu Kang <jingu.kang@arm.com>2023-08-07 10:06:02 +0100
commitf580901d5d30e37755212f1c09e5b587587fbfeb (patch)
treeeca48b1ab429ec245a4a72bbccb70f7848140a72 /llvm/lib/CodeGen/MachineCSE.cpp
parent52ac71f92d38f75df5cb88e9c090ac5fd5a71548 (diff)
downloadllvm-f580901d5d30e37755212f1c09e5b587587fbfeb.zip
llvm-f580901d5d30e37755212f1c09e5b587587fbfeb.tar.gz
llvm-f580901d5d30e37755212f1c09e5b587587fbfeb.tar.bz2
[MachineCSE] Add an option to override the profitability heuristics
Differential Revision: https://reviews.llvm.org/D157002
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCSE.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index f879c5f..8bd7eae 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -65,6 +65,10 @@ static cl::opt<int>
CSUsesThreshold("csuses-threshold", cl::Hidden, cl::init(1024),
cl::desc("Threshold for the size of CSUses"));
+static cl::opt<bool> AggressiveMachineCSE(
+ "aggressive-machine-cse", cl::Hidden, cl::init(false),
+ cl::desc("Override the profitability heuristics for Machine CSE"));
+
namespace {
class MachineCSE : public MachineFunctionPass {
@@ -439,6 +443,9 @@ bool MachineCSE::isCSECandidate(MachineInstr *MI) {
/// defined.
bool MachineCSE::isProfitableToCSE(Register CSReg, Register Reg,
MachineBasicBlock *CSBB, MachineInstr *MI) {
+ if (AggressiveMachineCSE)
+ return true;
+
// FIXME: Heuristics that works around the lack the live range splitting.
// If CSReg is used at all uses of Reg, CSE should not increase register