summaryrefslogtreecommitdiff
path: root/tools/lto/lto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lto/lto.cpp')
-rw-r--r--tools/lto/lto.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index b330af16bd..71bd9e6bf2 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -247,8 +247,19 @@ LTO::getTarget (Module *M) {
return;
// Create target
- std::string Features;
- Target = March->CtorFn(*M, Features);
+ SubtargetFeatures Features;
+ std::string FeatureStr;
+ std::string TargetTriple = M->getTargetTriple();
+
+ if (strncmp(TargetTriple.c_str(), "powerpc-apple-", 14) == 0)
+ Features.AddFeature("altivec", true);
+ else if (strncmp(TargetTriple.c_str(), "powerpc64-apple-", 16) == 0) {
+ Features.AddFeature("64bit", true);
+ Features.AddFeature("altivec", true);
+ }
+
+ FeatureStr = Features.getString();
+ Target = March->CtorFn(*M, FeatureStr);
}
/// Optimize module M using various IPO passes. Use exportList to