Conversation
|
cc @merrymercy @yzhliu @kazum @ZihengJiang can you please help to take a look? |
|
cc @hzfan please update per review comments |
|
@junrushao1994 I just fixed the macro thing and CI's green. Please take another look. |
|
It looks good on my side. @yzhliu would you mind taking a look? Thanks! |
tqchen
left a comment
There was a problem hiding this comment.
Some more comments to improve readability after carefully read the PR.
| } | ||
| } | ||
|
|
||
| bool CheckCastImpl(DataType dtype, PrimExpr value, Analyzer* analyzer) { |
There was a problem hiding this comment.
I guess CastIsSafe seems better, since it checks both upcast and downcast
|
Thanks @hzfan for keep polishing the code :) Arith analysis is quite core to most of our transformations so it is important to make sure code is clean and readable I have carefully read the PR and add a few more comments to improve readability. @junrushao1994 @yzhliu It would be great to also have you take another look as well. |
|
Thanks @hzfan @junrushao1994 ! This is now merged |
Follow up of #6691
Simplify
cast(i32, c * 2 + 1) + 1 - cast(i32, c * 2)to2by first transforming tocast(i32, c * 2) + cast(i32, 1) + 1 - cast(i32, c * 2)