Issue 129039
Summary The value range analysis results of Scalar Evolution Analysis seem to be incorrect
Labels
Assignees
Reporter GINN-Imp
    Hello, for the following IR, the value range analysis results of Scalar Evolution Analysis seem to be incorrect.

```llvm
define i1 @f() {
BB:
  %B = sdiv i1 true, true
  ret i1 %B
}

```
Output of `opt -passes="print<scalar-evolution>"`:

```
Printing analysis 'Scalar Evolution Analysis' for function 'f':
Classifying expressions for: @f
  %B = sdiv i1 true, true
  -->  %B U: [0,-1) S: [0,-1)
```
**According to https://llvm.org/doxygen/ConstantRange_8h_source.html, Scalar Evolution Analysis seems to think `%B`'s range is {False}, but in fact it has a value of True.**

testcase: https://godbolt.org/z/eWEM6nPqv

In addition, opt-16 considers it to be full-set:
```
Printing analysis 'Scalar Evolution Analysis' for function 'f':
Classifying expressions for: @f
  %B = sdiv i1 true, true
  -->  %B U: full-set S: full-set
```
bisect to https://github.com/llvm/llvm-project/commit/124547eae
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to