[llvm] ConstantFolding: Do not fold fcmp of denormal without known mode (PR #115407)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 01:26:33 PST 2024


================
@@ -66,15 +66,17 @@ define i1 @fcmp_constexpr_une(float %conv) {
 
 define i1 @fcmp_constexpr_ueq(float %conv) {
 ; CHECK-LABEL: @fcmp_constexpr_ueq(
-; CHECK-NEXT:    ret i1 true
+; CHECK-NEXT:    [[CMP:%.*]] = fcmp ueq float bitcast (i32 ptrtoint (ptr @a to i32) to float), bitcast (i32 ptrtoint (ptr @a to i32) to float)
----------------
nikic wrote:

Shouldn't we still be able to fold this? I think for the purpose of denormal flushing, you probably want to ignore constant expressions rather than bail out for them, so they can still be evaluated symbolically.

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


More information about the llvm-commits mailing list