[clang] [llvm] [IR] Add fast-math support to {u,s}itofp (PR #198470)
via cfe-commits
cfe-commits at lists.llvm.org
Tue May 19 23:53:58 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results
* 134912 tests passed
* 3298 tests skipped
* 2 tests failed
## Failed Tests
(click on a test name to see its output)
### MLIR
<details>
<summary>MLIR.Target/LLVMIR/nneg.mlir</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\mlir-translate.exe -mlir-to-llvmir C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\nneg.mlir | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\nneg.mlir
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\mlir-translate.exe' -mlir-to-llvmir 'C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\nneg.mlir'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\nneg.mlir'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\nneg.mlir:7:12: error: CHECK: expected string not found in input
# | // CHECK: %{{.*}} = uitofp nneg i32 %{{.*}} to float
# | ^
# | <stdin>:5:30: note: scanning from here
# | %2 = zext nneg i32 %0 to i64
# | ^
# | <stdin>:6:2: note: possible intended match here
# | %3 = uitofp i32 %0 to float
# | ^
# |
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\nneg.mlir
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | 1: ; ModuleID = 'LLVMDialectModule'
# | 2: source_filename = "LLVMDialectModule"
# | 3:
# | 4: define void @nnegflag_func(i32 %0) {
# | 5: %2 = zext nneg i32 %0 to i64
# | check:7'0 X error: no match found
# | 6: %3 = uitofp i32 %0 to float
# | check:7'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:7'1 ? possible intended match
# | 7: ret void
# | check:7'0 ~~~~~~~~~~
# | 8: }
# | check:7'0 ~~
# | 9:
# | check:7'0 ~
# | 10: !llvm.module.flags = !{!0}
# | check:7'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 11:
# | check:7'0 ~
# | 12: !0 = !{i32 2, !"Debug Info Version", i32 3}
# | check:7'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
### Clang
<details>
<summary>Clang.CodeGenHLSL/Operators/logical-not.hlsl</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple dxil-pc-shadermodel6.6-library -disable-llvm-passes -emit-llvm -finclude-default-header -fnative-half-type -fnative-int16-type -o - C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple dxil-pc-shadermodel6.6-library -disable-llvm-passes -emit-llvm -finclude-default-header -fnative-half-type -fnative-int16-type -o - 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl:24:13: warning: implicit conversion turns floating-point number into integer: 'float16_t' (aka 'half') to 'bool' [-Wfloat-conversion]
# | 24 | return !b;
# | | ~^
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl:32:13: warning: implicit conversion turns floating-point number into integer: 'float4' (aka 'vector<float, 4>') to 'vector<bool, 4>' (vector of 4 'bool' values) [-Wfloat-conversion]
# | 32 | return !b;
# | | ~^
# | 2 warnings generated.
# `-----------------------------
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl:22:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: {{.*}} = uitofp reassoc nnan ninf nsz arcp i1 [[BoolCmp]] to half
# | ^
# | <stdin>:37:30: note: scanning from here
# | %lnot = xor i1 %tobool, true
# | ^
# | <stdin>:37:30: note: with "BoolCmp" equal to "%lnot"
# | %lnot = xor i1 %tobool, true
# | ^
# | <stdin>:38:4: note: possible intended match here
# | %conv = uitofp reassoc nnan ninf nsz arcp afn i1 %lnot to half
# | ^
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl:30:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: {{.*}} = uitofp reassoc nnan ninf nsz arcp <4 x i1> [[BoolCmp]] to <4 x float>
# | ^
# | <stdin>:49:50: note: scanning from here
# | %cmp = icmp eq <4 x i1> %tobool, zeroinitializer
# | ^
# | <stdin>:49:50: note: with "BoolCmp" equal to "%cmp"
# | %cmp = icmp eq <4 x i1> %tobool, zeroinitializer
# | ^
# | <stdin>:50:8: note: possible intended match here
# | %conv = uitofp reassoc nnan ninf nsz arcp afn <4 x i1> %cmp to <4 x float>
# | ^
# |
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\Operators\logical-not.hlsl
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 32: entry:
# | 33: %b.addr = alloca half, align 2
# | 34: store half %b, ptr %b.addr, align 2
# | 35: %0 = load half, ptr %b.addr, align 2
# | 36: %tobool = fcmp reassoc nnan ninf nsz arcp afn une half %0, 0.000000e+00
# | 37: %lnot = xor i1 %tobool, true
# | next:22'0 X error: no match found
# | next:22'1 with "BoolCmp" equal to "%lnot"
# | 38: %conv = uitofp reassoc nnan ninf nsz arcp afn i1 %lnot to half
# | next:22'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:22'2 ? possible intended match
# | 39: ret half %conv
# | next:22'0 ~~~~~~~~~~~~~~~~
# | 40: }
# | next:22'0 ~~
# | 41:
# | next:22'0 ~
# | 42: ; Function Attrs: alwaysinline convergent mustprogress norecurse nounwind
# | next:22'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 43: define noundef nofpclass(nan inf) <4 x float> @_Z5case4Dv4_f(<4 x float> noundef nofpclass(nan inf) %b) #0 {
# | next:22'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 44: entry:
# | 45: %b.addr = alloca <4 x float>, align 4
# | 46: store <4 x float> %b, ptr %b.addr, align 4
# | 47: %0 = load <4 x float>, ptr %b.addr, align 4
# | 48: %tobool = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> %0, zeroinitializer
# | 49: %cmp = icmp eq <4 x i1> %tobool, zeroinitializer
# | next:30'0 X error: no match found
# | next:30'1 with "BoolCmp" equal to "%cmp"
# | 50: %conv = uitofp reassoc nnan ninf nsz arcp afn <4 x i1> %cmp to <4 x float>
# | next:30'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:30'2 ? possible intended match
# | 51: ret <4 x float> %conv
# | next:30'0 ~~~~~~~~~~~~~~~~~~~~~~~
# | 52: }
# | next:30'0 ~~
# | 53:
# | next:30'0 ~
# | 54: attributes #0 = { alwaysinline convergent mustprogress norecurse nounwind "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
# | next:30'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 55:
# | next:30'0 ~
# | .
# | .
# | .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/198470
More information about the cfe-commits
mailing list