This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Don't crash on anonymous GlobalValues
ClosedPublic

Authored by tstellarAMD on Sep 23 2016, 7:40 AM.

Details

Summary

We need to call AsmPrinter::getNameWithPrefix() in order to handle
anonymous GlobalValues (e.g. @0, @1).

Diff Detail

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Don't crash on GlobalValues with no name.
tstellarAMD updated this object.
tstellarAMD added reviewers: arsenm, b-sumner.
tstellarAMD added a subscriber: llvm-commits.
b-sumner edited edge metadata.Sep 23 2016, 8:38 AM

I'd replace argument name AsmPrinter with AP to match the existing style.

arsenm edited edge metadata.Sep 23 2016, 8:41 AM

A better name for the test would be anonymous-gv.

Can you also add a test that uses an anonymous kernel

tstellarAMD edited edge metadata.

Fix coding style and anonymous functions.

tstellarAMD retitled this revision from AMDGPU/SI: Don't crash on GlobalValues with no name to AMDGPU/SI: Don't crash on anonymous GlobalValues .Sep 23 2016, 10:06 AM
tstellarAMD updated this object.
b-sumner accepted this revision.Sep 23 2016, 10:10 AM
b-sumner edited edge metadata.

Looks good to me.

This revision is now accepted and ready to land.Sep 23 2016, 10:10 AM
arsenm added inline comments.Sep 23 2016, 4:53 PM
test/CodeGen/AMDGPU/anonymous-gv.ll
5–15

The generated anonymous names should be checked

This revision was automatically updated to reflect the committed changes.