This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Don't crash on global_ctor/dtor declaration
ClosedPublic

Authored by ruiling on Jun 21 2022, 9:55 PM.

Diff Detail

Event Timeline

ruiling created this revision.Jun 21 2022, 9:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 9:55 PM
ruiling requested review of this revision.Jun 21 2022, 9:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 9:55 PM
foad added inline comments.Jun 22 2022, 12:04 AM
llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
56

Don't need the !GA check here any more.

Alternatively you could use dyn_cast_or_null on line 55.

nhaehnle added inline comments.Jun 22 2022, 3:17 AM
llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
56

Isn't this just being defensive about what type the initializer is? That seems wise to me, you also wouldn't need a dyn_cast otherwise.

foad added inline comments.Jun 22 2022, 3:27 AM
llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
56

You're right, please ignore all my comments :(

arsenm added inline comments.Jun 22 2022, 6:26 AM
llvm/test/CodeGen/AMDGPU/lower-ctor-dtor-declaration.ll
2

Don't need -filetype=asm. Also don't need -o - if you're doing redirected input

ruiling updated this revision to Diff 439227.Jun 22 2022, 6:03 PM

address review comments

arsenm accepted this revision.Jun 22 2022, 6:09 PM
This revision is now accepted and ready to land.Jun 22 2022, 6:09 PM
This revision was landed with ongoing or failed builds.Jun 23 2022, 6:05 AM
This revision was automatically updated to reflect the committed changes.