Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MachineCombiner] Preserve debug instruction number
Each target's `TargetInstrInfo` is responsible for announcing which code patterns it is able to transform during the MachineCombiner pass. Currently, these patterns are applied without preserving the debug instruction number required by the InstrRef implementation of LiveDebugValues. As such, we've seen a number of examples where debug information is dropped for variables in InstrRef mode that were otherwise available in VarLoc mode. This has been observed both in X86 and AArch examples. This commit is an initial attempt at preserving said numbers by changing the general (target agnostic) implementation of TargetInstrInfo: the reassociation pattern must keep the debug number of the "top level" instruction, i.e., the instruction whose value represents the final value of the arithmetic expression. Intermediate values must have their debug number dropped, as they have no equivalent value in the unoptimized code. Future work is required to update each target's `TargetInstrInfo::genAlternativeCodeSequence` method. Differential Revision: https://reviews.llvm.org/D145759
- Loading branch information