Skip to content

Commit a9ca220

Browse files
authored
[AArch64][SME] Remove support for -arch64-enable-zpr-predicate-spills (#161819)
This was a stop-gap solution until we implemented `-aarch64-split-sve-objects`. It was never enabled by default, and likely saw no real-world use. Let's remove this to reduce the maintenance burden.
1 parent 1087c10 commit a9ca220

9 files changed

+11
-1427
lines changed

llvm/lib/Target/AArch64/AArch64FrameLowering.cpp

Lines changed: 10 additions & 345 deletions
Large diffs are not rendered by default.

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,8 +2579,6 @@ unsigned AArch64InstrInfo::getLoadStoreImmIdx(unsigned Opc) {
25792579
case AArch64::STZ2Gi:
25802580
case AArch64::STZGi:
25812581
case AArch64::TAGPstack:
2582-
case AArch64::SPILL_PPR_TO_ZPR_SLOT_PSEUDO:
2583-
case AArch64::FILL_PPR_FROM_ZPR_SLOT_PSEUDO:
25842582
return 2;
25852583
case AArch64::LD1B_D_IMM:
25862584
case AArch64::LD1B_H_IMM:
@@ -4387,8 +4385,6 @@ bool AArch64InstrInfo::getMemOpInfo(unsigned Opcode, TypeSize &Scale,
43874385
MinOffset = -256;
43884386
MaxOffset = 254;
43894387
break;
4390-
case AArch64::SPILL_PPR_TO_ZPR_SLOT_PSEUDO:
4391-
case AArch64::FILL_PPR_FROM_ZPR_SLOT_PSEUDO:
43924388
case AArch64::LDR_ZXI:
43934389
case AArch64::STR_ZXI:
43944390
Scale = TypeSize::getScalable(16);
@@ -5648,11 +5644,6 @@ void AArch64InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
56485644
"Unexpected register store without SVE store instructions");
56495645
Opc = AArch64::STR_ZXI;
56505646
StackID = TargetStackID::ScalableVector;
5651-
} else if (AArch64::PPRRegClass.hasSubClassEq(RC)) {
5652-
assert(Subtarget.isSVEorStreamingSVEAvailable() &&
5653-
"Unexpected predicate store without SVE store instructions");
5654-
Opc = AArch64::SPILL_PPR_TO_ZPR_SLOT_PSEUDO;
5655-
StackID = TargetStackID::ScalableVector;
56565647
}
56575648
break;
56585649
case 24:
@@ -5833,11 +5824,6 @@ void AArch64InstrInfo::loadRegFromStackSlot(
58335824
"Unexpected register load without SVE load instructions");
58345825
Opc = AArch64::LDR_ZXI;
58355826
StackID = TargetStackID::ScalableVector;
5836-
} else if (AArch64::PPRRegClass.hasSubClassEq(RC)) {
5837-
assert(Subtarget.isSVEorStreamingSVEAvailable() &&
5838-
"Unexpected predicate load without SVE load instructions");
5839-
Opc = AArch64::FILL_PPR_FROM_ZPR_SLOT_PSEUDO;
5840-
StackID = TargetStackID::ScalableVector;
58415827
}
58425828
break;
58435829
case 24:

llvm/lib/Target/AArch64/AArch64PrologueEpilogue.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ static bool isPartOfZPRCalleeSaves(MachineBasicBlock::iterator I) {
5757
case AArch64::ST1B_2Z_IMM:
5858
case AArch64::STR_ZXI:
5959
case AArch64::LDR_ZXI:
60-
case AArch64::CPY_ZPzI_B:
61-
case AArch64::CMPNE_PPzZI_B:
6260
case AArch64::PTRUE_C_B:
63-
case AArch64::PTRUE_B:
6461
return I->getFlag(MachineInstr::FrameSetup) ||
6562
I->getFlag(MachineInstr::FrameDestroy);
6663
case AArch64::SEH_SavePReg:

llvm/lib/Target/AArch64/AArch64RegisterInfo.td

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -980,19 +980,10 @@ class ZPRRegOp <string Suffix, AsmOperandClass C, ElementSizeEnum Size,
980980
//******************************************************************************
981981

982982
// SVE predicate register classes.
983-
984-
// Note: This hardware mode is enabled in AArch64Subtarget::getHwModeSet()
985-
// (without the use of the table-gen'd predicates).
986-
def SMEWithZPRPredicateSpills : HwMode<[Predicate<"false">]>;
987-
988-
def PPRSpillFillRI : RegInfoByHwMode<
989-
[DefaultMode, SMEWithZPRPredicateSpills],
990-
[RegInfo<16,16,16>, RegInfo<16,128,128>]>;
991-
992983
class PPRClass<int firstreg, int lastreg, int step = 1> : RegisterClass<"AArch64",
993984
[ nxv16i1, nxv8i1, nxv4i1, nxv2i1, nxv1i1 ], 16,
994985
(sequence "P%u", firstreg, lastreg, step)> {
995-
let RegInfos = PPRSpillFillRI;
986+
let Size = 16;
996987
}
997988

998989
def PPR : PPRClass<0, 15> {

llvm/lib/Target/AArch64/AArch64Subtarget.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ static cl::alias AArch64StreamingStackHazardSize(
8686
cl::desc("alias for -aarch64-streaming-hazard-size"),
8787
cl::aliasopt(AArch64StreamingHazardSize));
8888

89-
static cl::opt<bool> EnableZPRPredicateSpills(
90-
"aarch64-enable-zpr-predicate-spills", cl::init(false), cl::Hidden,
91-
cl::desc(
92-
"Enables spilling/reloading SVE predicates as data vectors (ZPRs)"));
93-
9489
static cl::opt<unsigned>
9590
VScaleForTuningOpt("sve-vscale-for-tuning", cl::Hidden,
9691
cl::desc("Force a vscale for tuning factor for SVE"));
@@ -426,20 +421,6 @@ AArch64Subtarget::AArch64Subtarget(const Triple &TT, StringRef CPU,
426421
EnableSubregLiveness = EnableSubregLivenessTracking.getValue();
427422
}
428423

429-
unsigned AArch64Subtarget::getHwModeSet() const {
430-
AArch64HwModeBits Modes = AArch64HwModeBits::DefaultMode;
431-
432-
// Use a special hardware mode in streaming[-compatible] functions with
433-
// aarch64-enable-zpr-predicate-spills. This changes the spill size (and
434-
// alignment) for the predicate register class.
435-
if (EnableZPRPredicateSpills.getValue() &&
436-
(isStreaming() || isStreamingCompatible())) {
437-
Modes |= AArch64HwModeBits::SMEWithZPRPredicateSpills;
438-
}
439-
440-
return to_underlying(Modes);
441-
}
442-
443424
const CallLowering *AArch64Subtarget::getCallLowering() const {
444425
return CallLoweringInfo.get();
445426
}

llvm/lib/Target/AArch64/AArch64Subtarget.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo {
130130
bool IsStreaming = false, bool IsStreamingCompatible = false,
131131
bool HasMinSize = false);
132132

133-
virtual unsigned getHwModeSet() const override;
134-
135133
// Getters for SubtargetFeatures defined in tablegen
136134
#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
137135
bool GETTER() const { return ATTRIBUTE; }

llvm/lib/Target/AArch64/SMEInstrFormats.td

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,6 @@ def FORM_TRANSPOSED_REG_TUPLE_X4_PSEUDO :
5858
let hasSideEffects = 0;
5959
}
6060

61-
def SPILL_PPR_TO_ZPR_SLOT_PSEUDO :
62-
Pseudo<(outs), (ins PPRorPNRAny:$Pt, GPR64sp:$Rn, simm9:$imm9), []>, Sched<[]>
63-
{
64-
let mayStore = 1;
65-
let hasSideEffects = 0;
66-
}
67-
68-
def FILL_PPR_FROM_ZPR_SLOT_PSEUDO :
69-
Pseudo<(outs PPRorPNRAny:$Pt), (ins GPR64sp:$Rn, simm9:$imm9), []>, Sched<[]>
70-
{
71-
let mayLoad = 1;
72-
let hasSideEffects = 0;
73-
}
74-
7561
def SDTZALoadStore : SDTypeProfile<0, 3, [SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisInt<2>]>;
7662
// SME ZA loads and stores
7763
def AArch64SMELdr : SDNode<"AArch64ISD::SME_ZA_LDR", SDTZALoadStore,

0 commit comments

Comments
 (0)