https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114403
Bug ID: 114403 Summary: [14 regression] Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: sjames at gcc dot gnu.org Target Milestone: --- Created attachment 57743 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57743&action=edit build-llvm.sh I get the following test failures for LLVM 17.0.6: ``` ******************** Failed Tests (17): LLVM :: CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll LLVM :: CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.d.ll LLVM :: CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.g16.a16.ll LLVM :: CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.g16.ll LLVM :: CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.image.sample.cd.g16.ll LLVM :: CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.image.sample.g16.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.nsa.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.a16.dim.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.cd.a16.dim.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.cd.g16.encode.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.cd.g16.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.dim.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.g16.a16.dim.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.g16.encode.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.g16.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.image.sample.o.dim.ll LLVM :: CodeGen/NVPTX/wmma.py ``` I can reproduce it with -O3 -march=znver -fno-vect-cost-model. It also then shows up if Clang is used to build Firefox. I will do the usual narrowing down but my success rate for producing test cases from LLVM is poor ;) Picking the first one: ``` FAIL: LLVM :: CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll (5582 of 50819) ******************** TEST 'LLVM :: CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll' FAILED ******************** Script: -- : 'RUN: at line 2'; /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -stop-after=legalizer -o - /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll | /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/FileCheck -check-prefix=GFX9 /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll : 'RUN: at line 3'; /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 -stop-after=legalizer -o - /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll | /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/FileCheck -check-prefix=GFX10 /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll : 'RUN: at line 4'; /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 -stop-after=legalizer -o - /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll | /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/FileCheck -check-prefix=GFX11 /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll -- Exit Code: 2 Command Output (stderr): -- + : 'RUN: at line 2' + /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -stop-after=legalizer -o - /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll + /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/FileCheck -check-prefix=GFX9 /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump: 0. Program arguments: /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -stop-after=legalizer -o - /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll 1. Running pass 'Function Pass Manager' on module '/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll'. 2. Running pass 'Early CSE' on function '@sample_d_3d' #0 0x00007f3bd08e5fbf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/../lib64/libLLVM-17.so+0xee5fbf) #1 0x00007f3bd08e315b SignalHandler(int) Signals.cpp:0:0 #2 0x00007f3bcf46ac10 (/usr/lib64/libc.so.6+0x3bc10) #3 0x00007f3bd0a6c5a6 llvm::Instruction::isIdenticalTo(llvm::Instruction const*) const (/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/../lib64/libLLVM-17.so+0x106c5a6) #4 0x00007f3bd1ed8073 bool llvm::DenseMapBase<llvm::DenseMap<(anonymous namespace)::CallValue, llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::pair<llvm::Instruction*, unsigned int>>*, llvm::DenseMapInfo<(anonymous namespace)::CallValue, void>, llvm::detail::DenseMapPair<(anonymous namespace)::CallValue, llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::pair<llvm::Instruction*, unsigned int>>*>>, (anonymous namespace)::CallValue, llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::pair<llvm::Instruction*, unsigned int>>*, llvm::DenseMapInfo<(anonymous namespace)::CallValue, void>, llvm::detail::DenseMapPair<(anonymous namespace)::CallValue, llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::pair<llvm::Instruction*, unsigned int>>*>>::LookupBucketFor<(anonymous namespace)::CallValue>((anonymous namespace)::CallValue const&, llvm::detail::DenseMapPair<(anonymous namespace)::CallValue, llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::pair<llvm::Instruction*, unsigned int>>*> const*&) const EarlyCSE.cpp:0:0 #5 0x00007f3bd1eddbe7 (anonymous namespace)::EarlyCSE::run() EarlyCSE.cpp:0:0 #6 0x00007f3bd1ee0da2 (anonymous namespace)::EarlyCSELegacyCommonPass<false>::runOnFunction(llvm::Function&) EarlyCSE.cpp:0:0 #7 0x00007f3bd0aac88e llvm::FPPassManager::runOnFunction(llvm::Function&) (/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/../lib64/libLLVM-17.so+0x10ac88e) #8 0x00007f3bd0aacd9c llvm::FPPassManager::runOnModule(llvm::Module&) (/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/../lib64/libLLVM-17.so+0x10acd9c) #9 0x00007f3bd0aad478 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/../lib64/libLLVM-17.so+0x10ad478) #10 0x000055ce81b49356 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0 #11 0x000055ce81b3ead3 main (/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/llc+0x11ad3) #12 0x00007f3bcf454e58 (/usr/lib64/libc.so.6+0x25e58) #13 0x00007f3bcf454f15 __libc_start_main (/usr/lib64/libc.so.6+0x25f15) #14 0x000055ce81b3efb1 _start (/var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/llc+0x11fb1) FileCheck error: '<stdin>' is empty. FileCheck command line: /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm_build-abi_x86_64.amd64/bin/FileCheck -check-prefix=GFX9 /var/tmp/portage/sys-devel/llvm-17.0.6/work/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll ``` Simpler reproducer is then: ~/git/llvm-project $ ~/data/build/llvm-project-test/bin/llvm-lit ./llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll -v. And then: `/build/llvm-project-test/bin/llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -stop-after=legalizer -o - /home/sam/git/llvm-project/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll`.