From 9e81a440f5229f13e21031c208fdecbe07b056c7 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Mon, 10 Dec 2012 21:45:01 +0000 Subject: [PATCH] Enable the loop vectorizer only on O2 and above. (Still disabled by default) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169774 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/PassManagerBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/IPO/PassManagerBuilder.cpp b/lib/Transforms/IPO/PassManagerBuilder.cpp index ee315a3a496..a9a9f2eeceb 100644 --- a/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -188,7 +188,7 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) { MPM.add(createLoopIdiomPass()); // Recognize idioms like memset. MPM.add(createLoopDeletionPass()); // Delete dead loops - if (LoopVectorize) + if (LoopVectorize && OptLevel > 1) MPM.add(createLoopVectorizePass()); if (!DisableUnrollLoops)