|
1 |
| -//===-- MVEVPTOptimisationsPass.cpp ---------------------------------------===// |
| 1 | +//===-- MVETPAndVPTOptimisationsPass.cpp ----------------------------------===// |
2 | 2 | //
|
3 | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
4 | 4 | // See https://llvm.org/LICENSE.txt for license information.
|
@@ -41,13 +41,13 @@ MergeEndDec("arm-enable-merge-loopenddec", cl::Hidden,
|
41 | 41 | cl::init(true));
|
42 | 42 |
|
43 | 43 | namespace {
|
44 |
| -class MVEVPTOptimisations : public MachineFunctionPass { |
| 44 | +class MVETPAndVPTOptimisations : public MachineFunctionPass { |
45 | 45 | public:
|
46 | 46 | static char ID;
|
47 | 47 | const Thumb2InstrInfo *TII;
|
48 | 48 | MachineRegisterInfo *MRI;
|
49 | 49 |
|
50 |
| - MVEVPTOptimisations() : MachineFunctionPass(ID) {} |
| 50 | + MVETPAndVPTOptimisations() : MachineFunctionPass(ID) {} |
51 | 51 |
|
52 | 52 | bool runOnMachineFunction(MachineFunction &Fn) override;
|
53 | 53 |
|
@@ -76,16 +76,16 @@ class MVEVPTOptimisations : public MachineFunctionPass {
|
76 | 76 | bool ConvertVPSEL(MachineBasicBlock &MBB);
|
77 | 77 | };
|
78 | 78 |
|
79 |
| -char MVEVPTOptimisations::ID = 0; |
| 79 | +char MVETPAndVPTOptimisations::ID = 0; |
80 | 80 |
|
81 | 81 | } // end anonymous namespace
|
82 | 82 |
|
83 |
| -INITIALIZE_PASS_BEGIN(MVEVPTOptimisations, DEBUG_TYPE, |
| 83 | +INITIALIZE_PASS_BEGIN(MVETPAndVPTOptimisations, DEBUG_TYPE, |
84 | 84 | "ARM MVE TailPred and VPT Optimisations pass", false,
|
85 | 85 | false)
|
86 | 86 | INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
|
87 | 87 | INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)
|
88 |
| -INITIALIZE_PASS_END(MVEVPTOptimisations, DEBUG_TYPE, |
| 88 | +INITIALIZE_PASS_END(MVETPAndVPTOptimisations, DEBUG_TYPE, |
89 | 89 | "ARM MVE TailPred and VPT Optimisations pass", false, false)
|
90 | 90 |
|
91 | 91 | static MachineInstr *LookThroughCOPY(MachineInstr *MI,
|
@@ -180,7 +180,7 @@ static bool findLoopComponents(MachineLoop *ML, MachineRegisterInfo *MRI,
|
180 | 180 | // loop. The t2LoopEndDec is a branching terminator that produces a value (the
|
181 | 181 | // decrement) around the loop edge, which means we need to be careful that they
|
182 | 182 | // will be valid to allocate without any spilling.
|
183 |
| -bool MVEVPTOptimisations::MergeLoopEnd(MachineLoop *ML) { |
| 183 | +bool MVETPAndVPTOptimisations::MergeLoopEnd(MachineLoop *ML) { |
184 | 184 | if (!MergeEndDec)
|
185 | 185 | return false;
|
186 | 186 |
|
@@ -271,7 +271,7 @@ bool MVEVPTOptimisations::MergeLoopEnd(MachineLoop *ML) {
|
271 | 271 | // instructions. This keeps the VCTP count reg operand on the t2DoLoopStartTP
|
272 | 272 | // instruction, making the backend ARMLowOverheadLoops passes job of finding the
|
273 | 273 | // VCTP operand much simpler.
|
274 |
| -bool MVEVPTOptimisations::ConvertTailPredLoop(MachineLoop *ML, |
| 274 | +bool MVETPAndVPTOptimisations::ConvertTailPredLoop(MachineLoop *ML, |
275 | 275 | MachineDominatorTree *DT) {
|
276 | 276 | LLVM_DEBUG(dbgs() << "ConvertTailPredLoop on loop "
|
277 | 277 | << ML->getHeader()->getName() << "\n");
|
@@ -443,7 +443,7 @@ static bool IsWritingToVCCR(MachineInstr &Instr) {
|
443 | 443 | // And returns the newly inserted VPNOT.
|
444 | 444 | // This optimization is done in the hopes of preventing spills/reloads of VPR by
|
445 | 445 | // reducing the number of VCCR values with overlapping lifetimes.
|
446 |
| -MachineInstr &MVEVPTOptimisations::ReplaceRegisterUseWithVPNOT( |
| 446 | +MachineInstr &MVETPAndVPTOptimisations::ReplaceRegisterUseWithVPNOT( |
447 | 447 | MachineBasicBlock &MBB, MachineInstr &Instr, MachineOperand &User,
|
448 | 448 | Register Target) {
|
449 | 449 | Register NewResult = MRI->createVirtualRegister(MRI->getRegClass(Target));
|
@@ -528,7 +528,7 @@ static bool MoveVPNOTBeforeFirstUser(MachineBasicBlock &MBB,
|
528 | 528 | // %Foo = (some op that uses %B)
|
529 | 529 | // %TMP2:vccr = VPNOT %B
|
530 | 530 | // %Bar = (some op that uses %A)
|
531 |
| -bool MVEVPTOptimisations::ReduceOldVCCRValueUses(MachineBasicBlock &MBB) { |
| 531 | +bool MVETPAndVPTOptimisations::ReduceOldVCCRValueUses(MachineBasicBlock &MBB) { |
532 | 532 | MachineBasicBlock::iterator Iter = MBB.begin(), End = MBB.end();
|
533 | 533 | SmallVector<MachineInstr *, 4> DeadInstructions;
|
534 | 534 | bool Modified = false;
|
@@ -656,7 +656,7 @@ bool MVEVPTOptimisations::ReduceOldVCCRValueUses(MachineBasicBlock &MBB) {
|
656 | 656 | }
|
657 | 657 |
|
658 | 658 | // This optimisation replaces VCMPs with VPNOTs when they are equivalent.
|
659 |
| -bool MVEVPTOptimisations::ReplaceVCMPsByVPNOTs(MachineBasicBlock &MBB) { |
| 659 | +bool MVETPAndVPTOptimisations::ReplaceVCMPsByVPNOTs(MachineBasicBlock &MBB) { |
660 | 660 | SmallVector<MachineInstr *, 4> DeadInstructions;
|
661 | 661 |
|
662 | 662 | // The last VCMP that we have seen and that couldn't be replaced.
|
@@ -729,7 +729,7 @@ bool MVEVPTOptimisations::ReplaceVCMPsByVPNOTs(MachineBasicBlock &MBB) {
|
729 | 729 | return !DeadInstructions.empty();
|
730 | 730 | }
|
731 | 731 |
|
732 |
| -bool MVEVPTOptimisations::ReplaceConstByVPNOTs(MachineBasicBlock &MBB, |
| 732 | +bool MVETPAndVPTOptimisations::ReplaceConstByVPNOTs(MachineBasicBlock &MBB, |
733 | 733 | MachineDominatorTree *DT) {
|
734 | 734 | // Scan through the block, looking for instructions that use constants moves
|
735 | 735 | // into VPR that are the negative of one another. These are expected to be
|
@@ -818,7 +818,7 @@ bool MVEVPTOptimisations::ReplaceConstByVPNOTs(MachineBasicBlock &MBB,
|
818 | 818 | // instructions. We turn a vselect into a VPSEL in ISEL, but they have slightly
|
819 | 819 | // different semantics under tail predication. Until that is modelled we just
|
820 | 820 | // convert to a VMOVT (via a predicated VORR) instead.
|
821 |
| -bool MVEVPTOptimisations::ConvertVPSEL(MachineBasicBlock &MBB) { |
| 821 | +bool MVETPAndVPTOptimisations::ConvertVPSEL(MachineBasicBlock &MBB) { |
822 | 822 | bool HasVCTP = false;
|
823 | 823 | SmallVector<MachineInstr *, 4> DeadInstructions;
|
824 | 824 |
|
@@ -852,7 +852,7 @@ bool MVEVPTOptimisations::ConvertVPSEL(MachineBasicBlock &MBB) {
|
852 | 852 | return !DeadInstructions.empty();
|
853 | 853 | }
|
854 | 854 |
|
855 |
| -bool MVEVPTOptimisations::runOnMachineFunction(MachineFunction &Fn) { |
| 855 | +bool MVETPAndVPTOptimisations::runOnMachineFunction(MachineFunction &Fn) { |
856 | 856 | const ARMSubtarget &STI =
|
857 | 857 | static_cast<const ARMSubtarget &>(Fn.getSubtarget());
|
858 | 858 |
|
@@ -884,7 +884,7 @@ bool MVEVPTOptimisations::runOnMachineFunction(MachineFunction &Fn) {
|
884 | 884 | return Modified;
|
885 | 885 | }
|
886 | 886 |
|
887 |
| -/// createMVEVPTOptimisationsPass |
888 |
| -FunctionPass *llvm::createMVEVPTOptimisationsPass() { |
889 |
| - return new MVEVPTOptimisations(); |
| 887 | +/// createMVETPAndVPTOptimisationsPass |
| 888 | +FunctionPass *llvm::createMVETPAndVPTOptimisationsPass() { |
| 889 | + return new MVETPAndVPTOptimisations(); |
890 | 890 | }
|
0 commit comments