llvm.org GIT mirror llvm / f1216ab
Revert "Remove some unused triple and data layout." This reverts commit r179497 and the accompanying commit as it broke random platforms that aren't osx. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179499 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 6 years ago
3 changed file(s) with 19 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=i386-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
1
2 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"
3 target triple = "i386-apple-macosx10.8.0"
14
25 ; int foo(double *A, int n, int m) {
36 ; double sum = 0, v1 = 2, v0 = 3;
0 ; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=i386-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
1
2 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"
3 target triple = "i386-apple-macosx10.8.0"
14
25 ;CHECK: @foo
36 ;CHECK: load <2 x double>
3535 #include "llvm/Support/PassNameParser.h"
3636 #include "llvm/Support/PluginLoader.h"
3737 #include "llvm/Support/PrettyStackTrace.h"
38 #include "llvm/Support/raw_ostream.h"
3938 #include "llvm/Support/Signals.h"
4039 #include "llvm/Support/SourceMgr.h"
4140 #include "llvm/Support/SystemUtils.h"
529528 const Target *TheTarget = TargetRegistry::lookupTarget(MArch, TheTriple,
530529 Error);
531530 // Some modules don't specify a triple, and this is okay.
532 if (!TheTarget)
531 if (!TheTarget) {
533532 return 0;
533 }
534534
535535 // Package up features to be passed to target/subtarget
536536 std::string FeaturesStr;
597597 }
598598
599599 // If we are supposed to override the target triple, do so now.
600 const DataLayout *TD;
601 if (!TargetTriple.empty()) {
600 if (!TargetTriple.empty())
602601 M->setTargetTriple(Triple::normalize(TargetTriple));
603 TD = GetTargetMachine(Triple(TargetTriple))->getDataLayout();
604 }
605
602
606603 // Figure out what stream we are supposed to write to...
607604 OwningPtr Out;
608605 if (NoOutput) {
643640 TLI->disableAllFunctions();
644641 Passes.add(TLI);
645642
646 // If we don't have a data layout by now go ahead and set it if we can.
647 if (!TD) {
648 const std::string &ModuleDataLayout = M.get()->getDataLayout();
649 if (!ModuleDataLayout.empty())
650 TD = new DataLayout(ModuleDataLayout);
651 else if (!DefaultDataLayout.empty())
652 TD = new DataLayout(DefaultDataLayout);
653 }
643 // Add an appropriate DataLayout instance for this module.
644 DataLayout *TD = 0;
645 const std::string &ModuleDataLayout = M.get()->getDataLayout();
646 if (!ModuleDataLayout.empty())
647 TD = new DataLayout(ModuleDataLayout);
648 else if (!DefaultDataLayout.empty())
649 TD = new DataLayout(DefaultDataLayout);
650
654651 if (TD)
655 Passes.add(new DataLayout(*TD));
652 Passes.add(TD);
656653
657654 Triple ModuleTriple(M->getTargetTriple());
658655 TargetMachine *Machine = 0;