[PATCH] D97074: Add getDemandedBits for uses.
Qunyan Mangus via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 16 16:03:23 PDT 2021
qunyanm added inline comments.
================
Comment at: llvm/lib/Analysis/DemandedBits.cpp:465
+
+ unsigned BitWidth = T->getScalarSizeInBits();
+
----------------
RKSimon wrote:
> qunyanm wrote:
> > qunyanm wrote:
> > > RKSimon wrote:
> > > > Could this be used in the APInt::getAllOnesValue() above instead of the getTypeSizeInBits call?
> > > Yes. Thanks!
> > Actually it won't work since getScalarSizeInBits() returns 0 for non-primitive types that demandedBits don't track therefore should be marked as all bit used.
> Hmm - what about
> ```
> unsigned BitWidth = DL.getTypeSizeInBits(T->getScalarType());
> ```
Yes, I believe they return the same value for int/intvector.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97074/new/
https://reviews.llvm.org/D97074
More information about the llvm-commits
mailing list