<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [SVE] incorrect code is generated from -O2"
href="https://bugs.llvm.org/show_bug.cgi?id=49217">49217</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[SVE] incorrect code is generated from -O2
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>gilles@rist.or.jp
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>GROMACS 2021 is not working any more with the latest main branch on SVE
architectures.
git bisect pointed to commit 42635856ed3c9a05957640f9deb50cf865c03825
<a href="https://reviews.llvm.org/rG42635856ed3c9a05957640f9deb50cf865c03825">https://reviews.llvm.org/rG42635856ed3c9a05957640f9deb50cf865c03825</a>
and reverting this commit (with de3a485d9c391c44e2c90f79bbf8ac13d49d9fb6 for an
unrelated reason) fixed the issue.
I build LLVM with
cmake -DLLVM_ENABLE_PROJECTS='clang;libcxx;libcxxabi;libunwind;ldd;openmp'
-DCMAKE_BUILD_TYPE=Release ...
and then downloaded GROMACS from
<a href="https://ftp.gromacs.org/gromacs/gromacs-2021.tar.gz">https://ftp.gromacs.org/gromacs/gromacs-2021.tar.gz</a>
and ran on A64fx
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DGMX_OPENMP=off -DGMX_MPI=off
-DGMX_DOUBLE=$double -DGMX_FFT_LIBRARY=fftpack ...
make
./bin/gmx nonbonded-benchmark -nt 1 -iter 1 -warmup 1 -time -all
The issue occurs with 128, 256 and 512bits SVE vector length.
The issue does not occur if configured with -DCMAKE_BUILD_TYPE=Debug
If GROMACS is built on a non SVE system, the extra parameters must be passed to
cmake
-DGMX_SIMD=ARM_SVE -DGMX_SIMD_ARM_SVE_LENGTH=512
(feel free to replace 512 with 128 or 256, and run with the same vector length,
since GROMACS is not VLA)
Here is the stack trace
$ gdb bin/gmx
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<<a href="http://www.gnu.org/software/gdb/bugs/">http://www.gnu.org/software/gdb/bugs/</a>>.
Find the GDB manual and other documentation resources online at:
<<a href="http://www.gnu.org/software/gdb/documentation/">http://www.gnu.org/software/gdb/documentation/</a>>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bin/gmx...done.
(gdb) r nonbonded-benchmark -nt 1 -iter 1 -warmup 1 -time -all
Starting program:
/home/users/u0001043/build/gromacs-2021/llvm-main/RelWithDebInfo/512-single/bin/gmx
nonbonded-benchmark -nt 1 -iter 1 -warmup 1 -time -all
Missing separate debuginfos, use: yum debuginfo-install
glibc-2.28-72.el8_1.1.aarch64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
:-) GROMACS - gmx nonbonded-benchmark, 2021 (-:
GROMACS is written by:
Andrey Alekseenko Emile Apol Rossen Apostolov
Paul Bauer Herman J.C. Berendsen Par Bjelkmar
Christian Blau Viacheslav Bolnykh Kevin Boyd
Aldert van Buuren Rudi van Drunen Anton Feenstra
Gilles Gouaillardet Alan Gray Gerrit Groenhof
Anca Hamuraru Vincent Hindriksen M. Eric Irrgang
Aleksei Iupinov Christoph Junghans Joe Jordan
Dimitrios Karkoulis Peter Kasson Jiri Kraus
Carsten Kutzner Per Larsson Justin A. Lemkul
Viveca Lindahl Magnus Lundborg Erik Marklund
Pascal Merz Pieter Meulenhoff Teemu Murtola
Szilard Pall Sander Pronk Roland Schulz
Michael Shirts Alexey Shvetsov Alfons Sijbers
Peter Tieleman Jon Vincent Teemu Virolainen
Christian Wennberg Maarten Wolf Artem Zhmurov
and the project leaders:
Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel
Copyright (c) 1991-2000, University of Groningen, The Netherlands.
Copyright (c) 2001-2019, The GROMACS development team at
Uppsala University, Stockholm University and
the Royal Institute of Technology, Sweden.
check out <a href="http://www.gromacs.org">http://www.gromacs.org</a> for more information.
GROMACS is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1
of the License, or (at your option) any later version.
GROMACS: gmx nonbonded-benchmark, version 2021
Executable:
/home/users/u0001043/build/gromacs-2021/llvm-main/RelWithDebInfo/512-single/bin/gmx
Data prefix: /home/users/u0001043/src/gromacs-2021 (source tree)
Working dir:
/home/users/u0001043/build/gromacs-2021/llvm-main/RelWithDebInfo/512-single
Command line:
gmx nonbonded-benchmark -nt 1 -iter 1 -warmup 1 -time -all
SIMD width: 16
System size: 3000 atoms
Cut-off radius: 1 nm
Number of threads: 1
Number of iterations: 1
Compute energies: no
Ewald excl. corr.: analytical
Coulomb LJ comb. SIMD usec usec/it. pairs/usec
total useful
Ewald all geom. 2xMM 31013.13 31013.130 44.162 20.306
Ewald all LB 2xMM 31077.04 31077.040 44.071 20.264
Program received signal SIGSEGV, Segmentation fault.
0x0000ffffbd81d7c4 in gmx::SimdFIBool::SimdFIBool (this=<optimized out>,
simd=...) at
/home/users/u0001043/src/gromacs-2021/src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h:109
109 SimdFIBool(svbool_t simd) { this->simdInternal_ =
svdup_n_u32_z(simd, 0xFFFFFFFF); }
Missing separate debuginfos, use: yum debuginfo-install
libgcc-8.3.1-4.5.el8.aarch64 libstdc++-8.3.1-4.5.el8.aarch64
(gdb) bt
#0 0x0000ffffbd81d7c4 in gmx::SimdFIBool::SimdFIBool (this=<optimized out>,
simd=...) at
/home/users/u0001043/src/gromacs-2021/src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h:109
#1 gmx::testBits (a=...) at
/home/users/u0001043/src/gromacs-2021/src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h:559
#2 gmx_load_simd_2xnn_interactions (excl=<optimized out>, filter_S0=<error
reading variable: Cannot access memory at address 0xffffffffffff7b08>,
filter_S2=<error reading variable: Cannot access memory at address
0xffffffffffff7ac8>, interact_S0=<optimized out>, interact_S2=<optimized out>)
at
/home/users/u0001043/src/gromacs-2021/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_common.h:104
#3 nbnxm_kernel_ElecEw_VdwLJCombLB_F_2xmm (nbl=0x44ef40, nbat=<optimized out>,
ic=<optimized out>, shift_vec=0x45f3b0, out=<optimized out>)
at
/home/users/u0001043/src/gromacs-2021/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_inner.h:222</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>