Skip to content

Commit cadd6e0

Browse files
committed
fix merge conflict errors
1 parent 3ead04f commit cadd6e0

File tree

3 files changed

+11
-50
lines changed

3 files changed

+11
-50
lines changed

llvm/include/llvm/Passes/PassBuilder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,8 @@ Expected<bool> parseMachineSinkingPassOptions(StringRef Params,
994994
const PassBuilder &);
995995
Expected<bool> parseMachineBlockPlacementPassOptions(StringRef Params,
996996
const PassBuilder &);
997+
Expected<bool> parseVirtRegRewriterPassOptions(StringRef Params,
998+
const PassBuilder &);
997999
}
9981000

9991001
#endif

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,8 +1465,8 @@ llvm::parseMachineBlockPlacementPassOptions(StringRef Params,
14651465
return AllowTailMerge;
14661466
}
14671467

1468-
Expected<bool> llvm::parseVirtRegRewriterPassOptions(const PassBuilder &PB,
1469-
StringRef Params) {
1468+
Expected<bool> llvm::parseVirtRegRewriterPassOptions(StringRef Params,
1469+
const PassBuilder &) {
14701470
bool ClearVirtRegs = true;
14711471
if (!Params.empty()) {
14721472
ClearVirtRegs = !Params.consume_front("no-");

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,8 @@ Error AMDGPUCodeGenPassBuilder::addRegAssignmentOptimized(
21682168

21692169
addPass(GCNPreRALongBranchRegPass());
21702170

2171-
addPass(RAGreedyPass({onlyAllocateSGPRs, "sgpr"}));
2171+
addRegAllocPassOrOpt(
2172+
addPass, []() { return RAGreedyPass({onlyAllocateSGPRs, "sgpr"}); });
21722173

21732174
// Commit allocated register changes. This is mostly necessary because too
21742175
// many things rely on the use lists of the physical registers, such as the
@@ -2188,21 +2189,20 @@ Error AMDGPUCodeGenPassBuilder::addRegAssignmentOptimized(
21882189
addPass(SIPreAllocateWWMRegsPass());
21892190

21902191
// For allocating other wwm register operands.
2191-
// addRegAlloc<RAGreedyPass>(addPass, RegAllocPhase::WWM);
2192-
addPass(RAGreedyPass({onlyAllocateWWMRegs, "wwm"}));
2192+
addRegAllocPassOrOpt(
2193+
addPass, []() { return RAGreedyPass({onlyAllocateWWMRegs, "wwm"}); });
21932194
addPass(SILowerWWMCopiesPass());
21942195
addPass(VirtRegRewriterPass(false));
21952196
addPass(AMDGPUReserveWWMRegsPass());
21962197

21972198
// For allocating per-thread VGPRs.
2198-
// addRegAlloc<RAGreedyPass>(addPass, RegAllocPhase::VGPR);
2199-
addPass(RAGreedyPass({onlyAllocateVGPRs, "vgpr"}));
2200-
2199+
addRegAllocPassOrOpt(
2200+
addPass, []() { return RAGreedyPass({onlyAllocateVGPRs, "vgpr"}); });
22012201

22022202
addPreRewrite(addPass);
22032203
addPass(VirtRegRewriterPass(true));
22042204

2205-
// TODO: addPass(AMDGPUMarkLastScratchLoadPass());
2205+
addPass(AMDGPUMarkLastScratchLoadPass());
22062206
return Error::success();
22072207
}
22082208

@@ -2252,47 +2252,6 @@ void AMDGPUCodeGenPassBuilder::addPreEmitPass(AddMachinePass &addPass) const {
22522252

22532253
addPass(BranchRelaxationPass());
22542254
}
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-
}
22962255

22972256
bool AMDGPUCodeGenPassBuilder::isPassEnabled(const cl::opt<bool> &Opt,
22982257
CodeGenOptLevel Level) const {

0 commit comments

Comments
 (0)