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

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 19:36:19 PDT 2022


mtrofin accepted this revision.
mtrofin added inline comments.
This revision is now accepted and ready to land.


================
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()) {
----------------
nit: how about:

```
if (SrcReg.isVirtual()) {
  ...
}
if (DestReg.isVirtual()) {
  ...
}
Stats.Copies += (SrcReg != DestReg);
```



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