[llvm] Optimize fptrunc(x)>=C1 --> x>=C2 (PR #99475)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 23:12:16 PDT 2024
================
@@ -0,0 +1,11 @@
+; RUN: opt -passes=instcombine -S < %s | FileCheck %s
+
+
+;CHECK-LABEL: @src(
+;CHECK: %result = fcmp oge double %0, 1.000000e+02
+;CHECK-NEXT: ret i1 %result
+define i1 @src(double %0) {
+ %trunc = fptrunc double %0 to float
+ %result = fcmp oge float %trunc, 1.000000e+02
+ ret i1 %result
+}
----------------
kissholic wrote:
> A test of `fp128`, `x86_fp80`, or `ppc_fp128` in particular would be helpful.
Sorry for late.
I tried to test these types, but an error is generated whose message is "floating point constant does not have type 'fp128'".
The error is emitted in the parse stage, and more modifications might be required to be conducted.
Should i ignore this problem, or if there are better solutions?
https://github.com/llvm/llvm-project/pull/99475
More information about the llvm-commits
mailing list