[PATCH] D155080: [AMDGPU] Corrrectly emit AGPR copies in tryFoldPhiAGPR

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 23:55:09 PDT 2023


Pierre-vh marked an inline comment as done.
Pierre-vh added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFoldOperands.cpp:1747
 
+  bool IsAGPR32 = (ARC == &AMDGPU::AGPR_32RegClass);
+
----------------
arsenm wrote:
> Class equality is usually wrong but probably happens to be OK here. ARC->IsSuperclassEq?
I think an equality check is the right thing here. I only want to match AGPR32, nothing else, because V_ACCVGPR_WRITE only accepts that in its operands. A quick search for `== &AMDGPU::AGPR_32RegClass` across the codebase shows a few places that also use this pattern when dealing with that instruction


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155080



More information about the llvm-commits mailing list