-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DebugInfo][RemoveDIs] Instrument loop-deletion for DPValues (#73042)
Loop deletion identifies dbg.value intrinsics in the loop, sets them to undef/poison, and sinks them to the exit of the loop, to ensure that any variable assignments that happen in a deleted loop are "optimised out". This needs to be replicated for DPValues, the non-instruction replacement for dbg.value intrinsics. The movement API for DPValues is (deliberately) more limited than dbg.values, which is tricky because inserting the collection of dbg.values at an arbitrary iterator can insert a dbg.value in the middle of a sequence of dbg.values. A big no-no for DPValues. This patch replicates the order by inserting DPValues in reverse at the head-iterator of the block, to ensure the same output as dbg.value mode. Technically the order isn't important, but we're trying to ensure identical outputs from optimisation passes right now. Add more CHECK lines for dbg.values in diundef.ll to ensure that we don't create any spurious dbg.values, and to ensure that sequences of dbg.values come out of the optimisation in the correct order.
- Loading branch information
Showing
4 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
llvm/test/Transforms/LoopDeletion/over-defensive-undefing-dbg-values.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters