aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2024-06-14 08:51:56 +0100
committerGitHub <noreply@github.com>2024-06-14 08:51:56 +0100
commit706e1975400b3f30bd406b694bb711a7c7dbe1c4 (patch)
tree6070cc4b97549c0bd2a7cda2c122ea398a828f92 /llvm/lib
parentd712ae4a21822a51817941e7007e0dd41343cde3 (diff)
downloadllvm-706e1975400b3f30bd406b694bb711a7c7dbe1c4.zip
llvm-706e1975400b3f30bd406b694bb711a7c7dbe1c4.tar.gz
llvm-706e1975400b3f30bd406b694bb711a7c7dbe1c4.tar.bz2
[CodeGen] Remove target SubRegLiveness flags (#95437)
This removes the uses of target flags to disable subreg liveness, relying on the `-enable-subreg-liveness` flag instead. The `-enable-subreg-liveness` flag has been changed to take precedence over the subtarget if set, and one use of `Subtarget->enableSubRegLiveness()` has been changed to `MRI->subRegLivenessEnabled()` to make sure the option properly applies.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/InitUndef.cpp2
-rw-r--r--llvm/lib/CodeGen/MachineRegisterInfo.cpp6
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.cpp5
-rw-r--r--llvm/lib/Target/Hexagon/HexagonSubtarget.cpp8
-rw-r--r--llvm/lib/Target/PowerPC/PPCSubtarget.cpp9
-rw-r--r--llvm/lib/Target/RISCV/RISCVSubtarget.cpp9
6 files changed, 8 insertions, 31 deletions
diff --git a/llvm/lib/CodeGen/InitUndef.cpp b/llvm/lib/CodeGen/InitUndef.cpp
index 96ac385..51c50ff 100644
--- a/llvm/lib/CodeGen/InitUndef.cpp
+++ b/llvm/lib/CodeGen/InitUndef.cpp
@@ -238,7 +238,7 @@ bool InitUndef::processBasicBlock(MachineFunction &MF, MachineBasicBlock &MBB,
}
if (isEarlyClobberMI(MI)) {
- if (ST->enableSubRegLiveness())
+ if (MRI->subRegLivenessEnabled())
Changed |= handleSubReg(MF, MI, DLD);
Changed |= handleReg(&MI);
}
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
index b0c1838b..3caa96c 100644
--- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
@@ -41,8 +41,10 @@ static cl::opt<bool> EnableSubRegLiveness("enable-subreg-liveness", cl::Hidden,
void MachineRegisterInfo::Delegate::anchor() {}
MachineRegisterInfo::MachineRegisterInfo(MachineFunction *MF)
- : MF(MF), TracksSubRegLiveness(MF->getSubtarget().enableSubRegLiveness() &&
- EnableSubRegLiveness) {
+ : MF(MF),
+ TracksSubRegLiveness(EnableSubRegLiveness.getNumOccurrences()
+ ? EnableSubRegLiveness
+ : MF->getSubtarget().enableSubRegLiveness()) {
unsigned NumRegs = getTargetRegisterInfo()->getNumRegs();
VRegInfo.reserve(256);
RegAllocHints.reserve(256);
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp
index a8c6cd99..b66a41d 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.cpp
+++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp
@@ -68,9 +68,6 @@ static cl::opt<bool>
ForceFastISel("arm-force-fast-isel",
cl::init(false), cl::Hidden);
-static cl::opt<bool> EnableSubRegLiveness("arm-enable-subreg-liveness",
- cl::init(false), cl::Hidden);
-
/// initializeSubtargetDependencies - Initializes using a CPU and feature string
/// so that we can use initializer lists for subtarget initialization.
ARMSubtarget &ARMSubtarget::initializeSubtargetDependencies(StringRef CPU,
@@ -385,8 +382,6 @@ bool ARMSubtarget::enableMachineScheduler() const {
}
bool ARMSubtarget::enableSubRegLiveness() const {
- if (EnableSubRegLiveness.getNumOccurrences())
- return EnableSubRegLiveness;
// Enable SubRegLiveness for MVE to better optimize s subregs for mqpr regs
// and q subregs for qqqqpr regs.
return hasMVEIntegerOps();
diff --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
index da8ab5c..5e71384 100644
--- a/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
@@ -55,10 +55,6 @@ static cl::opt<bool>
DisableHexagonMISched("disable-hexagon-misched", cl::Hidden,
cl::desc("Disable Hexagon MI Scheduling"));
-static cl::opt<bool> EnableSubregLiveness(
- "hexagon-subreg-liveness", cl::Hidden, cl::init(true),
- cl::desc("Enable subregister liveness tracking for Hexagon"));
-
static cl::opt<bool> OverrideLongCalls(
"hexagon-long-calls", cl::Hidden,
cl::desc("If present, forces/disables the use of long calls"));
@@ -726,9 +722,7 @@ unsigned HexagonSubtarget::getL1PrefetchDistance() const {
return 32;
}
-bool HexagonSubtarget::enableSubRegLiveness() const {
- return EnableSubregLiveness;
-}
+bool HexagonSubtarget::enableSubRegLiveness() const { return true; }
Intrinsic::ID HexagonSubtarget::getIntrinsicId(unsigned Opc) const {
struct Scalar {
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
index 0628fbb..bd9af12 100644
--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -38,11 +38,6 @@ using namespace llvm;
#include "PPCGenSubtargetInfo.inc"
static cl::opt<bool>
- UseSubRegLiveness("ppc-track-subreg-liveness",
- cl::desc("Enable subregister liveness tracking for PPC"),
- cl::init(true), cl::Hidden);
-
-static cl::opt<bool>
EnableMachinePipeliner("ppc-enable-pipeliner",
cl::desc("Enable Machine Pipeliner for PPC"),
cl::init(false), cl::Hidden);
@@ -186,9 +181,7 @@ bool PPCSubtarget::useAA() const {
return true;
}
-bool PPCSubtarget::enableSubRegLiveness() const {
- return UseSubRegLiveness;
-}
+bool PPCSubtarget::enableSubRegLiveness() const { return true; }
bool PPCSubtarget::isGVIndirectSymbol(const GlobalValue *GV) const {
if (isAIXABI()) {
diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.cpp b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp
index d3236bb..e84ddc6 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.cpp
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp
@@ -39,9 +39,6 @@ namespace llvm::RISCVTuneInfoTable {
#include "RISCVGenSearchableTables.inc"
} // namespace llvm::RISCVTuneInfoTable
-static cl::opt<bool> EnableSubRegLiveness("riscv-enable-subreg-liveness",
- cl::init(true), cl::Hidden);
-
static cl::opt<unsigned> RVVVectorLMULMax(
"riscv-v-fixed-length-vector-lmul-max",
cl::desc("The maximum LMUL value to use for fixed length vectors. "
@@ -183,11 +180,7 @@ bool RISCVSubtarget::useRVVForFixedLengthVectors() const {
return hasVInstructions() && getMinRVVVectorSizeInBits() != 0;
}
-bool RISCVSubtarget::enableSubRegLiveness() const {
- // FIXME: Enable subregister liveness by default for RVV to better handle
- // LMUL>1 and segment load/store.
- return EnableSubRegLiveness;
-}
+bool RISCVSubtarget::enableSubRegLiveness() const { return true; }
void RISCVSubtarget::getPostRAMutations(
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {