summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.h
AgeCommit message (Collapse)Author
2025-03-18[LiveDebugValues][NFC] Remove TargetPassConfig from LDVImpl (#131562)Akshat Oke
TPC is only used to access the option `ShouldEmitDebugEntryValues`.
2022-03-16Cleanup codegen includesserge-sans-paille
This is a (fixed) recommit of https://reviews.llvm.org/D121169 after: 1061034926 before: 1063332844 Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D121681
2022-03-10Revert "Cleanup codegen includes"Nico Weber
This reverts commit 7f230feeeac8a67b335f52bd2e900a05c6098f20. Breaks CodeGenCUDA/link-device-bitcode.cu in check-clang, and many LLVM tests, see comments on https://reviews.llvm.org/D121169
2022-03-10Cleanup codegen includesserge-sans-paille
after: 1061034926 before: 1063332844 Differential Revision: https://reviews.llvm.org/D121169
2022-02-06[CodeGen] Use = default (NFC)Kazu Hirata
Identified with modernize-use-equals-default
2022-01-12[DebugInfo] Move flag for instr-ref to LLVM option, from TargetOptionsJeremy Morse
This feature was previously controlled by a TargetOptions flag, and I figured that codegen::InitTargetOptionsFromCodeGenFlags would default it to "on" for all frontends. Enabling by default was discussed here: https://lists.llvm.org/pipermail/llvm-dev/2021-November/153653.html and originally supposed to happen in 3c045070882f3, but it didn't actually take effect, as it turns out frontends initialize TargetOptions themselves. This patch moves the flag from a TargetOptions flag to a global flag to CodeGen, where it isn't immediately affected by the frontend being used. Hopefully this will actually cause instr-ref to be on by default on x86_64 now! This patch is easily reverted, and chances of turbulence are moderately high. If you need to revert, please consider instead commenting out the 'return true' part of llvm::debuginfoShouldUseDebugInstrRef to turn the feature off, and dropping me an email. Differential Revision: https://reviews.llvm.org/D116821
2021-10-13[DebugInfo][InstrRef] Use PHI placement utilities for machine locationsJeremy Morse
InstrRefBasedLDV used to try and determine which values are in which registers using a lattice approach; however this is hard to understand, and broken in various ways. This patch replaces that approach with a standard SSA approach using existing LLVM utilities. PHIs are placed at dominance frontiers; value propagation then eliminates un-necessary PHIs. This patch also adds a bunch of unit tests that should cover many of the weirder forms of control flow. Differential Revision: https://reviews.llvm.org/D110173
2021-08-17[DebugInfo][InstrRef] Honour too-much-debug-info cutoutsJeremy Morse
This reapplies 54a61c94f93, its follow up in 547b712500e, which were reverted 95fe61e63954. Original commit message: VarLoc based LiveDebugValues will abandon variable location propagation if there are too many blocks and variable assignments in the function. If it didn't, and we had (say) 1000 blocks and 1000 variables in scope, we'd end up with 1 million DBG_VALUEs just at the start of blocks. Instruction-referencing LiveDebugValues should honour this limitation too (because the same limitation applies to it). Hoist the relevant command line options into LiveDebugValues.cpp and pass it down into the implementation classes as an argument to ExtendRanges. I've duplicated all the run-lines in live-debug-values-cutoffs.mir to have an instruction-referencing flavour. Differential Revision: https://reviews.llvm.org/D107823
2021-08-16Revert 54a61c94f93 and its follow up in 547b712500eJeremy Morse
These were part of D107823, however asan has found something excitingly wrong happening: https://lab.llvm.org/buildbot/#/builders/5/builds/10543/steps/13/logs/stdio
2021-08-16[DebugInfo][InstrRef] Honour too-much-debug-info cutoutsJeremy Morse
VarLoc based LiveDebugValues will abandon variable location propagation if there are too many blocks and variable assignments in the function. If it didn't, and we had (say) 1000 blocks and 1000 variables in scope, we'd end up with 1 million DBG_VALUEs just at the start of blocks. Instruction-referencing LiveDebugValues should honour this limitation too (because the same limitation applies to it). Hoist the relevant command line options into LiveDebugValues.cpp and pass it down into the implementation classes as an argument to ExtendRanges. I've duplicated all the run-lines in live-debug-values-cutoffs.mir to have an instruction-referencing flavour. Differential Revision: https://reviews.llvm.org/D107823
2021-01-30[llvm] Add missing header guards (NFC)Kazu Hirata
Identified with llvm-header-guard.
2020-08-22[LiveDebugValues] Add instruction-referencing LDV implementationJeremy Morse
This patch imports the instruction-referencing implementation of LiveDebugValues proposed here: http://lists.llvm.org/pipermail/llvm-dev/2020-June/142368.html The new implementation is unreachable in this patch, it's the next patch that enables it behind a command line switch. Briefly, rather than tracking variable locations by just their location as the 'VarLoc' implementation does, this implementation does it by value: * Each value defined in a function is numbered, and propagated through dataflow, * Each DBG_VALUE reads a machine value number from a machine location, * Variable _values_ are propagated through dataflow, * Variable values are translated back into locations, DBG_VALUEs inserted to specify where those locations are. The ultimate aim of this is to enable referring to variable values throughout post-isel code, rather than locations. Those patches will build on top of this new LiveDebugValues implementation in later patches -- it can't be done with the VarLoc implementation as we don't have value information, only locations. Differential Revision: https://reviews.llvm.org/D83047
2020-08-22[LiveDebugValues] Install an implementation-picking LiveDebugValues passJeremy Morse
This patch renames the current LiveDebugValues class to "VarLocBasedLDV" and removes the pass-registration code from it. It creates a separate LiveDebugValues class that deals with pass registration and management, that calls through to VarLocBasedLDV::ExtendRanges when runOnMachineFunction is called. This is done through the "LDVImpl" abstract class, so that a future patch can install the new instruction-referencing LiveDebugValues implementation and have it picked at runtime. No functional change is intended, just shuffling responsibilities. Differential Revision: https://reviews.llvm.org/D83046