[PATCH] D38164: [MachineScheduler] Favor instructions that do not increase pressure.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 15:30:45 PDT 2017


MatzeB added a comment.

In https://reviews.llvm.org/D38164#879556, @fhahn wrote:

> In https://reviews.llvm.org/D38164#879078, @MatzeB wrote:
>
> > - I vaguely remember trying something like this and having some crypto benchmarks produce bad schedules; I'll see if I can remember/find it
>
>
> Thanks for the pointer, I have a few crypto benchmarks I can run too.
>
> > - tryPressure seems like the wrong place to me, as it is used in 3 different contexts: (compared with target limits, compared with increase region limits, and the current max). From your description it sounds like we only want this behavior once.
>
> Thanks, I'll look into that.
>
> > - Do you have a specific example where this helps?
>
> The runtime of float-mm from the LLVM test-suite increase by around 15% because of additional spilling on ARM with the MachineScheduler enabled (on Cortex-A57). I can also have a look at some improvements on AArch64.


I cannot find that particular test, in the test-suite what's the exact name/path (or is it an internal one)?



================
Comment at: lib/CodeGen/MachineScheduler.cpp:2777-2788
+
+  // If one of the candidates does neither increase or decrease pressure, but
+  // the other does increase the pressure, go with it.
+  if (TryP.getUnitInc() == 0 && CandP.getUnitInc() > 0) {
+    TryCand.Reason = Reason;
+    return true;
+  }
----------------
Why isn't this using `tryGreate()` and isn't this the same as just changing `getUnitInc() < 0` to `getUnitInc() <= 0` in the earlier check?


https://reviews.llvm.org/D38164





More information about the llvm-commits mailing list