This is an archive of the discontinued LLVM Phabricator instance.

[NVPTX][FIX] Allow __nvvm_reflect in the presence of opaque pointers
ClosedPublic

Authored by jdoerfert on Apr 11 2022, 10:25 AM.

Diff Detail

Event Timeline

jdoerfert created this revision.Apr 11 2022, 10:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 10:25 AM
jdoerfert requested review of this revision.Apr 11 2022, 10:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 10:25 AM
jdoerfert added inline comments.Apr 11 2022, 10:26 AM
llvm/test/CodeGen/NVPTX/nvvm-reflect-opaque.ll
2

This is llvm/test/CodeGen/NVPTX/nvvm-reflect.ll with opaque pointers and a new function w/o a constant expression (@baz)

jhuber6 accepted this revision.Apr 11 2022, 10:29 AM

LGTM, fixed the problem i was observing locally.

This revision is now accepted and ready to land.Apr 11 2022, 10:29 AM
nikic added inline comments.Apr 11 2022, 10:58 AM
llvm/lib/Target/NVPTX/NVVMReflect.cpp
139

Stripping an arbitrary constant expression looks a bit dubious -- shouldn't this be doing Str->stripPointerCasts()?

jdoerfert added inline comments.Apr 11 2022, 11:14 AM
llvm/lib/Target/NVPTX/NVVMReflect.cpp
139

I basically kept the original code (which didn't check and therefore worked for the GEP and AS cast case).
Will make it strip pointer cast though.

use strip pointer cast

nikic accepted this revision.Apr 11 2022, 12:51 PM

LGTM

This revision was landed with ongoing or failed builds.Apr 12 2022, 2:44 PM
This revision was automatically updated to reflect the committed changes.