[llvm] Optimize fptrunc(x)>=C1 --> x>=C2 (PR #99475)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 04:59:49 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
+}
----------------
dtcxzyw wrote:

Missing newline.


https://github.com/llvm/llvm-project/pull/99475


More information about the llvm-commits mailing list