[PATCH] D37418: [X86] Use btc/btr/bts to implement xor/and/or that affects a single bit in the upper 32-bits of a 64-bit operation.

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 17:02:50 PDT 2017


zvi added a comment.

In https://reviews.llvm.org/D37418#859967, @spatel wrote:

> This is another example where we can't determine profitability in isel. So we should choose whatever we think helps the most common case there. Then, add an MI transform to alter it if we can find profit using uarch machine models and machine trace metrics. If the btc variant always reduces register pressure, that could be a good reason to choose it in isel?


This is a good argument, but then as @reames mentioned we could also try to handle register-pressure at spill-time by letting the target try some peephole-ish tricks to avoid spilling; not sure how well will this fits in the existing regalloc infrastructure.
FWIW, we set different scheduling strategies for 32-bit and 64-bit due to the difference in register abundance:

  else if (Subtarget.is64Bit())
      setSchedulingPreference(Sched::ILP);
    else
      setSchedulingPreference(Sched::RegPressure);


https://reviews.llvm.org/D37418





More information about the llvm-commits mailing list