We where missing these cases so something like:
(bitcast to i32 (or v216 x, <2, 1>))
would not be found to be non-zero.
Paths
| Differential D149409
[ValueTracking] Handle bitcasts between vec-int-ptr in `isKnownNonZero` ClosedPublic Authored by goldstein.w.n on Apr 27 2023, 11:19 PM.
Details Summary We where missing these cases so something like: would not be found to be non-zero.
Diff Detail
Event Timelinegoldstein.w.n added a parent revision: D149408: [ValueTracking] Add more tests for `isKnownNonZero` cases; NFC.Apr 27 2023, 11:25 PM goldstein.w.n added a child revision: D149410: [ValueTracking] Add logic for `isKnownNonZero(ctlz/cttz X)`. Comment Actions This needs to be much more careful about bitcasts between different lane counts. For your scalar to vector example it's fine, because if each vector element is non-zero then the scalar is also non-zero. The converse, however, is not true. This revision now requires changes to proceed.Apr 28 2023, 1:30 AM Comment Actions
Done. Only do bitcast now if its from smaller scalar type -> larger scalar type. nikic added inline comments. This revision now requires changes to proceed.Apr 29 2023, 10:01 AM This revision is now accepted and ready to land.Apr 29 2023, 11:48 AM goldstein.w.n added inline comments.
Closed by commit rGc7f7f601f2c8: [ValueTracking] Handle bitcasts between vec-int-ptr in `isKnownNonZero` (authored by goldstein.w.n). · Explain WhyApr 30 2023, 8:07 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 518319 llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Analysis/ValueTracking/known-non-zero.ll
|
guranteed -> guaranteed