[X86] Use AVX features instead of ABI to init. SimdDefaultAlign.

The ABI string only exists to communicate with TargetCodeGenInfo.
Concretely, since we only used "avx*" ABI strings on x86_64 (as AVX
doesn't affect the i386 ABIs), this meant that, when initializing
SimdDefaultAlign, we would ignore AVX/AVX512 on i386, for no good
reason.

Instead, directly check the features. A similar change for
MaxVectorAlign will follow.

Differential Revision: http://reviews.llvm.org/D12390

llvm-svn: 246228
This commit is contained in:
Ahmed Bougacha 2015-08-27 22:24:56 +00:00
parent ee03b5bbb9
commit 68bf64e302
2 changed files with 4 additions and 1 deletions

View File

@ -2984,7 +2984,7 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
MMX3DNowLevel = std::max(MMX3DNowLevel, MMX);
SimdDefaultAlign =
(getABI() == "avx512") ? 512 : (getABI() == "avx") ? 256 : 128;
hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
return true;
}

View File

@ -1,6 +1,9 @@
// RUN: %clang_cc1 -fopenmp -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86
// RUN: %clang_cc1 -fopenmp -triple x86_64-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
// RUN: %clang_cc1 -fopenmp -triple x86_64-unknown-unknown -target-feature +avx512f -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX512
// RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86
// RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
// RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -target-feature +avx512f -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX512
// RUN: %clang_cc1 -fopenmp -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC
// RUN: %clang_cc1 -fopenmp -triple powerpc64-unknown-unknown -target-abi elfv1-qpx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC-QPX