[PATCH] D128320: AMDGPU: Don't crash on global_ctor/dtor declaration
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 22 03:27:35 PDT 2022
foad added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp:56
ConstantArray *GA = dyn_cast<ConstantArray>(GV->getInitializer());
if (!GA || GA->getNumOperands() == 0)
return false;
----------------
nhaehnle wrote:
> foad wrote:
> > Don't need the `!GA` check here any more.
> >
> > Alternatively you could use dyn_cast_or_null on line 55.
> 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.
You're right, please ignore all my comments :(
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128320/new/
https://reviews.llvm.org/D128320
More information about the llvm-commits
mailing list