Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang 3.2 generates buggy code from AVX + FMA instrinsics #15282

Closed Quuxplusone closed 11 years ago

Quuxplusone commented 11 years ago
Bugzilla Link PR15282
Status RESOLVED DUPLICATE of bug 15040
Importance P normal
Reported by Szilard Pall (sin.pecado@gmail.com)
Reported on 2013-02-15 15:49:22 -0800
Last modified on 2013-02-15 16:24:08 -0800
Version 3.2
Hardware PC Linux
CC benny.kra@gmail.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
The code in question is the GROMACS molecular dynamics simulation package
(www.gromacs.org). GROMACS, an HPC code, has a heavily optimized C codebase. It
is widely used in academia, is and available through packages in all major
Linux distributions, and it is the "engine" of Folding@Home.

The new 4.6 release includes, among others, AVX + FMA SIMD kernels. These
kernels do compile, but the generate code that seems to be incorrect. The code
compiles and runs fine (i.e passes our regressiontests) with gcc and msvc as
well as icc (using FMA3).

I know that a limited repro case would be preferred, but that is rather
difficult toa achieve.

However, reproducing hte issue is fairly simple and can be summarized in a few
steps:

* Get the code:

Release 4.6:
wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.6.tar.gz

or the current stable development version:
git clone git://git.gromacs.org/gromacs -b release-4-6 gromacs-4.6

* Build the code and execute regressiont tests (requires and AMD Bulldozer or
Piledriver CPU!):
mkdir build_gmx_avx && cd build_gmx_avx && CC=clang-3.2 cmake ../gromacs-4.6 -
DGMX_CPU_ACCELERATION=AVX_128_FMA -DREGRESSIONTEST_DOWNLOAD=ON && make check

Most of the tests will fail.

* If you now build with the SSE4.1 SIMD kernels the tests will pass:

mkdir build_gmx_sse41 && cd build_gmx_sse41 && CC=clang-3.2 cmake ../gromacs-
4.6 -DGMX_CPU_ACCELERATION=SSE4.1 -DREGRESSIONTEST_DOWNLOAD=ON && make check
Quuxplusone commented 11 years ago
The GROMACS bug report on the issue:
http://redmine.gromacs.org/issues/1099
Quuxplusone commented 11 years ago

Testing showed that this is probably a dupe of PR15040 which is fixed for 3.3 in r173176.

For 3.2, -no-integrated-as can be used as a workaround.

_This bug has been marked as a duplicate of bug 15040_