[llvm] [CodeGen] Correctly handle non-standard cases in RemoveLoadsIntoFakeUses (PR #111551)
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 28 03:56:24 PST 2025
================
@@ -79,7 +79,7 @@ INITIALIZE_PASS_END(RemoveLoadsIntoFakeUses, DEBUG_TYPE,
bool RemoveLoadsIntoFakeUses::runOnMachineFunction(MachineFunction &MF) {
// Skip this pass if we would use VarLoc-based LDV, as there may be DBG_VALUE
// instructions of the restored values that would become invalid.
- if (debuginfoShouldUseDebugInstrRef(MF.getTarget().getTargetTriple()))
+ if (!MF.shouldUseDebugInstrRef())
----------------
jmorse wrote:
I think this should call `useDebugInstrRef`, which queries the bit of state that MachineFunction carries around with it. IIRC, the "should" method is testing which mode should be used given the optimisation configuration, while the bit records the actual truth of whether instr-ref is being used or not. This allows for (semi-legitimate) situations where some MIR that uses instr-ref is loaded into a configuration where we would have chosen to not use instr-ref.
https://github.com/llvm/llvm-project/pull/111551
More information about the llvm-commits
mailing list