[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks when an FP atomic instruction is converted into a CAS loop or unsafe hardware instruction for GFX90A
Stanislav Mekhanoshin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 4 08:44:00 PDT 2021
rampitec added inline comments.
================
Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:595
+ OptimizationRemark Remark(DEBUG_TYPE, "Passed", RMW->getFunction());
+ Remark << "A hardware instruction was generated";
+ return Remark;
----------------
Nothing was generated just yet, pass just left IR instruction untouched. In a common case we cannot say what an abstract BE will do about it later.
================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:12139
+ OptimizationRemark Remark(DEBUG_TYPE, "Passed", RMW->getFunction());
+ Remark << "A hardware instruction was generated";
+ return Remark;
----------------
It was not generated. We have multiple returns below this point. Some of them return None and some CmpXChg for various reasons. The request was to report when we produce the instruction *if* it is unsafe, not just that we are about to produce an instruction.
Then to make it useful a remark should tell what was the reason to either produce an instruction or expand it. Looking at a stream of remarks in a big program one would also want to understand what exactly was expanded and what was left as is. A stream of messages "A hardware instruction was generated" unlikely will help to understand what was done.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106891/new/
https://reviews.llvm.org/D106891
More information about the cfe-commits
mailing list