diff options
Diffstat (limited to 'clang/lib/Basic/Targets/X86.h')
| -rw-r--r-- | clang/lib/Basic/Targets/X86.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h index 9d277e94cc0..5b862face9b 100644 --- a/clang/lib/Basic/Targets/X86.h +++ b/clang/lib/Basic/Targets/X86.h @@ -421,6 +421,7 @@ public: LongDoubleWidth = 128; LongDoubleAlign = 128; SuitableAlign = 128; + MaxVectorAlign = 256; // The watchOS simulator uses the builtin bool type for Objective-C. llvm::Triple T = llvm::Triple(Triple); if (T.isWatchOS()) @@ -436,6 +437,9 @@ public: if (!DarwinTargetInfo<X86_32TargetInfo>::handleTargetFeatures(Features, Diags)) return false; + // We now know the features we have: we can decide how to align vectors. + MaxVectorAlign = + hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128; return true; } }; @@ -798,6 +802,9 @@ public: if (!DarwinTargetInfo<X86_64TargetInfo>::handleTargetFeatures(Features, Diags)) return false; + // We now know the features we have: we can decide how to align vectors. + MaxVectorAlign = + hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128; return true; } }; |

