[PATCH] D124550: [AMDGPU] Handle LDS DMA and LDS_DIRECT hazards

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 01:56:39 PDT 2022


rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp:366-377
   if (ST.hasReadM0MovRelInterpHazard() && (TII.isVINTRP(*MI) ||
                                            isSMovRel(MI->getOpcode())))
     return std::max(WaitStates, checkReadM0Hazards(MI));
 
   if (ST.hasReadM0SendMsgHazard() && isSendMsgTraceDataOrGDS(TII, *MI))
     return std::max(WaitStates, checkReadM0Hazards(MI));
 
----------------
foad wrote:
> The coding style is strange here because it looks like it could call checkReadM0Hazards four times. But I guess in practice at most one of the conditionals will be true?
It tests for different types of instructions, so the actual function will be called once at most. Moreover, these are not common instructions. In fact scanning for operands to see if it uses LDS_DIRECT is more expensive.


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

https://reviews.llvm.org/D124550



More information about the llvm-commits mailing list