[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for FP atomics

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 6 10:49:17 PDT 2021


rampitec requested changes to this revision.
rampitec added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:588
+      Remark
+          << "A hardware CAS loop generated: if the memory is "
+             "known to be coarse-grain allocated then a hardware floating-point"
----------------
This is target specific. Besides there can be different reasons for a loop.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:12123
+    OptRemark
+        << "A hardware floating-point atomic instruction generated: "
+           "only safe if the memory is known to be coarse-grain allocated";
----------------
This is not the only reason. You cannot use a fixed string here.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:12120
+                   OptimizationRemarkEmitter *ORE,
+                   OptimizationRemark OptRemark) {
+  ORE->emit([&]() { return OptRemark; });
----------------
gandhi21299 wrote:
> rampitec wrote:
> > Why OptRemark and not just StringRef? I really want to see as little churn as possible at the call site.
> With only StringRef, we would also have to pass in RMW since OptimizationRemark constructor depends on that.
It seems better be a lamda where you can just capture most of the stuff.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106891



More information about the llvm-commits mailing list