[llvm] [AMDGPU] Don't send DEALLOC_VGPRs after calls (PR #77439)

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 04:27:47 PST 2024


================
@@ -1487,6 +1488,9 @@ void SIInsertWaitcnts::updateEventWaitcntAfter(MachineInstr &Inst,
     if (callWaitsOnFunctionReturn(Inst)) {
       // Act as a wait on everything
       ScoreBrackets->applyWaitcnt(AMDGPU::Waitcnt::allZeroExceptVsCnt());
+      // Since there's no guaranteed wait on VsCnt, scratch stores might still
+      // be in flight.
+      ScoreBrackets->setPendingEvent(SCRATCH_WRITE_ACCESS);
----------------
rovka wrote:

> Nit: There could also be in-flight global non-scratch stores, correct?
> 
> The comment on `SCRATCH_WRITE_ACCESS` says `vector-memory write that may be scratch` so these should be covered, but I wonder whether we should still explicitly include `VMEM_WRITE_ACCESS`.

I changed it to incorporate Jay's suggestion, so I think we're covered now (setStateOnFunctionEntryOrReturn doesn't care about the event type, it only deals in terms of VsCnt).

https://github.com/llvm/llvm-project/pull/77439


More information about the llvm-commits mailing list