This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix opaque pointer and other bugs in printf of constant strings
ClosedPublic

Authored by arsenm on Jan 6 2023, 11:41 AM.

Details

Reviewers
sameerds
vikramRH
Group Reviewers
Restricted Project
Summary

Strip pointer casts to get to the global. Fixes not respecting indexed
constant strings. Tolerate non-null terminated and empty strings.

Diff Detail

Event Timeline

arsenm created this revision.Jan 6 2023, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 11:41 AM
arsenm requested review of this revision.Jan 6 2023, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 11:41 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm updated this revision to Diff 486957.Jan 6 2023, 11:59 AM
arsenm planned changes to this revision.Jan 6 2023, 12:36 PM

The allocation size part has all the same bugs

nikic added a subscriber: nikic.Jan 6 2023, 1:54 PM
nikic added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
407

Can you replace this code with getConstantStringInfo()?

arsenm updated this revision to Diff 487018.Jan 6 2023, 4:54 PM

Use getConstantStringInfo, check size and conformance actually passes now

sameerds accepted this revision.Jan 9 2023, 2:52 AM
This revision is now accepted and ready to land.Jan 9 2023, 2:52 AM