[PATCH] D78772: [AMDGPU] Adapt GCNRegBankReassign for 16 bit subregs

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 16:48:56 PDT 2020


rampitec marked an inline comment as done.
rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.h:287-288
   unsigned getChannelFromSubReg(unsigned SubReg) const {
-    return SubReg ? divideCeil(getSubRegIdxOffset(SubReg), 32) : 0;
+    if (!SubReg)
+      return 0;
+    unsigned Offset = getSubRegIdxOffset(SubReg) & ~31u;
----------------
arsenm wrote:
> I would expect this to be an assert, but. guess it already handled this case
That's because hi16 returns 16 as an offset, and then divideCell returns 1 which is plain wrong.


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

https://reviews.llvm.org/D78772





More information about the llvm-commits mailing list