[llvm] [ValueTracking] Propagate non-negativity through fptosi (PR #217868)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 05:28:50 PDT 2026


github-actions[bot] wrote:

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

* 140147 tests passed
* 3723 tests skipped
* 1 test failed

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

### LLVM
<details>
<summary>LLVM.CodeGen/AMDGPU/amdgpu-simplify-libcall-pow.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S -mtriple=amdgpu-amd-amdhsa -passes=amdgpu-simplifylib,instcombine -amdgpu-prelink C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\amdgpu-simplify-libcall-pow.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefixes=CHECK,PRELINK C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\amdgpu-simplify-libcall-pow.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S -mtriple=amdgpu-amd-amdhsa -passes=amdgpu-simplifylib,instcombine -amdgpu-prelink 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\amdgpu-simplify-libcall-pow.ll'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefixes=CHECK,PRELINK 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\amdgpu-simplify-libcall-pow.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\amdgpu-simplify-libcall-pow.ll:5262:17: error: PRELINK-NEXT: expected string not found in input
# | ; PRELINK-NEXT: [[POWNI2F:%.*]] = sitofp nnan ninf afn i32 [[TMP1]] to float
# |                 ^
# | <stdin>:1230:66: note: scanning from here
# |  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs)
# |                                                                  ^
# | <stdin>:1230:66: note: with "TMP1" equal to "%1"
# |  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs)
# |                                                                  ^
# | <stdin>:1230:66: note: pattern attempts to capture variables: "POWNI2F"
# |  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs)
# |                                                                  ^
# | <stdin>:1231:5: note: possible intended match here
# |  %pownI2F = uitofp nneg i32 %1 to float
# |     ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\amdgpu-simplify-libcall-pow.ll:5413:17: error: PRELINK-NEXT: expected string not found in input
# | ; PRELINK-NEXT: [[POWNI2F:%.*]] = sitofp nnan ninf afn i32 [[TMP1]] to float
# |                 ^
# | <stdin>:1258:66: note: scanning from here
# |  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs)
# |                                                                  ^
# | <stdin>:1258:66: note: with "TMP1" equal to "%1"
# |  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs)
# |                                                                  ^
# | <stdin>:1258:66: note: pattern attempts to capture variables: "POWNI2F"
# |  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs)
# |                                                                  ^
# | <stdin>:1259:5: note: possible intended match here
# |  %pownI2F = uitofp nneg i32 %1 to float
# |     ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\amdgpu-simplify-libcall-pow.ll:5592:17: error: PRELINK-NEXT: expected string not found in input
# | ; PRELINK-NEXT: [[POWNI2F:%.*]] = sitofp nnan ninf afn <2 x i32> [[TMP1]] to <2 x float>
# |                 ^
# | <stdin>:1320:80: note: scanning from here
# |  %__log2 = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> %__fabs)
# |                                                                                ^
# | <stdin>:1320:80: note: with "TMP1" equal to "%1"
# |  %__log2 = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> %__fabs)
# |                                                                                ^
# | <stdin>:1320:80: note: pattern attempts to capture variables: "POWNI2F"
# |  %__log2 = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> %__fabs)
# |                                                                                ^
# | <stdin>:1321:5: note: possible intended match here
# |  %pownI2F = uitofp nneg <2 x i32> %1 to <2 x float>
# |     ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\amdgpu-simplify-libcall-pow.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |           1225:  
# |           1226: define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp(float %x, i32 %y) { 
# |           1227:  %y.cast = uitofp i32 %y to float 
# |           1228:  %1 = fptosi float %y.cast to i32 
# |           1229:  %__fabs = call nnan ninf afn float @llvm.fabs.f32(float %x) 
# |           1230:  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs) 
# | next:5262'0                                                                     {   search range start (exclusive)
# | next:5262'1                                                                         error: no match found in search range
# | next:5262'2                                                                         with "TMP1" equal to "%1"
# | next:5262'3                                                                         pattern attempts to capture variables: "POWNI2F"
# |           1231:  %pownI2F = uitofp nneg i32 %1 to float 
# | next:5262'4         ?                                     possible intended match
# |           1232:  %__ylogx = fmul nnan ninf afn float %__log2, %pownI2F 
# |           1233:  %__exp2 = call nnan ninf afn nofpclass(nan ninf nzero nsub nnorm) float @llvm.exp2.f32(float %__ylogx) 
# |           1234:  %__yeven = shl i32 %1, 31 
# |           1235:  %2 = bitcast float %x to i32 
# |           1236:  %__pow_sign = and i32 %__yeven, %2 
# |           1237:  %3 = bitcast i32 %__pow_sign to float 
# |           1238:  %__pow_sign1 = call nnan ninf afn float @llvm.copysign.f32(float %__exp2, float %3) 
# |           1239:  ret float %__pow_sign1 
# |           1240: } 
# |           1241:  
# |           1242: define float @test_pow_afn_nnan_f32_known_integral_uitofp_i256(float %x, i256 %y) { 
# | next:5262'5                                                                   }                       search range end (exclusive)
# |           1243:  %y.cast = uitofp i256 %y to float 
# |           1244:  %pow = tail call nnan afn float @_Z10__pow_fastff(float %x, float %y.cast) 
# |           1245:  ret float %pow 
# |           1246: } 
# |           1247:  
# |              .
# |              .
# |              .
# |           1253:  
# |           1254: define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp_i256(float %x, i256 %y) { 
# |           1255:  %y.cast = uitofp i256 %y to float 
# |           1256:  %1 = fptosi float %y.cast to i32 
# |           1257:  %__fabs = call nnan ninf afn float @llvm.fabs.f32(float %x) 
# |           1258:  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs) 
# | next:5413'0                                                                     {   search range start (exclusive)
# | next:5413'1                                                                         error: no match found in search range
# | next:5413'2                                                                         with "TMP1" equal to "%1"
# | next:5413'3                                                                         pattern attempts to capture variables: "POWNI2F"
# |           1259:  %pownI2F = uitofp nneg i32 %1 to float 
# | next:5413'4         ?                                     possible intended match
# |           1260:  %__ylogx = fmul nnan ninf afn float %__log2, %pownI2F 
# |           1261:  %__exp2 = call nnan ninf afn nofpclass(nan ninf nzero nsub nnorm) float @llvm.exp2.f32(float %__ylogx) 
# |           1262:  %__yeven = shl i32 %1, 31 
# |           1263:  %2 = bitcast float %x to i32 
# |           1264:  %__pow_sign = and i32 %__yeven, %2 
# |           1265:  %3 = bitcast i32 %__pow_sign to float 
# |           1266:  %__pow_sign1 = call nnan ninf afn float @llvm.copysign.f32(float %__exp2, float %3) 
# |           1267:  ret float %__pow_sign1 
# |           1268: } 
# |           1269:  
# |           1270: define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp_i256(float %x, i256 %y) { 
# | next:5413'5                                                                        }                       search range end (exclusive)
# |           1271:  %y.cast = sitofp i256 %y to float 
# |           1272:  %1 = fptosi float %y.cast to i32 
# |           1273:  %__fabs = call nnan ninf afn float @llvm.fabs.f32(float %x) 
# |           1274:  %__log2 = call nnan ninf afn float @llvm.log2.f32(float %__fabs) 
# |           1275:  %pownI2F = sitofp nnan ninf afn i32 %1 to float 
# |              .
# |              .
# |              .
# |           1315:  
# |           1316: define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_uitofp(<2 x float> %x, <2 x i32> %y) { 
# |           1317:  %y.cast = uitofp <2 x i32> %y to <2 x float> 
# |           1318:  %1 = fptosi <2 x float> %y.cast to <2 x i32> 
# |           1319:  %__fabs = call nnan ninf afn <2 x float> @llvm.fabs.v2f32(<2 x float> %x) 
# |           1320:  %__log2 = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> %__fabs) 
# | next:5592'0                                                                                   {   search range start (exclusive)
# | next:5592'1                                                                                       error: no match found in search range
# | next:5592'2                                                                                       with "TMP1" equal to "%1"
# | next:5592'3                                                                                       pattern attempts to capture variables: "POWNI2F"
# |           1321:  %pownI2F = uitofp nneg <2 x i32> %1 to <2 x float> 
# | next:5592'4         ?                                                 possible intended match
# |           1322:  %__ylogx = fmul nnan ninf afn <2 x float> %__log2, %pownI2F 
# |           1323:  %__exp2 = call nnan ninf afn nofpclass(nan ninf nzero nsub nnorm) <2 x float> @llvm.exp2.v2f32(<2 x float> %__ylogx) 
# |           1324:  %__yeven = shl <2 x i32> %1, splat (i32 31) 
# |           1325:  %2 = bitcast <2 x float> %x to <2 x i32> 
# |           1326:  %__pow_sign = and <2 x i32> %__yeven, %2 
# |           1327:  %3 = bitcast <2 x i32> %__pow_sign to <2 x float> 
# |           1328:  %__pow_sign1 = call nnan ninf afn <2 x float> @llvm.copysign.v2f32(<2 x float> %__exp2, <2 x float> %3) 
# |           1329:  ret <2 x float> %__pow_sign1 
# |           1330: } 
# |           1331:  
# |           1332: define float @test_pow_f32_known_positive_x__known_integral_sitofp(float nofpclass(ninf nsub nnorm) %x, i32 %y) { 
# | next:5592'5                                                                       }                                                 search range end (exclusive)
# |           1333:  %y.cast = sitofp i32 %y to float 
# |           1334:  %pow = tail call float @_Z4powrff(float %x, float %y.cast) 
# |           1335:  ret float %pow 
# |           1336: } 
# |           1337:  
# |              .
# |              .
# |              .
# | >>>>>>
# `-----------------------------
# 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/217868


More information about the llvm-commits mailing list