This is an archive of the discontinued LLVM Phabricator instance.

Remove overzealous verifier check on DW_OP_LLVM_entry_value and improve the documentation
ClosedPublic

Authored by aprantl on Feb 3 2021, 5:25 PM.

Details

Summary

Based on the comments in the code, the idea is that AsmPrinter is unable to produce entry value blocks of arbitrary length, such as DW_OP_entry_value [DW_OP_reg5 DW_OP_lit1 DW_OP_plus]. But the way the Verifier check is written it also disallows DW_OP_entry_value [DW_OP_reg5] DW_OP_lit1 DW_OP_plus which seems to overshoot the target.
Note that this patch does not change any of the safety guards in LiveDebugValues — there is zero behavior change for clang. It just allows us to legalize more complex expressions in future patches.

rdar://73907559

Diff Detail

Event Timeline

aprantl created this revision.Feb 3 2021, 5:25 PM
aprantl requested review of this revision.Feb 3 2021, 5:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2021, 5:25 PM
djtodoro added inline comments.Feb 3 2021, 11:57 PM
llvm/docs/LangRef.rst
5262–5284

cool!

llvm/lib/IR/DebugInfoMetadata.cpp
1114

The same I added in: https://reviews.llvm.org/D87233#change-euq8o0qWqm4k

Maybe we can add a constexpr variable, for example:

constexpr unsigned entry_val_size = 1;

and use it here as well as in DIExpression::prependOpcodes() from the D87233. WDYT?

aprantl updated this revision to Diff 321505.Feb 4 2021, 10:05 AM
vsk accepted this revision.Feb 4 2021, 10:34 AM

Lgtm (with a nit).

llvm/lib/IR/DebugInfoMetadata.cpp
1114

I think introducing a size constant and referencing it in prependOpcodes is a good idea. If/when we lift the restriction, it'll make it easier to know what to fix up.

This revision is now accepted and ready to land.Feb 4 2021, 10:34 AM
aprantl added inline comments.Feb 4 2021, 10:51 AM
llvm/lib/IR/DebugInfoMetadata.cpp
1114

I was wondering about this, but I'm thinking that prependOpcodes() doesn't want to push the max_entry_value_block_size:  I think it always wants to push 1.