[llvm] [DAGCombiner] Fold setcc of trunc, generalizing some NVPTX isel logic (PR #150270)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 11:20:48 PDT 2025


gulfemsavrun wrote:

We started seeing a segmentation fault in some of the tests, and I bisected to this commit.
https://luci-milo.appspot.com/ui/p/fuchsia/builders/prod/clang-linux-x64/b8707292122810193857/overview

5 tests have failed with a segmentation fault:
```
Clang :: Frontend/dependency-generation-crash.c
Clang :: Frontend/output-paths.c
LLVM :: tools/llvm-cov/missing-binaries.test
LLVM :: tools/llvm-cov/universal-binary.c
LLVM :: tools/llvm-cov/warnings.h
```

Example failure:
```
FAIL: LLVM :: tools/llvm-cov/universal-binary.c (53627 of 60522)
******************** TEST 'LLVM :: tools/llvm-cov/universal-binary.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-profdata merge /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary.proftext -o /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata # RUN: at line 6
+ /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-profdata merge /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary.proftext -o /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata
/b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-cov show /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary -instr-profile /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata -path-equivalence=/tmp,/b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c -arch x86_64 | /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c # RUN: at line 7
+ /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c
+ /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-cov show /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary -instr-profile /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata -path-equivalence=/tmp,/b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c -arch x86_64
/b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-cov report /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary -arch x86_64 -object /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/templateInstantiations.covmapping -arch i386 -instr-profile /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata 2>&1 | /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c --check-prefix=COMBINED # RUN: at line 9
+ /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-cov report /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary -arch x86_64 -object /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/templateInstantiations.covmapping -arch i386 -instr-profile /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata
+ /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c --check-prefix=COMBINED
/b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-cov report /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary -arch x86_64 -object /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/templateInstantiations.covmapping -instr-profile /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata 2>&1 | /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c --check-prefix=COMBINED # RUN: at line 10
+ /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-cov report /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary -arch x86_64 -object /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/templateInstantiations.covmapping -instr-profile /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata
+ /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c --check-prefix=COMBINED
not /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-cov report /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary -arch i386 -object /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/templateInstantiations.covmapping -instr-profile /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata 2>&1 | /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c --check-prefix=WRONG-ARCH # RUN: at line 11
+ not /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/llvm-cov report /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/universal-binary -arch i386 -object /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/Inputs/templateInstantiations.covmapping -instr-profile /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/test/tools/llvm-cov/Output/universal-binary.c.tmp.profdata
+ /b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c --check-prefix=WRONG-ARCH
/b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c:17:16: error: WRONG-ARCH: expected string not found in input
// WRONG-ARCH: failed to load coverage: '{{.*}}universal-binary': `-arch` specifier is invalid or missing for universal binary
               ^
<stdin>:1:1: note: scanning from here
warning: 3186396543 functions have mismatched data
^

Input file: <stdin>
Check file: /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/tools/llvm-cov/universal-binary.c

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          1: warning: 3186396543 functions have mismatched data 
check:17     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
          2: error: Segmentation fault 
check:17     ~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>

--

********************
PASS: LLVM :: tools/llvm-cxxfilt/invalid.test (53628 of 60522)
PASS: LLVM :: tools/llvm-cxxfilt/delimiters.test (53629 of 60522)
FAIL: LLVM :: tools/llvm-cov/warnings.h (53630 of 60522)
******************** TEST 'LLVM :: tools/llvm-cov/warnings.h' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
```

I just wanted to give you heads up in case it rings any bell for you before digging into the root cause.

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


More information about the llvm-commits mailing list