[PATCH] D122891: [X86] Fold AND(SRL(X,Y),1) -> SETCC(BT(X,Y))

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 07:31:25 PDT 2022


pengfei accepted this revision.
pengfei added a comment.
This revision is now accepted and ready to land.

In D122891#3422384 <https://reviews.llvm.org/D122891#3422384>, @RKSimon wrote:

> In D122891#3422324 <https://reviews.llvm.org/D122891#3422324>, @pengfei wrote:
>
>>> As noticed on PR39174, if we're extracting a single non-constant bit, then try to use BT+SETCC instead to avoid messing around moving the shift amount to the ECX register, using slow x86 shift ops etc.
>>
>> Why using ECX register is a slow shift?
>
> Just that we have to move the shift amount to ECX for the shift ops, which can have side effects on register pressure/allocation.

LGTM. I thought that, but the word slow made me think if there's any other issue I don't know :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122891



More information about the llvm-commits mailing list