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

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 10:57:54 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));
 
----------------
arsenm wrote:
> rampitec wrote:
> > 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.
> Don't see why you merged in these cases that early returned before
I am generally concerned by these early returns. We may skip checking other hazards which require more waitstates. I think we may need to remove all early returns here completely with the complexity of the hazard recognizer growing.


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

https://reviews.llvm.org/D124550



More information about the llvm-commits mailing list