[PATCH] D151816: [ValueTracking] Directly use KnownBits shift functions
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 31 09:04:13 PDT 2023
nikic created this revision.
nikic added reviewers: foad, goldstein.w.n.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Make ValueTracking directly call the KnownBits shift helpers, which provides more precise results.
Unfortunately, ValueTracking has a special case where sometimes we determine non-zero shift amounts using isKnownNonZero(). I have my doubts about the usefulness of that special-case (it is only tested in a single unit test), but I've reproduced the special-case via an extra parameter to the KnownBits methods.
https://reviews.llvm.org/D151816
Files:
llvm/include/llvm/Support/KnownBits.h
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/Support/KnownBits.cpp
llvm/test/Analysis/ScalarEvolution/extract-highbits-variablemask.ll
llvm/test/Analysis/ScalarEvolution/extract-lowbits-variablemask.ll
llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll
llvm/test/Analysis/ValueTracking/known-power-of-two-urem.ll
llvm/test/Transforms/IndVarSimplify/shift-range-checks.ll
llvm/test/Transforms/InstCombine/zext-or-icmp.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151816.527073.patch
Type: text/x-patch
Size: 16177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230531/687ffe98/attachment.bin>
More information about the llvm-commits
mailing list