[Mlir-commits] [mlir] [mlir][complex] Preserve infinite magnitude in computeAbs on NaN + Inf*i (PR #236265)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 28 02:28:45 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 4380 tests passed
* 467 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### MLIR
<details>
<summary>MLIR.Conversion/ComplexToStandard/convert-to-standard.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\mlir-opt.exe C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir --convert-complex-to-standard --split-input-file | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\mlir-opt.exe' 'C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir' --convert-complex-to-standard --split-input-file
# 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\Conversion\ComplexToStandard\convert-to-standard.mlir'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir:321:11: error: CHECK: expected string not found in input
# | // CHECK: %[[RESULT_REAL:.*]] = math.log %[[ABS]] : f32
# |           ^
# | <stdin>:511:39: note: scanning from here
# |  %12 = arith.select %11, %5, %10 : f32
# |                                       ^
# | <stdin>:511:39: note: with "ABS" equal to "12"
# |  %12 = arith.select %11, %5, %10 : f32
# |                                       ^
# | <stdin>:511:39: note: pattern attempts to capture variables: "RESULT_REAL"
# |  %12 = arith.select %11, %5, %10 : f32
# |                                       ^
# | <stdin>:517:2: note: possible intended match here
# |  %17 = math.log %16 : f32
# |  ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir:467:11: error: CHECK: expected string not found in input
# | // CHECK: %[[REAL_SIGN:.*]] = arith.divf %[[REAL]], %[[ABS]] : f32
# |           ^
# | <stdin>:641:40: note: scanning from here
# |  %17 = arith.select %16, %10, %15 : f32
# |                                        ^
# | <stdin>:641:40: note: with "REAL" equal to "0"
# |  %17 = arith.select %16, %10, %15 : f32
# |                                        ^
# | <stdin>:641:40: note: with "ABS" equal to "17"
# |  %17 = arith.select %16, %10, %15 : f32
# |                                        ^
# | <stdin>:641:40: note: pattern attempts to capture variables: "REAL_SIGN"
# |  %17 = arith.select %16, %10, %15 : f32
# |                                        ^
# | <stdin>:647:2: note: possible intended match here
# |  %22 = arith.divf %0, %21 : f32
# |  ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir:621:11: error: CHECK: expected string not found in input
# | // CHECK: %[[RESULT_RE:.*]] = arith.mulf %[[SQRT_ABS]], %[[COS]] : f32
# |           ^
# | <stdin>:791:39: note: scanning from here
# |  %22 = arith.cmpf oeq, %21, %cst : f32
# |                                       ^
# | <stdin>:791:39: note: with "SQRT_ABS" equal to "13"
# |  %22 = arith.cmpf oeq, %21, %cst : f32
# |                                       ^
# | <stdin>:791:39: note: with "COS" equal to "20"
# |  %22 = arith.cmpf oeq, %21, %cst : f32
# |                                       ^
# | <stdin>:791:39: note: pattern attempts to capture variables: "RESULT_RE"
# |  %22 = arith.cmpf oeq, %21, %cst : f32
# |                                       ^
# | <stdin>:792:2: note: possible intended match here
# |  %23 = arith.mulf %17, %20 : f32
# |  ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir:935:11: error: CHECK: expected string not found in input
# | // CHECK: %[[RESULT_REAL:.*]] = math.log %[[ABS]] fastmath<nnan,contract> : f32
# |           ^
# | <stdin>:1419:39: note: scanning from here
# |  %12 = arith.select %11, %5, %10 : f32
# |                                       ^
# | <stdin>:1419:39: note: with "ABS" equal to "12"
# |  %12 = arith.select %11, %5, %10 : f32
# |                                       ^
# | <stdin>:1419:39: note: pattern attempts to capture variables: "RESULT_REAL"
# |  %12 = arith.select %11, %5, %10 : f32
# |                                       ^
# | <stdin>:1425:2: note: possible intended match here
# |  %17 = math.log %16 fastmath<nnan,contract> : f32
# |  ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir:1054:11: error: CHECK: expected string not found in input
# | // CHECK: %[[RESULT_RE:.*]] = arith.mulf %[[SQRT_ABS]], %[[COS]] fastmath<nnan,contract> : f32
# |           ^
# | <stdin>:1537:63: note: scanning from here
# |  %49 = arith.cmpf oeq, %48, %cst fastmath<nnan,contract> : f32
# |                                                               ^
# | <stdin>:1537:63: note: with "SQRT_ABS" equal to "40"
# |  %49 = arith.cmpf oeq, %48, %cst fastmath<nnan,contract> : f32
# |                                                               ^
# | <stdin>:1537:63: note: with "COS" equal to "47"
# |  %49 = arith.cmpf oeq, %48, %cst fastmath<nnan,contract> : f32
# |                                                               ^
# | <stdin>:1537:63: note: pattern attempts to capture variables: "RESULT_RE"
# |  %49 = arith.cmpf oeq, %48, %cst fastmath<nnan,contract> : f32
# |                                                               ^
# | <stdin>:1538:2: note: possible intended match here
# |  %50 = arith.mulf %44, %47 fastmath<nnan,contract> : f32
# |  ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir:1366:11: error: CHECK: expected string not found in input
# | // CHECK: %[[RESULT_RE:.*]] = arith.mulf %[[SQRT_ABS]], %[[COS]] fastmath<nnan,contract> : f32
# |           ^
# | <stdin>:1843:63: note: scanning from here
# |  %22 = arith.cmpf oeq, %21, %cst fastmath<nnan,contract> : f32
# |                                                               ^
# | <stdin>:1843:63: note: with "SQRT_ABS" equal to "13"
# |  %22 = arith.cmpf oeq, %21, %cst fastmath<nnan,contract> : f32
# |                                                               ^
# | <stdin>:1843:63: note: with "COS" equal to "20"
# |  %22 = arith.cmpf oeq, %21, %cst fastmath<nnan,contract> : f32
# |                                                               ^
# | <stdin>:1843:63: note: pattern attempts to capture variables: "RESULT_RE"
# |  %22 = arith.cmpf oeq, %21, %cst fastmath<nnan,contract> : f32
# |                                                               ^
# | <stdin>:1844:2: note: possible intended match here
# |  %23 = arith.mulf %17, %20 fastmath<nnan,contract> : f32
# |  ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir:1467:11: error: CHECK: expected string not found in input
# | // CHECK: %[[REAL_SIGN:.*]] = arith.divf %[[REAL]], %[[ABS]] fastmath<nnan,contract> : f32
# |           ^
# | <stdin>:1934:40: note: scanning from here
# |  %17 = arith.select %16, %10, %15 : f32
# |                                        ^
# | <stdin>:1934:40: note: with "REAL" equal to "0"
# |  %17 = arith.select %16, %10, %15 : f32
# |                                        ^
# | <stdin>:1934:40: note: with "ABS" equal to "17"
# |  %17 = arith.select %16, %10, %15 : f32
# |                                        ^
# | <stdin>:1934:40: note: pattern attempts to capture variables: "REAL_SIGN"
# |  %17 = arith.select %16, %10, %15 : f32
# |                                        ^
# | <stdin>:1940:2: note: possible intended match here
# |  %22 = arith.divf %0, %21 fastmath<nnan,contract> : f32
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\convert-to-standard.mlir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |               .
# |               .
# |               .
# |             506:  %7 = arith.mulf %6, %6 : f32 
# |             507:  %8 = arith.addf %7, %cst : f32 
# |             508:  %9 = math.sqrt %8 : f32 
# |             509:  %10 = arith.mulf %4, %9 : f32 
# |             510:  %11 = arith.cmpf uno, %10, %10 : f32 
# |             511:  %12 = arith.select %11, %5, %10 : f32 
# | check:321'0                                           {   search range start (exclusive)
# | check:321'1                                               error: no match found in search range
# | check:321'2                                               with "ABS" equal to "12"
# | check:321'3                                               pattern attempts to capture variables: "RESULT_REAL"
# |             512:  %cst_0 = arith.constant 0x7F800000 : f32 
# |             513:  %13 = arith.cmpf oeq, %2, %cst_0 : f32 
# |             514:  %14 = arith.cmpf oeq, %3, %cst_0 : f32 
# |             515:  %15 = arith.ori %13, %14 : i1 
# |             516:  %16 = arith.select %15, %cst_0, %12 : f32 
# |             517:  %17 = math.log %16 : f32 
# | check:321'4       ?                          possible intended match
# |             518:  %18 = complex.re %arg0 : complex<f32> 
# |             519:  %19 = complex.im %arg0 : complex<f32> 
# |             520:  %20 = math.atan2 %19, %18 : f32 
# |             521:  %21 = complex.create %17, %20 : complex<f32> 
# |             522:  return %21 : complex<f32> 
# |             523:  } 
# |             524: } 
# |             525:  
# |             526: // ----- 
# |             527: module { 
# |             528:  func.func @complex_log1p(%arg0: complex<f32>) -> complex<f32> { 
# | check:321'5                               }                                         search range end (exclusive)
# |             529:  %0 = complex.re %arg0 : complex<f32> 
# |             530:  %1 = complex.im %arg0 : complex<f32> 
# |             531:  %cst = arith.constant 5.000000e-01 : f32 
# |             532:  %cst_0 = arith.constant 1.000000e+00 : f32 
# |             533:  %2 = arith.addf %0, %cst_0 : f32 
# |               .
# |               .
# |               .
# |             636:  %12 = arith.mulf %11, %11 : f32 
# |             637:  %13 = arith.addf %12, %cst_0 : f32 
# |             638:  %14 = math.sqrt %13 : f32 
# |             639:  %15 = arith.mulf %9, %14 : f32 
# |             640:  %16 = arith.cmpf uno, %15, %15 : f32 
# |             641:  %17 = arith.select %16, %10, %15 : f32 
# | check:467'0                                            {   search range start (exclusive)
# | check:467'1                                                error: no match found in search range
# | check:467'2                                                with "REAL" equal to "0"
# | check:467'3                                                with "ABS" equal to "17"
# | check:467'4                                                pattern attempts to capture variables: "REAL_SIGN"
# |             642:  %cst_1 = arith.constant 0x7F800000 : f32 
# |             643:  %18 = arith.cmpf oeq, %7, %cst_1 : f32 
# |             644:  %19 = arith.cmpf oeq, %8, %cst_1 : f32 
# |             645:  %20 = arith.ori %18, %19 : i1 
# |             646:  %21 = arith.select %20, %cst_1, %17 : f32 
# |             647:  %22 = arith.divf %0, %21 : f32 
# | check:467'5       ?                                possible intended match
# |             648:  %23 = arith.divf %1, %21 : f32 
# |             649:  %24 = complex.create %22, %23 : complex<f32> 
# |             650:  %25 = arith.select %4, %arg0, %24 : complex<f32> 
# |             651:  return %25 : complex<f32> 
# |             652:  } 
# |             653: } 
# |             654:  
# |             655: // ----- 
# |             656: module { 
# |             657:  func.func @complex_sub(%arg0: complex<f32>, %arg1: complex<f32>) -> complex<f32> { 
# | check:467'6                             }                                             
# | ...
# `---data was truncated (10240/21562) (change limit with -D output_limit=N)
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>MLIR.Conversion/ComplexToStandard/full-conversion.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\mlir-opt.exe C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\full-conversion.mlir -pass-pipeline="builtin.module(func.func(convert-complex-to-standard),convert-complex-to-llvm,func.func(convert-math-to-llvm,convert-arith-to-llvm),convert-func-to-llvm,reconcile-unrealized-casts)" | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\full-conversion.mlir
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\mlir-opt.exe' 'C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\full-conversion.mlir' '-pass-pipeline=builtin.module(func.func(convert-complex-to-standard),convert-complex-to-llvm,func.func(convert-math-to-llvm,convert-arith-to-llvm),convert-func-to-llvm,reconcile-unrealized-casts)'
# 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\Conversion\ComplexToStandard\full-conversion.mlir'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\full-conversion.mlir:24:11: error: CHECK: expected string not found in input
# | // CHECK: llvm.return %[[RET]] : f32
# |           ^
# | <stdin>:16:42: note: scanning from here
# |  %13 = llvm.select %12, %6, %11 : i1, f32
# |                                          ^
# | <stdin>:16:42: note: with "RET" equal to "13"
# |  %13 = llvm.select %12, %6, %11 : i1, f32
# |                                          ^
# | <stdin>:22:2: note: possible intended match here
# |  llvm.return %18 : f32
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\mlir\test\Conversion\ComplexToStandard\full-conversion.mlir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            11:  %8 = llvm.fmul %7, %7 : f32 
# |            12:  %9 = llvm.fadd %8, %2 : f32 
# |            13:  %10 = llvm.intr.sqrt(%9) : (f32) -> f32 
# |            14:  %11 = llvm.fmul %5, %10 : f32 
# |            15:  %12 = llvm.fcmp "uno" %11, %11 : f32 
# |            16:  %13 = llvm.select %12, %6, %11 : i1, f32 
# | check:24'0                                             {   search range start (exclusive)
# | check:24'1                                                 error: no match found in search range
# | check:24'2                                                 with "RET" equal to "13"
# |            17:  %14 = llvm.mlir.constant(0x7F800000 : f32) : f32 
# |            18:  %15 = llvm.fcmp "oeq" %3, %14 : f32 
# |            19:  %16 = llvm.fcmp "oeq" %4, %14 : f32 
# |            20:  %17 = llvm.or %15, %16 : i1 
# |            21:  %18 = llvm.select %17, %14, %13 : i1, f32 
# |            22:  llvm.return %18 : f32 
# | check:24'3      ?                       possible intended match
# |            23:  } 
# |            24:  llvm.func @complex_eq(%arg0: !llvm.struct<(f32, f32)>, %arg1: !llvm.struct<(f32, f32)>) -> i1 { 
# | check:24'4                           }                                                                            search range end (exclusive)
# |            25:  %0 = llvm.extractvalue %arg0[0] : !llvm.struct<(f32, f32)>  
# |            26:  %1 = llvm.extractvalue %arg0[1] : !llvm.struct<(f32, f32)>  
# |            27:  %2 = llvm.extractvalue %arg1[0] : !llvm.struct<(f32, f32)>  
# |            28:  %3 = llvm.extractvalue %arg1[1] : !llvm.struct<(f32, f32)>  
# |            29:  %4 = llvm.fcmp "oeq" %0, %2 : f32 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# 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/236265


More information about the Mlir-commits mailing list