summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets/OSTargets.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2018-06-01 21:34:26 +0000
committerJohn McCall <rjmccall@apple.com>2018-06-01 21:34:26 +0000
commit280c6560317fcb73872e340621861dfd6ecb9333 (patch)
tree5633ce15ae30163a63376c4d5c4ff6b924a8fd8e /clang/lib/Basic/Targets/OSTargets.h
parentb8d861c27a1bdf8576f964a3fac533c3df7fe39a (diff)
downloadbcm5719-llvm-280c6560317fcb73872e340621861dfd6ecb9333.tar.gz
bcm5719-llvm-280c6560317fcb73872e340621861dfd6ecb9333.zip
Cap "voluntary" vector alignment at 16 for all Darwin platforms.
This fixes two major problems: - We were not capping vector alignment as desired on 32-bit ARM. - We were using different alignments based on the AVX settings on Intel, so we did not have a consistent ABI. This is an ABI break, but we think we can get away with it because vectors tend to be used mostly in inline code (which is why not having a consistent ABI has not proven disastrous on Intel). Intel's AVX types are specified as having 32-byte / 64-byte alignment, so align them explicitly instead of relying on the base ABI rule. Note that this sort of attribute is stripped from template arguments in template substitution, so there's a possibility that code templated over vectors will produce inadequately-aligned objects. The right long-term solution for this is for alignment attributes to be interpreted as true qualifiers and thus preserved in the canonical type. llvm-svn: 333791
Diffstat (limited to 'clang/lib/Basic/Targets/OSTargets.h')
-rw-r--r--clang/lib/Basic/Targets/OSTargets.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h
index 18239a2ec77..6cc3c095557 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -113,6 +113,9 @@ public:
}
this->MCountName = "\01mcount";
+
+ // Cap vector alignment at 16 bytes for all Darwin platforms.
+ this->MaxVectorAlign = 128;
}
std::string isValidSectionSpecifier(StringRef SR) const override {
OpenPOWER on IntegriCloud