Issue 55505
Summary [VRP] Some optimization omissions of small constants
Labels new issue
Assignees
Reporter vfdff
    For the two similar case foo1000 and foo1001, gcc do sve for foo1000 , while llvm does none for the both, see https://godbolt.org/z/fcWxs6G3b.

- gcc: improve the float compare **if (i_16 > 1.0e+0)** to int compare in 153t.ivcanon for foo1000, so later, it can do sve.
- llvm: maybe need improve in function isKnownExactCastIntToFP ?
```
int foo1000 (int index){
    int aLength = 1500;
    int a[aLength];

    for(float i = 1000; i > 0; i--){
        a[(int)i] = (int)(i);
    }

    return a[index];
}


int foo1001 (int index){
    int aLength = 1500;
    int a[aLength];

    for(float i = 1001; i > 0; i--){
        a[(int)i] = (int)(i);
    }

    return a[index];
}
```



_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to