Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix horrifying bug in lossless_cast of a subtract #8155

Merged
merged 40 commits into from
Jun 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7d80f8b
Fix horrifying bug in lossless_cast of a subtract
abadams Mar 14, 2024
9c33c94
Use constant integer intervals to analyze safety for lossless_cast
abadams Mar 18, 2024
e0f9f8e
Fix ARM and HVX instruction selection
abadams Mar 21, 2024
214f0fd
Using constant_integer_bounds to strengthen FindIntrinsics
abadams Mar 22, 2024
67855a5
Move new classes to new files
abadams Mar 25, 2024
bee38ce
Make the simplifier use ConstantInterval
abadams Mar 25, 2024
7f4bb38
Handle bounds of narrower types in the simplifier too
abadams Mar 25, 2024
6434210
Fix * operator. Add min/max/mod
abadams Mar 28, 2024
f308a8c
Add cache for constant bounds queries
abadams Mar 28, 2024
cffadd8
Fix ConstantInterval multiplication
abadams Apr 1, 2024
2f14881
Add a simplifier rule which is apparently now necessary
abadams Apr 1, 2024
26efb7c
Misc cleanups and test improvements
abadams Apr 1, 2024
b053ec6
Add missing files
abadams Apr 1, 2024
413b4a6
Account for more aggressive simplification in fuse test
abadams Apr 1, 2024
854122f
Remove redundant helpers
abadams Apr 1, 2024
4a293b1
Add missing comment
abadams Apr 1, 2024
0856319
clear_bounds_info -> clear_expr_info
abadams Apr 1, 2024
16a706d
Remove bad TODO
abadams Apr 1, 2024
ecfae44
It's too late to change the semantics of fixed point intrinsics
abadams Apr 1, 2024
66c56f1
Fix some UB
abadams Apr 1, 2024
0fb8d38
Stronger assert in Simplify_Div
abadams Apr 2, 2024
c6065ff
Delete bad rewrite rules
abadams Apr 2, 2024
6bcc66a
Fix bad test when lowering mul_shift_right
abadams Apr 2, 2024
c652667
Avoid UB in lowering of rounding_shift_right/left
abadams Apr 2, 2024
1737a52
Add shifts to the lossless cast fuzzer
abadams Apr 2, 2024
ddab1cf
Fix bug in lossless_negate
abadams Apr 5, 2024
a0f1d23
Add constant interval test
abadams Jun 2, 2024
bf28e00
Merge remote-tracking branch 'origin/main' into abadams/fix_lossless_…
abadams Jun 2, 2024
ac5b13d
Rework find_mpy_ops to handle more structures
abadams Jun 3, 2024
c8f7e8f
Fix bugs in lossless_cast
abadams Jun 3, 2024
9570818
Fix mul_shift_right expansion
abadams Jun 3, 2024
7414ee6
Delete commented-out code
abadams Jun 3, 2024
c33dbfb
Don't introduce out-of-range shifts in lossless_cast
abadams Jun 4, 2024
360add6
Merge branch 'main' into abadams/fix_lossless_cast_of_sub
steven-johnson Jun 5, 2024
0409f2f
Merge remote-tracking branch 'origin/main' into abadams/fix_lossless_…
abadams Jun 6, 2024
0b561c7
Some constant folding only happens after lowering intrinsics in codegen
abadams Jun 10, 2024
adb3a6b
Merge branch 'abadams/fix_lossless_cast_of_sub' of https://github.com…
abadams Jun 10, 2024
e90db04
Merge remote-tracking branch 'origin/main' into abadams/fix_lossless_…
abadams Jun 10, 2024
19b1091
Merge remote-tracking branch 'origin/main' into abadams/fix_lossless_…
abadams Jun 19, 2024
ff352ef
Merge remote-tracking branch 'origin/main' into abadams/fix_lossless_…
abadams Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/IROperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Expr lossless_cast(Type t, Expr e) {
Expr a = lossless_cast(t.narrow(), sub->a);
Expr b = lossless_cast(t.narrow(), sub->b);
if (a.defined() && b.defined()) {
return cast(t, a) + cast(t, b);
return cast(t, a) - cast(t, b);
} else {
return Expr();
}
Expand Down
Loading