llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.1k stars 12k forks source link

missed optimization, fptrunc (x) >= C1 => x >= C2 #85265

Open zhengyang92 opened 8 months ago

zhengyang92 commented 8 months ago

https://alive2.llvm.org/ce/z/n53up6 https://godbolt.org/z/q6vrbxTo3

define i1 @src(double %0) {
if.end155:
%1 = fptrunc double %0 to float
%2 = fcmp oge float %1, 1.000000e+02
ret i1 %2
}
define i1 @tgt(double %0) {
if.end155:
%oge = fcmp oge double %0, 0x4058FFFFF0000000
ret i1 %oge
}

Other variants may follow the same patterns.

llvmbot commented 8 months ago

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. In the comments of the issue, request for it to be assigned to you.
  2. Fix the issue locally.
  3. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  4. Create a Git commit.
  5. Run git clang-format HEAD~1 to format your changes.
  6. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

llvmbot commented 8 months ago

@llvm/issue-subscribers-good-first-issue

Author: Zhengyang Liu (zhengyang92)

https://alive2.llvm.org/ce/z/n53up6 https://godbolt.org/z/q6vrbxTo3 ```llvm define i1 @src(double %0) { if.end155: %1 = fptrunc double %0 to float %2 = fcmp oge float %1, 1.000000e+02 ret i1 %2 } define i1 @tgt(double %0) { if.end155: %oge = fcmp oge double %0, 0x4058FFFFF0000000 ret i1 %oge } ``` Other variants may follow the same patterns.
dtcxzyw commented 8 months ago

Could you please provide proofs about FMF propagation for all your recent issues? Thank you :)

miguelraz commented 7 months ago

Hey all, I'd like to claim working on this issue if possible.

dtcxzyw commented 4 months ago

@miguelraz Ping.

kissholic commented 4 months ago

Hey, I'm interested in fixing this issue. Marks here, and please assign this issue to me when it available.