[PATCH] D87674: [AMDGPU] Insert waitcnt after returning from call

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 07:21:14 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:846
 /// before returning.
-static bool callWaitsOnFunctionReturn(const MachineInstr &MI) {
-  return true;
-}
+static bool callWaitsOnFunctionReturn() { return false; }
 
----------------
In principle this depend on the calling convention, so should retain the argument


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1208
+  // Insert waitcnts after function calls (that are not tail calls)
+  if (MI.isCall() && !MI.isTerminator()) {
+    if (!callWaitsOnFunctionReturn()) {
----------------
Return early and reduce indentation


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1218
+      if (ST->hasVscnt())
+        BuildMI(*MI.getParent(), I, DebugLoc(),
+                TII->get(AMDGPU::S_WAITCNT_VSCNT))
----------------
Why drop the debug loc?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87674



More information about the llvm-commits mailing list