As part of https://github.com/llvm/llvm-project/pull/174746 I encountered a compile time regression due to ResetMachineFunction performing full resets on empty functions. In normal operation, this behaviour is not likely to impact compile time, as the pass is only inserted when using GlobalISel. https://github.com/llvm/llvm-project/pull/174746 includes GlobalISel passes in the SDAG pipeline (only on AArch64) and skips them if a given function is not optnone surfacing this. By checking if the MachineFunction is empty we can perform a more lightweight reset that just sets the required flags, reducing the impact of this change.
4.0 KiB
4.0 KiB