public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/114403] New: [14 regression]
@ 2024-03-20 10:44 sjames at gcc dot gnu.org
  2024-03-20 10:44 ` [Bug tree-optimization/114403] [14 regression] LLVM miscompiled with -O3 -march=znver2 -fno-vect-cost-model sjames at gcc dot gnu.org
                   ` (31 more replies)
  0 siblings, 32 replies; 33+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-03-20 10:44 UTC (permalink / raw)
  To: gcc-bugs

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`.

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2024-04-16 19:56 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-20 10:44 [Bug tree-optimization/114403] New: [14 regression] sjames at gcc dot gnu.org
2024-03-20 10:44 ` [Bug tree-optimization/114403] [14 regression] LLVM miscompiled with -O3 -march=znver2 -fno-vect-cost-model sjames at gcc dot gnu.org
2024-03-20 10:53 ` sjames at gcc dot gnu.org
2024-03-20 11:49 ` rguenth at gcc dot gnu.org
2024-03-20 17:23 ` [Bug tree-optimization/114403] [14 regression] LLVM miscompiled with -O3 -march=znver2 -fno-vect-cost-model since r14-6822-g01f4251b8775c8 sjames at gcc dot gnu.org
2024-03-20 21:27 ` sjames at gcc dot gnu.org
2024-03-21  3:23 ` sjames at gcc dot gnu.org
2024-03-22  9:47 ` sjames at gcc dot gnu.org
2024-03-22  9:50 ` sjames at gcc dot gnu.org
2024-03-22 10:56 ` sjames at gcc dot gnu.org
2024-03-22 11:26 ` rguenth at gcc dot gnu.org
2024-03-22 12:36 ` law at gcc dot gnu.org
2024-03-22 13:12 ` sjames at gcc dot gnu.org
2024-03-22 13:13 ` sjames at gcc dot gnu.org
2024-03-22 13:13 ` sjames at gcc dot gnu.org
2024-03-22 13:27 ` sjames at gcc dot gnu.org
2024-03-22 13:50 ` rguenth at gcc dot gnu.org
2024-03-22 13:52 ` rguenth at gcc dot gnu.org
2024-03-22 14:27 ` sjames at gcc dot gnu.org
2024-03-22 14:37 ` sjames at gcc dot gnu.org
2024-03-26 10:09 ` rguenth at gcc dot gnu.org
2024-04-02 13:26 ` tnfchris at gcc dot gnu.org
2024-04-02 16:41 ` tnfchris at gcc dot gnu.org
2024-04-11 21:40 ` tnfchris at gcc dot gnu.org
2024-04-11 21:52 ` tnfchris at gcc dot gnu.org
2024-04-12 10:12 ` rguenth at gcc dot gnu.org
2024-04-12 10:15 ` tnfchris at gcc dot gnu.org
2024-04-12 10:37 ` rguenth at gcc dot gnu.org
2024-04-12 10:40 ` tnfchris at gcc dot gnu.org
2024-04-12 11:27 ` rguenth at gcc dot gnu.org
2024-04-15 11:07 ` cvs-commit at gcc dot gnu.org
2024-04-15 11:08 ` tnfchris at gcc dot gnu.org
2024-04-16 19:56 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).