This is an archive of the discontinued LLVM Phabricator instance.

[Assignment Tracking Analysis][4/*] Plumb analysis results into SelectionDAG
ClosedPublic

Authored by Orlando on Oct 20 2022, 3:16 AM.

Details

Summary

With assignment tracking enabled debug intrinsics are ignored by SelectionDAG and it instead reads location definitions generated by the analysis pass.

SelectionDAG itself has no fundamental need to refer to debug intrinsics directly so this change is fairly straightforward.

The analysis results are used in SelectionDAGBuilder::visit - fetching the batch of definitions that come just before each instruction that is about to be processed, and processing them as if they were debug intrinsics. They're also used in SelectionDAGISel::SelectAllBasicBlocks where dbg.declare intrinsic behaviour is mimicked for single memory location defs.

DanglingDebugInfo has been updated to point to a either a DbgValueInst or a VarLocRecord, and its API has been updated to fetch information from whichever it was initialised with.


With this, tests can be added - coming in the next patch.

Diff Detail

Event Timeline

Orlando created this revision.Oct 20 2022, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 3:16 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Orlando requested review of this revision.Oct 20 2022, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 3:16 AM
StephenTozer accepted this revision.Nov 3 2022, 9:05 AM
StephenTozer added a subscriber: StephenTozer.

Mostly boilerplate, but the substance of this LGTM.

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
1369

Since processDbgDeclares is not the only function that will call this now-extracted code, probably best to just use the name of this function directly so as not to mislead.

This revision is now accepted and ready to land.Nov 3 2022, 9:05 AM
Orlando updated this revision to Diff 477513.Nov 23 2022, 8:30 AM
Orlando marked an inline comment as done.

Thanks for the review.

+Update to address nit