[PATCH] D45826: AMDGPU: Legalize the operand of SI_INIT_M0

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 11:43:32 PDT 2018


nhaehnle added inline comments.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:3303
   }
 
   MachineInstrBuilder MIB =
----------------
rampitec wrote:
> Do not you want to return SRegs[0] here (after the loop) if SubRegs == 1 and if not move creation of DstReg after that? It will save some code duplication.
That's what I had at first, but it doesn't work because the loop uses `RI.getSubRegFromChannel(i)`, and if the SrcReg is an SGPR32 this fails because it has no subregs...

This was apparently never noticed because so far, the function was only used for resource descriptors and samplers.


Repository:
  rL LLVM

https://reviews.llvm.org/D45826





More information about the llvm-commits mailing list