Skip to content

Commit e880f8b

Browse files
committed
[ARM] Rename pass to MVETPAndVPTOptimisationsPass
This pass has for a while performed Tail predication as well as VPT block optimizations. Rename the pass to make that clear.
1 parent b783aa8 commit e880f8b

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

llvm/lib/Target/ARM/ARM.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ FunctionPass *createARMConstantIslandPass();
4848
FunctionPass *createMLxExpansionPass();
4949
FunctionPass *createThumb2ITBlockPass();
5050
FunctionPass *createMVEVPTBlockPass();
51-
FunctionPass *createMVEVPTOptimisationsPass();
51+
FunctionPass *createMVETPAndVPTOptimisationsPass();
5252
FunctionPass *createARMOptimizeBarriersPass();
5353
FunctionPass *createThumb2SizeReductionPass(
5454
std::function<bool(const Function &)> Ftor = nullptr);
@@ -70,7 +70,7 @@ void initializeARMExpandPseudoPass(PassRegistry &);
7070
void initializeThumb2SizeReducePass(PassRegistry &);
7171
void initializeThumb2ITBlockPass(PassRegistry &);
7272
void initializeMVEVPTBlockPass(PassRegistry &);
73-
void initializeMVEVPTOptimisationsPass(PassRegistry &);
73+
void initializeMVETPAndVPTOptimisationsPass(PassRegistry &);
7474
void initializeARMLowOverheadLoopsPass(PassRegistry &);
7575
void initializeARMBlockPlacementPass(PassRegistry &);
7676
void initializeMVETailPredicationPass(PassRegistry &);

llvm/lib/Target/ARM/ARMTargetMachine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTarget() {
9696
initializeARMExpandPseudoPass(Registry);
9797
initializeThumb2SizeReducePass(Registry);
9898
initializeMVEVPTBlockPass(Registry);
99-
initializeMVEVPTOptimisationsPass(Registry);
99+
initializeMVETPAndVPTOptimisationsPass(Registry);
100100
initializeMVETailPredicationPass(Registry);
101101
initializeARMLowOverheadLoopsPass(Registry);
102102
initializeARMBlockPlacementPass(Registry);
@@ -493,7 +493,7 @@ bool ARMPassConfig::addGlobalInstructionSelect() {
493493

494494
void ARMPassConfig::addPreRegAlloc() {
495495
if (getOptLevel() != CodeGenOpt::None) {
496-
addPass(createMVEVPTOptimisationsPass());
496+
addPass(createMVETPAndVPTOptimisationsPass());
497497

498498
addPass(createMLxExpansionPass());
499499

llvm/lib/Target/ARM/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ add_llvm_target(ARMCodeGen
5858
MVEGatherScatterLowering.cpp
5959
MVETailPredication.cpp
6060
MVEVPTBlockPass.cpp
61-
MVEVPTOptimisationsPass.cpp
61+
MVETPAndVPTOptimisationsPass.cpp
6262
Thumb1FrameLowering.cpp
6363
Thumb1InstrInfo.cpp
6464
ThumbRegisterInfo.cpp

llvm/lib/Target/ARM/MVEVPTOptimisationsPass.cpp renamed to llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- MVEVPTOptimisationsPass.cpp ---------------------------------------===//
1+
//===-- MVETPAndVPTOptimisationsPass.cpp ----------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -41,13 +41,13 @@ MergeEndDec("arm-enable-merge-loopenddec", cl::Hidden,
4141
cl::init(true));
4242

4343
namespace {
44-
class MVEVPTOptimisations : public MachineFunctionPass {
44+
class MVETPAndVPTOptimisations : public MachineFunctionPass {
4545
public:
4646
static char ID;
4747
const Thumb2InstrInfo *TII;
4848
MachineRegisterInfo *MRI;
4949

50-
MVEVPTOptimisations() : MachineFunctionPass(ID) {}
50+
MVETPAndVPTOptimisations() : MachineFunctionPass(ID) {}
5151

5252
bool runOnMachineFunction(MachineFunction &Fn) override;
5353

@@ -76,16 +76,16 @@ class MVEVPTOptimisations : public MachineFunctionPass {
7676
bool ConvertVPSEL(MachineBasicBlock &MBB);
7777
};
7878

79-
char MVEVPTOptimisations::ID = 0;
79+
char MVETPAndVPTOptimisations::ID = 0;
8080

8181
} // end anonymous namespace
8282

83-
INITIALIZE_PASS_BEGIN(MVEVPTOptimisations, DEBUG_TYPE,
83+
INITIALIZE_PASS_BEGIN(MVETPAndVPTOptimisations, DEBUG_TYPE,
8484
"ARM MVE TailPred and VPT Optimisations pass", false,
8585
false)
8686
INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
8787
INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)
88-
INITIALIZE_PASS_END(MVEVPTOptimisations, DEBUG_TYPE,
88+
INITIALIZE_PASS_END(MVETPAndVPTOptimisations, DEBUG_TYPE,
8989
"ARM MVE TailPred and VPT Optimisations pass", false, false)
9090

9191
static MachineInstr *LookThroughCOPY(MachineInstr *MI,
@@ -180,7 +180,7 @@ static bool findLoopComponents(MachineLoop *ML, MachineRegisterInfo *MRI,
180180
// loop. The t2LoopEndDec is a branching terminator that produces a value (the
181181
// decrement) around the loop edge, which means we need to be careful that they
182182
// will be valid to allocate without any spilling.
183-
bool MVEVPTOptimisations::MergeLoopEnd(MachineLoop *ML) {
183+
bool MVETPAndVPTOptimisations::MergeLoopEnd(MachineLoop *ML) {
184184
if (!MergeEndDec)
185185
return false;
186186

@@ -271,7 +271,7 @@ bool MVEVPTOptimisations::MergeLoopEnd(MachineLoop *ML) {
271271
// instructions. This keeps the VCTP count reg operand on the t2DoLoopStartTP
272272
// instruction, making the backend ARMLowOverheadLoops passes job of finding the
273273
// VCTP operand much simpler.
274-
bool MVEVPTOptimisations::ConvertTailPredLoop(MachineLoop *ML,
274+
bool MVETPAndVPTOptimisations::ConvertTailPredLoop(MachineLoop *ML,
275275
MachineDominatorTree *DT) {
276276
LLVM_DEBUG(dbgs() << "ConvertTailPredLoop on loop "
277277
<< ML->getHeader()->getName() << "\n");
@@ -443,7 +443,7 @@ static bool IsWritingToVCCR(MachineInstr &Instr) {
443443
// And returns the newly inserted VPNOT.
444444
// This optimization is done in the hopes of preventing spills/reloads of VPR by
445445
// reducing the number of VCCR values with overlapping lifetimes.
446-
MachineInstr &MVEVPTOptimisations::ReplaceRegisterUseWithVPNOT(
446+
MachineInstr &MVETPAndVPTOptimisations::ReplaceRegisterUseWithVPNOT(
447447
MachineBasicBlock &MBB, MachineInstr &Instr, MachineOperand &User,
448448
Register Target) {
449449
Register NewResult = MRI->createVirtualRegister(MRI->getRegClass(Target));
@@ -528,7 +528,7 @@ static bool MoveVPNOTBeforeFirstUser(MachineBasicBlock &MBB,
528528
// %Foo = (some op that uses %B)
529529
// %TMP2:vccr = VPNOT %B
530530
// %Bar = (some op that uses %A)
531-
bool MVEVPTOptimisations::ReduceOldVCCRValueUses(MachineBasicBlock &MBB) {
531+
bool MVETPAndVPTOptimisations::ReduceOldVCCRValueUses(MachineBasicBlock &MBB) {
532532
MachineBasicBlock::iterator Iter = MBB.begin(), End = MBB.end();
533533
SmallVector<MachineInstr *, 4> DeadInstructions;
534534
bool Modified = false;
@@ -656,7 +656,7 @@ bool MVEVPTOptimisations::ReduceOldVCCRValueUses(MachineBasicBlock &MBB) {
656656
}
657657

658658
// This optimisation replaces VCMPs with VPNOTs when they are equivalent.
659-
bool MVEVPTOptimisations::ReplaceVCMPsByVPNOTs(MachineBasicBlock &MBB) {
659+
bool MVETPAndVPTOptimisations::ReplaceVCMPsByVPNOTs(MachineBasicBlock &MBB) {
660660
SmallVector<MachineInstr *, 4> DeadInstructions;
661661

662662
// The last VCMP that we have seen and that couldn't be replaced.
@@ -729,7 +729,7 @@ bool MVEVPTOptimisations::ReplaceVCMPsByVPNOTs(MachineBasicBlock &MBB) {
729729
return !DeadInstructions.empty();
730730
}
731731

732-
bool MVEVPTOptimisations::ReplaceConstByVPNOTs(MachineBasicBlock &MBB,
732+
bool MVETPAndVPTOptimisations::ReplaceConstByVPNOTs(MachineBasicBlock &MBB,
733733
MachineDominatorTree *DT) {
734734
// Scan through the block, looking for instructions that use constants moves
735735
// into VPR that are the negative of one another. These are expected to be
@@ -818,7 +818,7 @@ bool MVEVPTOptimisations::ReplaceConstByVPNOTs(MachineBasicBlock &MBB,
818818
// instructions. We turn a vselect into a VPSEL in ISEL, but they have slightly
819819
// different semantics under tail predication. Until that is modelled we just
820820
// convert to a VMOVT (via a predicated VORR) instead.
821-
bool MVEVPTOptimisations::ConvertVPSEL(MachineBasicBlock &MBB) {
821+
bool MVETPAndVPTOptimisations::ConvertVPSEL(MachineBasicBlock &MBB) {
822822
bool HasVCTP = false;
823823
SmallVector<MachineInstr *, 4> DeadInstructions;
824824

@@ -852,7 +852,7 @@ bool MVEVPTOptimisations::ConvertVPSEL(MachineBasicBlock &MBB) {
852852
return !DeadInstructions.empty();
853853
}
854854

855-
bool MVEVPTOptimisations::runOnMachineFunction(MachineFunction &Fn) {
855+
bool MVETPAndVPTOptimisations::runOnMachineFunction(MachineFunction &Fn) {
856856
const ARMSubtarget &STI =
857857
static_cast<const ARMSubtarget &>(Fn.getSubtarget());
858858

@@ -884,7 +884,7 @@ bool MVEVPTOptimisations::runOnMachineFunction(MachineFunction &Fn) {
884884
return Modified;
885885
}
886886

887-
/// createMVEVPTOptimisationsPass
888-
FunctionPass *llvm::createMVEVPTOptimisationsPass() {
889-
return new MVEVPTOptimisations();
887+
/// createMVETPAndVPTOptimisationsPass
888+
FunctionPass *llvm::createMVETPAndVPTOptimisationsPass() {
889+
return new MVETPAndVPTOptimisations();
890890
}

llvm/utils/gn/secondary/llvm/lib/Target/ARM/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static_library("LLVMARMCodeGen") {
100100
"MVEGatherScatterLowering.cpp",
101101
"MVETailPredication.cpp",
102102
"MVEVPTBlockPass.cpp",
103-
"MVEVPTOptimisationsPass.cpp",
103+
"MVETPAndVPTOptimisationsPass.cpp",
104104
"Thumb1FrameLowering.cpp",
105105
"Thumb1InstrInfo.cpp",
106106
"Thumb2ITBlockPass.cpp",

0 commit comments

Comments
 (0)