[PATCH] D108830: [AMDGPU] Propagate defining src reg for AGPR to AGPR Copys
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 20 16:14:54 PDT 2021
rampitec added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/GCNPreRAOptimizations.cpp:101
+ // accvgpr_write to avoid temporary registers.
+ Register DstReg = I.getOperand(0).getReg();
+ Register SrcReg = I.getOperand(1).getReg();
----------------
rampitec wrote:
> You know you are dealing with an AGPR or SGPR right at the beginning of the function. You can quickly bail from here based on that.
DstReg always the same as Reg or at least should be unless it is not an implicit-def. At maximum I would expect assert(Reg == I.getOperand(0).getReg()) here.
================
Comment at: llvm/lib/Target/AMDGPU/GCNPreRAOptimizations.cpp:104
+
+ if (!Reg.isVirtual() || !SrcReg.isVirtual())
+ break;
----------------
Reg is always virtual, it is a result of index2VirtReg() call.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108830/new/
https://reviews.llvm.org/D108830
More information about the llvm-commits
mailing list