-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Inconsistent results when using --arith-unsigned-when-equivalent --int-range-optimizations #82158
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
Labels
Comments
ubfx
added a commit
to ubfx/llvm-project
that referenced
this issue
May 10, 2024
When an overflow happens during shift left, i.e. the last sign bit or the most significant data bit gets shifted out, the current approach of inferring the range of results does not work anymore. This patch checks for possible overflow and returns the max range in that case. Fix llvm#82158
ubfx
added a commit
that referenced
this issue
May 13, 2024
When an overflow happens during shift left, i.e. the last sign bit or the most significant data bit gets shifted out, the current approach of inferring the range of results does not work anymore. This patch checks for possible overflow and returns the max range in that case. Fix #82158
@llvm/issue-subscribers-mlir Author: None (wangyongj1a)
I have the following MLIR program:
test.mlir:
```
module {
func.func @func1() {
%c8_i32 = arith.constant 8 : i32
%c29326_i32 = arith.constant 29326 : i32
%c2_i32 = arith.constant 2 : i32
%c1_i32 = arith.constant 1 : i32
}
module {
module {
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following MLIR program:
test.mlir:
However, when I ran
mlir-opt --arith-expand --arith-unsigned-when-equivalent --int-range-optimizations test.mlir
on the program, I got the following result:And when I ran
mlir-opt --arith-expand --int-range-optimizations test.mlir
on the program, I got the following result:I've tried to analyze my program manually, and my result is that the value of the constant operation seems to be 2, which is different from either of the above results. I'm not sure if there is any bug in my program or some other problems that caused these results.
My git version is 1a8c613.
The text was updated successfully, but these errors were encountered: