[PATCH] D52736: [AMDGPU] Fixed SIInstrInfo::getOpSize to handle subregs

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 20:28:09 PDT 2018


rampitec added inline comments.


================
Comment at: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h:735-736
+    if (MO.isReg()) {
+      if (unsigned SubReg = MO.getSubReg())
+        return RI.getSubRegIndexLaneMask(SubReg).getNumLanes() * 4;
+    }
----------------
arsenm wrote:
> I think this silently will break if we start using 16-bit subregs. Can you assert that this number is consistent with the size of the super-reg?
In fact a lot will break if we start using 16 bit subregs. I would like to add the assert, but that is exactly the problem, one cannot know subreg's size without assuming target specific subreg layout. I.e. I do not see how to do it w/o listing all possible subregs in our target. Also note that MRI.getMaxLaneMaskForVReg() will happily return -1 for the whole register. Any ideas?


Repository:
  rL LLVM

https://reviews.llvm.org/D52736





More information about the llvm-commits mailing list