[PATCH] D105485: [IR] Use a proper type for AttributeList indexing

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 6 08:22:58 PDT 2021


gchatelet added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp:641
     ArgInfo OrigArg(VRegs[Idx], Arg);
-    const unsigned OrigArgIdx = Idx + AttributeList::FirstArgIndex;
-    setArgFlags(OrigArg, OrigArgIdx, DL, F);
+    setArgFlags(OrigArg, AttributeList::Index::getArgIndex(Idx), DL, F);
 
----------------
foad wrote:
> This is just a drive-by comment, so feel free to ignore, but for client code like this it would be nicer if we could just write `AttributeList::getArgIndex`. (It already says `Index` in the function name so why do I have to qualify it with `Index::` as well?)
Yes good point, I'm still refining the API to make it easier to use. This is is great suggestion thx!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105485



More information about the llvm-commits mailing list