[llvm] [InstSimplify] Fold expression using basic properties of floor and ceiling function (PR #107107)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 21:24:32 PDT 2024


================
@@ -0,0 +1,114 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
+
+define i1 @x_floor_ole(float %0) {
+; CHECK-LABEL: @x_floor_ole(
+; CHECK-NEXT:    ret i1 true
+;
+  %2 = call nnan float @llvm.floor.f32(float %0)
----------------
arsenm wrote:

Use named values in tests.

Also test a case where the known-never-nan comes from the source value, not the instruction flag (e.g. nofpclass(nan) on the incoming function argument) 

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


More information about the llvm-commits mailing list