You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix horrifying bug in lossless_cast of a subtract (#8155)
* Fix horrifying bug in lossless_cast of a subtract
* Use constant integer intervals to analyze safety for lossless_cast
TODO:
- Dedup the constant integer code with the same code in the simplifier.
- Move constant interval arithmetic operations out of the class.
- Make the ConstantInterval part of the return type of lossless_cast
(and turn it into an inner helper) so that it isn't constantly
recomputed.
* Fix ARM and HVX instruction selection
Also added more TODOs
* Using constant_integer_bounds to strengthen FindIntrinsics
In particular, we can do better instruction selection for pmulhrsw
* Move new classes to new files
Also fix up Monotonic.cpp
* Make the simplifier use ConstantInterval
* Handle bounds of narrower types in the simplifier too
* Fix * operator. Add min/max/mod
* Add cache for constant bounds queries
* Fix ConstantInterval multiplication
* Add a simplifier rule which is apparently now necessary
* Misc cleanups and test improvements
* Add missing files
* Account for more aggressive simplification in fuse test
* Remove redundant helpers
* Add missing comment
* clear_bounds_info -> clear_expr_info
* Remove bad TODO
I can't think of a single case that could cause this
* It's too late to change the semantics of fixed point intrinsics
* Fix some UB
* Stronger assert in Simplify_Div
* Delete bad rewrite rules
* Fix bad test when lowering mul_shift_right
b_shift + b_shift < missing_q
* Avoid UB in lowering of rounding_shift_right/left
* Add shifts to the lossless cast fuzzer
This required a more careful signed-integer-overflow detection routine
* Fix bug in lossless_negate
* Add constant interval test
* Rework find_mpy_ops to handle more structures
* Fix bugs in lossless_cast
* Fix mul_shift_right expansion
* Delete commented-out code
* Don't introduce out-of-range shifts in lossless_cast
* Some constant folding only happens after lowering intrinsics in codegen
---------
Co-authored-by: Steven Johnson <[email protected]>
0 commit comments