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

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 02:25:27 PDT 2023


sameerds marked 3 inline comments as done.
sameerds added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp:2879
+  // if available.
+  auto *RC = MRI.getRegClassOrNull(Reg);
+  if (!RC)
----------------
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?


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