This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Handle nullptr constants in dbg.value
ClosedPublic

Authored by fdeazeve on Jul 28 2022, 11:25 AM.

Details

Summary

Currently, the LLVM IR -> MIR translator fails to translate dbg.values
whose first argument is a null pointer. However, in other portions of
the code, such pointers are always lowered to the constant zero, for
example see IRTranslator::Translate(Constant, Register).

This patch addresses the limitation by following the same approach of
lowering null pointers to zero.

A prior test was checking that null pointers were always lowered to
$noreg; this test is changed to check for zero, and the previous
behavior is now checked by introducing a dbg.value whose first argument
is the address of a global variable.

Diff Detail

Event Timeline

fdeazeve created this revision.Jul 28 2022, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 11:25 AM
fdeazeve requested review of this revision.Jul 28 2022, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 11:25 AM
fdeazeve updated this revision to Diff 448393.Jul 28 2022, 11:27 AM

Removed redundant llvm:: namespace.

The failing test is a spurious timeout that seems to happen randomly in other reviews too: AddressSanitizer-x86_64-linux :: TestCases/scariness_score_test.cpp

aprantl accepted this revision.Jul 28 2022, 2:56 PM
This revision is now accepted and ready to land.Jul 28 2022, 2:56 PM
This revision was landed with ongoing or failed builds.Jul 28 2022, 2:58 PM
This revision was automatically updated to reflect the committed changes.