[PATCH] D150438: [LLVM][Uniformity] Improve detection of uniform registers

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 03:22:28 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp:2879
+  // if available.
+  auto *RC = MRI.getRegClassOrNull(Reg);
+  if (!RC)
----------------
sameerds wrote:
> arsenm wrote:
> > Can combine these two queries into getRegClassOrRegBank
> What's the advantage of that? The PointerUnion will simply conflate two different things for me, and the only improvement that I see is that I can check both for nullptr at the same time. After that, I still have to insert at least one ugly dyn_cast along with a full type name instead of auto just to get to the RegBank. Isn't the current version much more readable?
It's one map lookup instead of 2. It also is really one thing, not two


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150438



More information about the llvm-commits mailing list