[Sema][X86] Consider target attribute into the checks in validateOutputSize and valid...
authorCraig Topper <craig.topper@intel.com>
Fri, 6 Dec 2019 23:08:32 +0000 (15:08 -0800)
committerCraig Topper <craig.topper@intel.com>
Fri, 6 Dec 2019 23:30:59 +0000 (15:30 -0800)
commite1578fd2b79fe5af5f80c0c166a8abd0f816c022
tree3c574452f50c324277fbd0ebad71b5c2cfbcc3ae
parent60573ae6fe509b618dc6a2c5c55d921bccd77608
[Sema][X86] Consider target attribute into the checks in validateOutputSize and validateInputSize.

The validateOutputSize and validateInputSize need to check whether
AVX or AVX512 are enabled. But this can be affected by the
target attribute so we need to factor that in.

This patch copies some of the code from CodeGen to create an
appropriate feature map that we can pass to the function. Probably
need some refactoring here to share more code with Codegen. Is
there a good place to do that? Also need to support the cpu_specific
attribute as well.

Differential Revision: https://reviews.llvm.org/D68627
clang/include/clang/AST/ASTContext.h
clang/include/clang/Basic/TargetInfo.h
clang/lib/AST/ASTContext.cpp
clang/lib/Basic/Targets/X86.cpp
clang/lib/Basic/Targets/X86.h
clang/lib/CodeGen/CodeGenFunction.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/lib/Sema/SemaStmtAsm.cpp
clang/test/CodeGen/x86_32-inline-asm.c