@@ -2188,21 +2188,19 @@ Error AMDGPUCodeGenPassBuilder::addRegAssignmentOptimized(
2188
2188
addPass (SIPreAllocateWWMRegsPass ());
2189
2189
2190
2190
// For allocating other wwm register operands.
2191
- // addRegAlloc<RAGreedyPass>(addPass, RegAllocPhase::WWM);
2192
2191
addPass (RAGreedyPass ({onlyAllocateWWMRegs, " wwm" }));
2193
2192
addPass (SILowerWWMCopiesPass ());
2194
2193
addPass (VirtRegRewriterPass (false ));
2195
2194
addPass (AMDGPUReserveWWMRegsPass ());
2196
2195
2197
2196
// For allocating per-thread VGPRs.
2198
- // addRegAlloc<RAGreedyPass>(addPass, RegAllocPhase::VGPR);
2199
2197
addPass (RAGreedyPass ({onlyAllocateVGPRs, " vgpr" }));
2200
2198
2201
2199
2202
2200
addPreRewrite (addPass);
2203
2201
addPass (VirtRegRewriterPass (true ));
2204
2202
2205
- // TODO: addPass(AMDGPUMarkLastScratchLoadPass());
2203
+ addPass (AMDGPUMarkLastScratchLoadPass ());
2206
2204
return Error::success ();
2207
2205
}
2208
2206
@@ -2252,47 +2250,6 @@ void AMDGPUCodeGenPassBuilder::addPreEmitPass(AddMachinePass &addPass) const {
2252
2250
2253
2251
addPass (BranchRelaxationPass ());
2254
2252
}
2255
- Error AMDGPUCodeGenPassBuilder::addRegAssignmentOptimized (
2256
- AddMachinePass &addPass) const {
2257
- addPass (GCNPreRALongBranchRegPass ());
2258
-
2259
- addRegAllocPassOrOpt (
2260
- addPass, []() { return RAGreedyPass ({onlyAllocateSGPRs, " sgpr" }); });
2261
-
2262
- // Commit allocated register changes. This is mostly necessary because too
2263
- // many things rely on the use lists of the physical registers, such as the
2264
- // verifier. This is only necessary with allocators which use LiveIntervals,
2265
- // since FastRegAlloc does the replacements itself.
2266
- // TODO: addPass(VirtRegRewriterPass(false));
2267
-
2268
- // At this point, the sgpr-regalloc has been done and it is good to have the
2269
- // stack slot coloring to try to optimize the SGPR spill stack indices before
2270
- // attempting the custom SGPR spill lowering.
2271
- addPass (StackSlotColoringPass ());
2272
-
2273
- // Equivalent of PEI for SGPRs.
2274
- addPass (SILowerSGPRSpillsPass ());
2275
-
2276
- // To Allocate wwm registers used in whole quad mode operations (for shaders).
2277
- addPass (SIPreAllocateWWMRegsPass ());
2278
-
2279
- // For allocating other wwm register operands.
2280
- addRegAllocPassOrOpt (
2281
- addPass, []() { return RAGreedyPass ({onlyAllocateWWMRegs, " wwm" }); });
2282
- addPass (SILowerWWMCopiesPass ());
2283
- addPass (VirtRegRewriterPass (false ));
2284
- addPass (AMDGPUReserveWWMRegsPass ());
2285
-
2286
- // For allocating per-thread VGPRs.
2287
- addRegAllocPassOrOpt (
2288
- addPass, []() { return RAGreedyPass ({onlyAllocateVGPRs, " vgpr" }); });
2289
-
2290
- // TODO: addPreRewrite();
2291
- addPass (VirtRegRewriterPass (false ));
2292
-
2293
- // TODO: addPass(AMDGPUMarkLastScratchLoadPass());
2294
- return Error::success ();
2295
- }
2296
2253
2297
2254
bool AMDGPUCodeGenPassBuilder::isPassEnabled (const cl::opt<bool > &Opt,
2298
2255
CodeGenOptLevel Level) const {
0 commit comments