[PATCH] D103138: [AMDGPU] [IndirectCalls] Don't propagate attributes to address taken functions and their callees

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 12:45:24 PDT 2021


rampitec added a comment.

Generally LGTM. Please wait other reviewers too.



================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPropagateAttributes.cpp:234-237
+  if (!ModuleCG) {
+    llvm_unreachable("Call graph not valid");
+    return Changed;
+  }
----------------
madhur13490 wrote:
> foad wrote:
> > madhur13490 wrote:
> > > arsenm wrote:
> > > > Just assert, the return is dead
> > > I'd say its a style choice. Preferring llvm_unreachable over assert.
> > Then it's a bad choice :) I agree with Matt. `assert(CG)` or `assert(CG && "message")` are shorter and simpler and more familiar because they're already ubiquitous throughout llvm.
> As per coding standards, llvm_unreachable seems more preferred.
> https://llvm.org/docs/CodingStandards.html#assert-liberally
> 
> @rampitec What do you think? Internally, I changed this from assert.
> 
Internally if was "if() assert(false ...)". assert(false) shall never be used, that's why I suggested llvm_unreachange() instead. But "assert(ModuleCG);" is a more common thing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103138/new/

https://reviews.llvm.org/D103138



More information about the llvm-commits mailing list