forked from OSchip/llvm-project
GlobalISel: Move finalizeLowering call later
This matches the DAG behavior where this is called after the loop checking for calls. The AMDGPU implementation depends on knowing if there are calls in the function or not, so move this later. Another problem is finalizeLowering is actually called twice; I was seeing weird inconsistencies since the first call would produce unexpected results and the second run would correct them in some contexts. Since this requires disabling the verifier, and it's useful to serialize the MIR immediately after selection, FinalizeISel should probably not be a real pass.
This commit is contained in:
parent
a5b9ad7e9a
commit
521ebc1681
|
@ -223,9 +223,6 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
auto &TLI = *MF.getSubtarget().getTargetLowering();
|
||||
TLI.finalizeLowering(MF);
|
||||
|
||||
// Determine if there are any calls in this machine function. Ported from
|
||||
// SelectionDAG.
|
||||
MachineFrameInfo &MFI = MF.getFrameInfo();
|
||||
|
@ -241,6 +238,9 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: FinalizeISel pass calls finalizeLowering, so it's called twice.
|
||||
auto &TLI = *MF.getSubtarget().getTargetLowering();
|
||||
TLI.finalizeLowering(MF);
|
||||
|
||||
LLVM_DEBUG({
|
||||
dbgs() << "Rules covered by selecting function: " << MF.getName() << ":";
|
||||
|
@ -249,11 +249,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
|
|||
dbgs() << "\n\n";
|
||||
});
|
||||
CoverageInfo.emit(CoveragePrefix,
|
||||
MF.getSubtarget()
|
||||
.getTargetLowering()
|
||||
->getTargetMachine()
|
||||
.getTarget()
|
||||
.getBackendName());
|
||||
TLI.getTargetMachine().getTarget().getBackendName());
|
||||
|
||||
// If we successfully selected the function nothing is going to use the vreg
|
||||
// types after us (otherwise MIRPrinter would need them). Make sure the types
|
||||
|
|
Loading…
Reference in New Issue