-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
9b703f3
commit cab27d8
Showing
12 changed files
with
514 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.