From: Eric Christopher Date: Mon, 15 Apr 2013 07:31:37 +0000 (+0000) Subject: Revert "Recommit r179497 after fixing uninitialized variable." until X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13637e900e73a8c0a5b822e2ef7e2742e9650072;p=platform%2Fupstream%2Fllvm.git Revert "Recommit r179497 after fixing uninitialized variable." until I can fix the testcases here: http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/6952 This reverts commit r179512 due to testcases specifying triples that they didn't actually mean and causing failures on other platforms. llvm-svn: 179513 --- diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reduction.ll b/llvm/test/Transforms/SLPVectorizer/X86/reduction.ll index da65f92..70b7c3a 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/reduction.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/reduction.ll @@ -1,5 +1,8 @@ ; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=i386-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s +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" +target triple = "i386-apple-macosx10.8.0" + ; int foo(double *A, int n, int m) { ; double sum = 0, v1 = 2, v0 = 3; ; for (int i=0; i < n; ++i) diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll b/llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll index 9cce0be..7aa7d7e 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll @@ -1,5 +1,8 @@ ; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=i386-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s +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" +target triple = "i386-apple-macosx10.8.0" + ;CHECK: @foo ;CHECK: load <2 x double> ;CHECK: ret diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index de8bd41..e385d7f 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -403,7 +403,7 @@ struct BreakpointPrinter : public ModulePass { AU.setPreservesAll(); } }; - + } // anonymous namespace char BreakpointPrinter::ID = 0; @@ -446,7 +446,7 @@ static void AddOptimizationPasses(PassManagerBase &MPM,FunctionPassManager &FPM, Builder.DisableUnitAtATime = !UnitAtATime; Builder.DisableUnrollLoops = OptLevel == 0; Builder.DisableSimplifyLibCalls = DisableSimplifyLibCalls; - + Builder.populateFunctionPassManager(FPM); Builder.populateModulePassManager(MPM); } @@ -529,8 +529,9 @@ static TargetMachine* GetTargetMachine(Triple TheTriple) { const Target *TheTarget = TargetRegistry::lookupTarget(MArch, TheTriple, Error); // Some modules don't specify a triple, and this is okay. - if (!TheTarget) + if (!TheTarget) { return 0; + } // Package up features to be passed to target/subtarget std::string FeaturesStr; @@ -597,11 +598,8 @@ int main(int argc, char **argv) { } // If we are supposed to override the target triple, do so now. - const DataLayout *TD = 0; - if (!TargetTriple.empty()) { + if (!TargetTriple.empty()) M->setTargetTriple(Triple::normalize(TargetTriple)); - TD = GetTargetMachine(Triple(TargetTriple))->getDataLayout(); - } // Figure out what stream we are supposed to write to... OwningPtr Out; @@ -643,16 +641,16 @@ int main(int argc, char **argv) { TLI->disableAllFunctions(); Passes.add(TLI); - // If we don't have a data layout by now go ahead and set it if we can. - if (!TD) { - const std::string &ModuleDataLayout = M.get()->getDataLayout(); - if (!ModuleDataLayout.empty()) - TD = new DataLayout(ModuleDataLayout); - else if (!DefaultDataLayout.empty()) - TD = new DataLayout(DefaultDataLayout); - } + // Add an appropriate DataLayout instance for this module. + DataLayout *TD = 0; + const std::string &ModuleDataLayout = M.get()->getDataLayout(); + if (!ModuleDataLayout.empty()) + TD = new DataLayout(ModuleDataLayout); + else if (!DefaultDataLayout.empty()) + TD = new DataLayout(DefaultDataLayout); + if (TD) - Passes.add(new DataLayout(*TD)); + Passes.add(TD); Triple ModuleTriple(M->getTargetTriple()); TargetMachine *Machine = 0;