[PATCH] D127055: [ARM] Merge duplicated Thumb2SizeReduce code (NFC)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 11:40:01 PDT 2022


efriedma added a comment.

I don't think the setMIFlags() call belongs in the helper; it's technically duplicated across all the functions, but it's conceptually part of creating an equivalent instruction, and the steps for that are different in each place.

I don't think refactoring the debug counter increment is helpful; counters aren't normally passed around that way, so it's a bit confusing to follow.

At that point, the helper is basically three lines, so I'm not sure the refactoring is worthwhile.  Maybe if you wanted to add something else to the refactored function, but I'm not sure what that would be.



================
Comment at: llvm/lib/Target/ARM/Thumb2SizeReduction.cpp:413
+
+  LLVM_DEBUG(llvm::dbgs() << "Converted 32-bit: " << *MI
+                          << "       to 16-bit: " << *MIB);
----------------
"llvm::" prefix isn't necessary; this file is "using namespace llvm".


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

https://reviews.llvm.org/D127055



More information about the llvm-commits mailing list