- Handle casts a bit more cleanly just with a loop rather than with recursion.
- Add additional cases for smin/smax
- For shifts we can also deduce non-zero if the maximum shift amount on the known 1s is non-zero.
Paths
| Differential D156777
[SelectionDAG] Add/Improve cases in `isKnownNeverZero` ClosedPublic Authored by goldstein.w.n on Aug 1 2023, 12:33 AM.
Details Summary
Diff Detail
Event Timelinegoldstein.w.n added a child revision: D156778: [SelectionDAG] Improve `isKnownToBeAPowerOfTwo`.Aug 1 2023, 12:40 AM arsenm added inline comments. goldstein.w.n added inline comments.
goldstein.w.n marked an inline comment as done. Comment ActionsRemove any_extend, add other casts back to main switch
goldstein.w.n marked an inline comment as done. Comment ActionsFix shift cnt check
This revision is now accepted and ready to land.Aug 5 2023, 9:53 AM This revision was landed with ongoing or failed builds.Aug 15 2023, 11:59 PM Closed by commit rGac485e40720f: [SelectionDAG] Add/Improve cases in `isKnownNeverZero` (authored by goldstein.w.n). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 550635 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/X86/known-never-zero.ll
|
Looking through any_extend seems wrong, the high bits may not be 0 as they're undefined