llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

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

Open zhengyang92 opened this issue 11 months ago • 4 comments

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.

zhengyang92 avatar Mar 14 '24 16:03 zhengyang92

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 avatar Mar 14 '24 17:03 llvmbot

@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.

llvmbot avatar Mar 14 '24 17:03 llvmbot

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

dtcxzyw avatar Mar 14 '24 17:03 dtcxzyw

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

miguelraz avatar Mar 24 '24 14:03 miguelraz