[PATCH] D111571: [X86] `detectAVGPattern()`: support basic case of PAVG chaining (PR52131)
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 11 13:29:44 PDT 2021
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:46758
+ KnownBits Known = DAG->computeKnownBits(V);
+ unsigned MaxActiveBits = Known.getBitWidth() - Known.countMinLeadingZeros();
+ return MaxActiveBits <= ScalarVT.getSizeInBits();
----------------
RKSimon wrote:
> Is it worth adding a KnownBits get/countMaxActiveBits wrapper?
Looking at other uses of countMinLeadingZeros() in X86ISelLowering we often write it more like this
```
return Known.countMinLeadingZeros() >= (Known.getBitWidth() - ScalarVT.getSizeInBits());
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111571/new/
https://reviews.llvm.org/D111571
More information about the llvm-commits
mailing list