Page MenuHomePhabricator

[Debuginfo][SROA] (7/7) Support for DW_OP_implicit_pointer for named and unnamed variables (second strategy).
Needs ReviewPublic

Authored by alok on Jul 18 2020, 5:14 PM.

Details

Summary
This patch stems from D84112.
This patch includes changes for SROA optimization.

Diff Detail

Event Timeline

alok created this revision.Jul 18 2020, 5:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2020, 5:14 PM
jmorse added a subscriber: jmorse.Jul 30 2020, 6:09 AM

I see what seem to be changes to codegen here (see inline comments), is that intentional? And if so, why is that needed for DW_OP_LLVM_explicit_pointer to work?

llvm/lib/IR/Metadata.cpp
395

Why is this now permitted behaviour?

llvm/lib/Transforms/Scalar/EarlyCSE.cpp
1648–1654

Is this necessary for the implicit pointer work?

llvm/lib/Transforms/Scalar/SROA.cpp
4419–4503

Again, this block of code will need comments about its purpose adding.

4449–4453

This part looks like it's changing the code generated, replacing a GEP with an alloca. If that's the case, IMO this should be split out into a different patch (one for codegen, one for debuginfo), as any codegen change will need an independent argument as to why it's a good idea.

Plus, this would only be a codegen change for people building with dwarf-5, which would mean you get different code with and without the -g option to clang.

llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
424 ↗(On Diff #279045)

This should be folded into the previous patch (7?)

alok updated this revision to Diff 304755.Nov 12 2020, 1:58 AM
alok retitled this revision from [Debuginfo] (8/N) Support for DW_OP_implicit_pointer for named and unnamed variables (second strategy). to [Debuginfo][SROA] (7/7) Support for DW_OP_implicit_pointer for named and unnamed variables (second strategy)..

Updated to re-base.