llvm.org GIT mirror llvm / 9b3da26
Add MachineFunctionProperty checks for AllVRegsAllocated for target passes Summary: This adds the same checks that were added in r264593 to all target-specific passes that run after register allocation. Reviewers: qcolombet Subscribers: jyknight, dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D18525 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265313 91177308-0d34-0410-b5e6-96231b3b80d8 Derek Schuff 4 years ago
45 changed file(s) with 210 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
166166 }
167167
168168 bool runOnMachineFunction(MachineFunction &MF) override;
169
170 MachineFunctionProperties getRequiredProperties() const override {
171 return MachineFunctionProperties().set(
172 MachineFunctionProperties::Property::AllVRegsAllocated);
173 }
169174
170175 const char *getPassName() const override {
171176 return "Execution dependency fix";
187187 }
188188
189189 bool runOnMachineFunction(MachineFunction &MF) override;
190
191 MachineFunctionProperties getRequiredProperties() const override {
192 return MachineFunctionProperties().set(
193 MachineFunctionProperties::Property::AllVRegsAllocated);
194 }
190195
191196 private:
192197 bool ReverseBranchCondition(BBInfo &BBI);
8686
8787 bool runOnMachineFunction(MachineFunction &F) override;
8888
89 MachineFunctionProperties getRequiredProperties() const override {
90 return MachineFunctionProperties().set(
91 MachineFunctionProperties::Property::AllVRegsAllocated);
92 }
93
8994 const char *getPassName() const override {
9095 return "Workaround A53 erratum 835769 pass";
9196 }
123123 }
124124
125125 bool runOnMachineFunction(MachineFunction &F) override;
126
127 MachineFunctionProperties getRequiredProperties() const override {
128 return MachineFunctionProperties().set(
129 MachineFunctionProperties::Property::AllVRegsAllocated);
130 }
126131
127132 const char *getPassName() const override {
128133 return "A57 FP Anti-dependency breaker";
178178
179179 bool runOnMachineFunction(MachineFunction &MF) override;
180180
181 MachineFunctionProperties getRequiredProperties() const override {
182 return MachineFunctionProperties().set(
183 MachineFunctionProperties::Property::AllVRegsAllocated);
184 }
185
181186 const char *getPassName() const override {
182187 return AARCH64_COLLECT_LOH_NAME;
183188 }
4646 }
4747
4848 bool runOnMachineFunction(MachineFunction &F) override;
49
50 MachineFunctionProperties getRequiredProperties() const override {
51 return MachineFunctionProperties().set(
52 MachineFunctionProperties::Property::AllVRegsAllocated);
53 }
4954
5055 const char *getPassName() const override { return AARCH64_DEAD_REG_DEF_NAME; }
5156
162162 bool optimizeBlock(MachineBasicBlock &MBB, bool enableNarrowLdOpt);
163163
164164 bool runOnMachineFunction(MachineFunction &Fn) override;
165
166 MachineFunctionProperties getRequiredProperties() const override {
167 return MachineFunctionProperties().set(
168 MachineFunctionProperties::Property::AllVRegsAllocated);
169 }
165170
166171 const char *getPassName() const override {
167172 return AARCH64_LOAD_STORE_OPT_NAME;
5252 AArch64RedundantCopyElimination() : MachineFunctionPass(ID) {}
5353 bool optimizeCopy(MachineBasicBlock *MBB);
5454 bool runOnMachineFunction(MachineFunction &MF) override;
55 MachineFunctionProperties getRequiredProperties() const override {
56 return MachineFunctionProperties().set(
57 MachineFunctionProperties::Property::AllVRegsAllocated);
58 }
5559 const char *getPassName() const override {
5660 return "AArch64 Redundant Copy Elimination";
5761 }
277277 ARMConstantIslands() : MachineFunctionPass(ID) {}
278278
279279 bool runOnMachineFunction(MachineFunction &MF) override;
280
281 MachineFunctionProperties getRequiredProperties() const override {
282 return MachineFunctionProperties().set(
283 MachineFunctionProperties::Property::AllVRegsAllocated);
284 }
280285
281286 const char *getPassName() const override {
282287 return "ARM constant island placement and branch shortening pass";
4848 ARMFunctionInfo *AFI;
4949
5050 bool runOnMachineFunction(MachineFunction &Fn) override;
51
52 MachineFunctionProperties getRequiredProperties() const override {
53 return MachineFunctionProperties().set(
54 MachineFunctionProperties::Property::AllVRegsAllocated);
55 }
5156
5257 const char *getPassName() const override {
5358 return "ARM pseudo instruction expansion pass";
9797 bool isThumb1, isThumb2;
9898
9999 bool runOnMachineFunction(MachineFunction &Fn) override;
100
101 MachineFunctionProperties getRequiredProperties() const override {
102 return MachineFunctionProperties().set(
103 MachineFunctionProperties::Property::AllVRegsAllocated);
104 }
100105
101106 const char *getPassName() const override {
102107 return ARM_LOAD_STORE_OPT_NAME;
23682373 return new ARMPreAllocLoadStoreOpt();
23692374 return new ARMLoadStoreOpt();
23702375 }
2371
2525 ARMOptimizeBarriersPass() : MachineFunctionPass(ID) {}
2626
2727 bool runOnMachineFunction(MachineFunction &Fn) override;
28
29 MachineFunctionProperties getRequiredProperties() const override {
30 return MachineFunctionProperties().set(
31 MachineFunctionProperties::Property::AllVRegsAllocated);
32 }
2833
2934 const char *getPassName() const override {
3035 return "optimise barriers pass";
3434 ARMFunctionInfo *AFI;
3535
3636 bool runOnMachineFunction(MachineFunction &Fn) override;
37
38 MachineFunctionProperties getRequiredProperties() const override {
39 return MachineFunctionProperties().set(
40 MachineFunctionProperties::Property::AllVRegsAllocated);
41 }
3742
3843 const char *getPassName() const override {
3944 return "Thumb IT blocks insertion pass";
142142
143143 bool runOnMachineFunction(MachineFunction &MF) override;
144144
145 MachineFunctionProperties getRequiredProperties() const override {
146 return MachineFunctionProperties().set(
147 MachineFunctionProperties::Property::AllVRegsAllocated);
148 }
149
145150 const char *getPassName() const override {
146151 return "Thumb2 instruction size reduction pass";
147152 }
4949 return "Hexagon CFG Optimizer";
5050 }
5151 bool runOnMachineFunction(MachineFunction &Fn) override;
52 MachineFunctionProperties getRequiredProperties() const override {
53 return MachineFunctionProperties().set(
54 MachineFunctionProperties::Property::AllVRegsAllocated);
55 }
5256 };
5357
5458
8585
8686 bool runOnMachineFunction(MachineFunction &Fn) override;
8787
88 MachineFunctionProperties getRequiredProperties() const override {
89 return MachineFunctionProperties().set(
90 MachineFunctionProperties::Property::AllVRegsAllocated);
91 }
92
8893 private:
8994 MachineInstr *findPairable(MachineInstr *I1, bool &DoInsertAtI1,
9095 bool AllowC64);
4343 }
4444
4545 bool runOnMachineFunction(MachineFunction &MF) override;
46
47 MachineFunctionProperties getRequiredProperties() const override {
48 return MachineFunctionProperties().set(
49 MachineFunctionProperties::Property::AllVRegsAllocated);
50 }
4651
4752 const char *getPassName() const override {
4853 return "Hexagon Hardware Loop Fixup";
169169 initializeHexagonCallFrameInformationPass(PR);
170170 }
171171 bool runOnMachineFunction(MachineFunction &MF) override;
172 MachineFunctionProperties getRequiredProperties() const override {
173 return MachineFunctionProperties().set(
174 MachineFunctionProperties::Property::AllVRegsAllocated);
175 }
172176 };
173177
174178 char HexagonCallFrameInformation::ID = 0;
4848 MachineFunctionPass::getAnalysisUsage(AU);
4949 }
5050 bool runOnMachineFunction(MachineFunction &MF) override;
51 MachineFunctionProperties getRequiredProperties() const override {
52 return MachineFunctionProperties().set(
53 MachineFunctionProperties::Property::AllVRegsAllocated);
54 }
5155
5256 private:
5357 const HexagonInstrInfo *HII;
315319 FunctionPass *llvm::createHexagonGenMux() {
316320 return new HexagonGenMux();
317321 }
318
8686 }
8787
8888 bool runOnMachineFunction(MachineFunction &Fn) override;
89 MachineFunctionProperties getRequiredProperties() const override {
90 return MachineFunctionProperties().set(
91 MachineFunctionProperties::Property::AllVRegsAllocated);
92 }
8993
9094 private:
9195 /// \brief A handle to the branch probability pass.
5454 }
5555 bool runOnMachineFunction(MachineFunction &MF) override;
5656
57 MachineFunctionProperties getRequiredProperties() const override {
58 return MachineFunctionProperties().set(
59 MachineFunctionProperties::Property::AllVRegsAllocated);
60 }
61
5762 static char ID;
5863
5964 private:
6060 return "Hexagon Split Const32s and Const64s";
6161 }
6262 bool runOnMachineFunction(MachineFunction &Fn) override;
63 MachineFunctionProperties getRequiredProperties() const override {
64 return MachineFunctionProperties().set(
65 MachineFunctionProperties::Property::AllVRegsAllocated);
66 }
6367 };
6468
6569
8080 return "Hexagon Packetizer";
8181 }
8282 bool runOnMachineFunction(MachineFunction &Fn) override;
83 MachineFunctionProperties getRequiredProperties() const override {
84 return MachineFunctionProperties().set(
85 MachineFunctionProperties::Property::AllVRegsAllocated);
86 }
8387
8488 private:
8589 const HexagonInstrInfo *HII;
15961600 FunctionPass *llvm::createHexagonPacketizer() {
15971601 return new HexagonPacketizer();
15981602 }
1599
5555 ++FI)
5656 Changed |= runOnMachineBasicBlock(*FI);
5757 return Changed;
58 }
59
60 MachineFunctionProperties getRequiredProperties() const override {
61 return MachineFunctionProperties().set(
62 MachineFunctionProperties::Property::AllVRegsAllocated);
5863 }
5964
6065 void insertDefsUses(MachineBasicBlock::instr_iterator MI,
6565 }
6666
6767 bool runOnMachineFunction(MachineFunction &F) override;
68
69 MachineFunctionProperties getRequiredProperties() const override {
70 return MachineFunctionProperties().set(
71 MachineFunctionProperties::Property::AllVRegsAllocated);
72 }
6873
6974 private:
7075 MbbIterator findClosestSuitableAluInstr(MachineBasicBlock *BB,
4848 }
4949
5050 bool runOnMachineFunction(MachineFunction &F) override;
51
52 MachineFunctionProperties getRequiredProperties() const override {
53 return MachineFunctionProperties().set(
54 MachineFunctionProperties::Property::AllVRegsAllocated);
55 }
5156
5257 private:
5358 bool CombineSetflagAluInBasicBlock(MachineFunction *MF,
3737 std::vector BlockSizes;
3838
3939 bool runOnMachineFunction(MachineFunction &Fn) override;
40
41 MachineFunctionProperties getRequiredProperties() const override {
42 return MachineFunctionProperties().set(
43 MachineFunctionProperties::Property::AllVRegsAllocated);
44 }
4045
4146 const char *getPassName() const override {
4247 return "MSP430 Branch Selector";
373373 }
374374
375375 bool runOnMachineFunction(MachineFunction &F) override;
376
377 MachineFunctionProperties getRequiredProperties() const override {
378 return MachineFunctionProperties().set(
379 MachineFunctionProperties::Property::AllVRegsAllocated);
380 }
376381
377382 void doInitialPlacement(std::vector &CPEMIs);
378383 CPEntry *findConstPoolEntry(unsigned CPI, const MachineInstr *CPEMI);
17091714 }
17101715 }
17111716 }
1712
188188 return Changed;
189189 }
190190
191 MachineFunctionProperties getRequiredProperties() const override {
192 return MachineFunctionProperties().set(
193 MachineFunctionProperties::Property::AllVRegsAllocated);
194 }
195
191196 void getAnalysisUsage(AnalysisUsage &AU) const override {
192197 AU.addRequired();
193198 MachineFunctionPass::getAnalysisUsage(AU);
7474
7575 bool runOnMachineFunction(MachineFunction &F) override;
7676
77 MachineFunctionProperties getRequiredProperties() const override {
78 return MachineFunctionProperties().set(
79 MachineFunctionProperties::Property::AllVRegsAllocated);
80 }
81
7782 private:
7883 static char ID;
7984 };
7171 }
7272
7373 bool runOnMachineFunction(MachineFunction &F) override;
74
75 MachineFunctionProperties getRequiredProperties() const override {
76 return MachineFunctionProperties().set(
77 MachineFunctionProperties::Property::AllVRegsAllocated);
78 }
7479
7580 private:
7681 void splitMBB(MachineBasicBlock *MBB);
4444 std::vector BlockSizes;
4545
4646 bool runOnMachineFunction(MachineFunction &Fn) override;
47
48 MachineFunctionProperties getRequiredProperties() const override {
49 return MachineFunctionProperties().set(
50 MachineFunctionProperties::Property::AllVRegsAllocated);
51 }
4752
4853 const char *getPassName() const override {
4954 return "PowerPC Branch Selector";
233238 BlockSizes.clear();
234239 return true;
235240 }
236
191191 return Changed;
192192 }
193193
194 MachineFunctionProperties getRequiredProperties() const override {
195 return MachineFunctionProperties().set(
196 MachineFunctionProperties::Property::AllVRegsAllocated);
197 }
198
194199 void getAnalysisUsage(AnalysisUsage &AU) const override {
195200 MachineFunctionPass::getAnalysisUsage(AU);
196201 }
203208 char PPCEarlyReturn::ID = 0;
204209 FunctionPass*
205210 llvm::createPPCEarlyReturnPass() { return new PPCEarlyReturn(); }
206
6565 return Changed;
6666 }
6767
68 MachineFunctionProperties getRequiredProperties() const override {
69 return MachineFunctionProperties().set(
70 MachineFunctionProperties::Property::AllVRegsAllocated);
71 }
72
6873 void insertCallDefsUses(MachineBasicBlock::iterator MI,
6974 SmallSet& RegDefs,
7075 SmallSet& RegUses);
6464
6565 bool processBlock(MachineBasicBlock &MBB);
6666 bool runOnMachineFunction(MachineFunction &F) override;
67 MachineFunctionProperties getRequiredProperties() const override {
68 return MachineFunctionProperties().set(
69 MachineFunctionProperties::Property::AllVRegsAllocated);
70 }
6771
6872 private:
6973 Reference getRegReferences(MachineInstr *MI, unsigned Reg);
138138 }
139139
140140 bool runOnMachineFunction(MachineFunction &F) override;
141 MachineFunctionProperties getRequiredProperties() const override {
142 return MachineFunctionProperties().set(
143 MachineFunctionProperties::Property::AllVRegsAllocated);
144 }
141145
142146 private:
143147 void skipNonTerminators(BlockPosition &Position, MBBInfo &Block);
3434
3535 bool processBlock(MachineBasicBlock &MBB);
3636 bool runOnMachineFunction(MachineFunction &F) override;
37 MachineFunctionProperties getRequiredProperties() const override {
38 return MachineFunctionProperties().set(
39 MachineFunctionProperties::Property::AllVRegsAllocated);
40 }
3741
3842 private:
3943 bool shortenIIF(MachineInstr &MI, unsigned LLIxL, unsigned LLIxH);
4646 const X86FrameLowering *X86FL;
4747
4848 bool runOnMachineFunction(MachineFunction &Fn) override;
49
50 MachineFunctionProperties getRequiredProperties() const override {
51 return MachineFunctionProperties().set(
52 MachineFunctionProperties::Property::AllVRegsAllocated);
53 }
4954
5055 const char *getPassName() const override {
5156 return "X86 pseudo instruction expansion pass";
111111 /// where performance or code size can be improved.
112112 bool runOnMachineFunction(MachineFunction &MF) override;
113113
114 MachineFunctionProperties getRequiredProperties() const override {
115 return MachineFunctionProperties().set(
116 MachineFunctionProperties::Property::AllVRegsAllocated);
117 }
118
114119 private:
115120 MachineFunction *MF;
116121
9090 /// replacing instructions by equivalent LEA instructions
9191 /// if needed and when possible.
9292 bool runOnMachineFunction(MachineFunction &MF) override;
93
94 // This pass runs after regalloc and doesn't support VReg operands.
95 MachineFunctionProperties getRequiredProperties() const override {
96 return MachineFunctionProperties().set(
97 MachineFunctionProperties::Property::AllVRegsAllocated);
98 }
9399
94100 private:
95101 MachineFunction *MF;
7474 }
7575
7676 bool runOnMachineFunction(MachineFunction &MF) override;
77
78 MachineFunctionProperties getRequiredProperties() const override {
79 return MachineFunctionProperties().set(
80 MachineFunctionProperties::Property::AllVRegsAllocated);
81 }
7782
7883 const char *getPassName() const override { return "X86 FP Stackifier"; }
7984
5353 , Threshold(4), STI(nullptr), TII(nullptr) {}
5454
5555 bool runOnMachineFunction(MachineFunction &MF) override;
56
57 MachineFunctionProperties getRequiredProperties() const override {
58 return MachineFunctionProperties().set(
59 MachineFunctionProperties::Property::AllVRegsAllocated);
60 }
5661
5762 const char *getPassName() const override {
5863 return "X86 Atom pad short functions";
3737
3838 VZeroUpperInserter() : MachineFunctionPass(ID) {}
3939 bool runOnMachineFunction(MachineFunction &MF) override;
40 MachineFunctionProperties getRequiredProperties() const override {
41 return MachineFunctionProperties().set(
42 MachineFunctionProperties::Property::AllVRegsAllocated);
43 }
4044 const char *getPassName() const override {return "X86 vzeroupper inserter";}
4145
4246 private:
2727 XCoreFTAOElim() : MachineFunctionPass(ID) {}
2828
2929 bool runOnMachineFunction(MachineFunction &Fn) override;
30 MachineFunctionProperties getRequiredProperties() const override {
31 return MachineFunctionProperties().set(
32 MachineFunctionProperties::Property::AllVRegsAllocated);
33 }
3034
3135 const char *getPassName() const override {
3236 return "XCore FRAME_TO_ARGS_OFFSET Elimination";
8080 alignment: 1
8181 exposesReturnsTwice: false
8282 hasInlineAsm: false
83 allVRegsAllocated: true
8384 isSSA: false
8485 tracksRegLiveness: true
8586 tracksSubRegLiveness: false