[PATCH] D34130: [AMDGPU] Eliminate SGPR to VGPR copy when possible

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 13:18:26 PDT 2017


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIFixSGPRCopies.cpp:198
+  // Change VGPR to SGPR destination.
+  MRI.setRegClass(DstReg, TRI->getEquivalentSGPRClass(MRI.getRegClass(DstReg)));
+  return true;
----------------
rampitec wrote:
> arsenm wrote:
> > I forsee this breaking cases with multiple uses
> Why? I'm checking all uses for operand legality. It also does not happen if there is a second def of the same register.
I have added test for multiple uses.


Repository:
  rL LLVM

https://reviews.llvm.org/D34130





More information about the llvm-commits mailing list