[clang] [CIR]Fix failing my_fmaxf test (PR #180956)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 11 07:04:32 PST 2026


================
@@ -1731,16 +1731,15 @@ long double call_copysignl(long double x, long double y) {
 
 float my_fmaxf(float x, float y) {
   return __builtin_fmaxf(x, y);
-  // CHECK: cir.func no_inline dso_local @my_fmaxf
-  // CHECK:   %{{.+}} = cir.fmaxnum %{{.+}}, %{{.+}} : !cir.float
+  // CIR-LABEL: my_fmaxf
+  // CIR: cir.call @fmaxf(%{{.*}}, %{{.*}}) nothrow side_effect(const) {{.*}} : (!cir.float, !cir.float) -> !cir.float
 
-  // LLVM: define dso_local float @my_fmaxf
-  // LLVM:   %{{.+}} = call float @llvm.maxnum.f32(float %{{.+}}, float %{{.+}})
-  // LLVM: }
+  // LLVM-LABEL: @my_fmaxf
+  // LLVM: call float @fmaxf(float %{{.*}}, float %{{.*}})
 
-  // OGCG: define{{.*}}@my_fmaxf(
-  // OGCG: call float @llvm.maxnum.f32(
-}
+  // OGCG-LABEL: @my_fmaxf
+  // OGCG: call float @llvm.maxnum.f32(float %{{.*}}, float %{{.*}})
----------------
erichkeane wrote:

For me, THIS is the only line that fails (presumably the above is just cleanup?):

```
# | /local/home/ekeane/llvm-project/clang/test/CIR/CodeGen/builtin-floating-point.c:1742:11: error: OGCG: expected string not found in input
# |  // OGCG: call float @llvm.maxnum.f32(
```

Best I can tell is the correct matching line is:
```
%2 = call nsz float @llvm.maxnum.f32(float %0, float %1)
```

So I guess I don't see how this fix would work?  Looks like the OGCG (classic codegen) has added some return attributes.

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


More information about the cfe-commits mailing list