[PATCH] D137539: [SIFoldOperands] Small code cleanups, NFC.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 05:50:44 PST 2022


foad accepted this revision.
foad added a comment.
This revision is now accepted and ready to land.

Looks fine, just some nits inline.



================
Comment at: llvm/lib/Target/AMDGPU/SIFoldOperands.cpp:191
 
+  const uint64_t TSFlags = MI->getDesc().TSFlags;
   if (Fold.isImm()) {
----------------
Move this down one line?


================
Comment at: llvm/lib/Target/AMDGPU/SIFoldOperands.cpp:686
+
+        for (auto &F : CopyUses)
+          foldOperand(*F.OpToFold, F.UseMI, F.UseOpNo, FoldList,
----------------
I think the rule is to keep the braces if the body is more than one physical line, even if it's a single logical line.


================
Comment at: llvm/lib/Target/AMDGPU/SIFoldOperands.cpp:1007
+
+  /// Remove any leftover implicit operands from mutating the instruction. e.g.
+  /// if we replace an s_and_b32 with a copy, we don't need the implicit scc def
----------------
Probably does not deserve to be a doxygen (three-slash) comment now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137539



More information about the llvm-commits mailing list