-
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] Make getDbgValueRange inlineable (#79331)
`getDbgValueRange` is the replacement of a common LLVM idiom of: 1) Am I currently looking at a `DbgVariableIntrinsic` instruction? 2) Let's do something special with it! We instead iterate over the range of DPValues attached to an instruction and do special things with those. Unfortunately in the common case of "there is no debug-info", this generates a spurious function call that's paid by non-debug builds. To get around this, make `getDbgValueRange` inlineable so that the "`if (DbgMarker)`" test can be inlined and guard the more expensive call. The false path should be optimisable-awayable to skipping the loop. However, due to header inclusion order we can't just make `Instruction::getDbgValueRange` inline because `DPMarker` hasn't been declared yet. So, define an inlinable function in the llvm:: namespace and pre-declare it -- the eventual code should be inlineable almost 100% of the time.
- Loading branch information
Showing
3 changed files
with
16 additions
and
13 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