bug #1684: partially workaround clang's 6/7 bug #40815

This commit is contained in:
Gael Guennebaud
2019-03-13 10:40:01 +01:00
parent 690f0795d0
commit d7d2f0680e
2 changed files with 46 additions and 5 deletions

View File

@@ -157,7 +157,16 @@ template<typename Scalar>
struct functor_traits<swap_assign_op<Scalar> > {
enum {
Cost = 3 * NumTraits<Scalar>::ReadCost,
PacketAccess = packet_traits<Scalar>::Vectorizable
PacketAccess =
#if defined(EIGEN_VECTORIZE_AVX) && EIGEN_COMP_CLANG && (EIGEN_COMP_CLANG<800 || defined(__apple_build_version__))
// This is a partial workaround for a bug in clang generating bad code
// when mixing 256/512 bits loads and 128 bits moves.
// See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1684
// https://bugs.llvm.org/show_bug.cgi?id=40815
0
#else
packet_traits<Scalar>::Vectorizable
#endif
};
};