[PATCH] D131932: RAGreedyStats: Ignore identity COPYs; count COPYs from/to physregs

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 04:21:13 PDT 2022


mtrofin added inline comments.


================
Comment at: llvm/lib/CodeGen/RegAllocGreedy.cpp:2377
+      // Only count `COPY`s with a virtual register as source or destination.
+      if (SrcReg.isVirtual() || DestReg.isVirtual()) {
+        if (SrcReg.isVirtual()) {
----------------
mtrofin wrote:
> nit: how about:
> 
> ```
> if (SrcReg.isVirtual()) {
>   ...
> }
> if (DestReg.isVirtual()) {
>   ...
> }
> Stats.Copies += (SrcReg != DestReg);
> ```
> 
Oh, never mind, incorrect suggestion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131932



More information about the llvm-commits mailing list