[PATCH] D150347: [AMDGPU] Improve abs modifier usage
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 18 01:56:48 PDT 2023
foad added a comment.
LGTM, thanks, but please try to simplify the code - I've added some ideas inline.
================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:7122
// Now we clone an instruction, its operands' defs may sink to this BB
- // now. So we put the operands defs' BBs into FreshBBs to do optmization.
+ // now. So we put the operands defs' BBs into FreshBBs to do optimization.
for (unsigned I = 0; I < NI->getNumOperands(); ++I) {
----------------
Please commit this separately (no review required!)
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp:5151
+
+ if (IntrinsicInst *UI = dyn_cast<IntrinsicInst>(Op)) {
+ switch (UI->getIntrinsicID()) {
----------------
Nit: if you're using PatternMatch already, you can use `m_FAbs` here.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp:5166
+
+ return ShouldSink;
+}
----------------
Nit: might be simpler to return `!Ops.empty()`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150347/new/
https://reviews.llvm.org/D150347
More information about the llvm-commits
mailing list