[llvm] 65e5006 - [NPM][opt] Run -O# after other passes in legacy PM compatibility mode
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 19 11:49:41 PDT 2020
Author: Arthur Eubanks
Date: 2020-10-19T11:48:44-07:00
New Revision: 65e5006962bd49d0236a18d6772ea9f165b8c41a
URL: https://github.com/llvm/llvm-project/commit/65e5006962bd49d0236a18d6772ea9f165b8c41a
DIFF: https://github.com/llvm/llvm-project/commit/65e5006962bd49d0236a18d6772ea9f165b8c41a.diff
LOG: [NPM][opt] Run -O# after other passes in legacy PM compatibility mode
Generally tests run -O# before other passes, not after.
Added:
Modified:
llvm/test/Transforms/LoopVectorize/X86/metadata-enable.ll
llvm/tools/opt/opt.cpp
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LoopVectorize/X86/metadata-enable.ll b/llvm/test/Transforms/LoopVectorize/X86/metadata-enable.ll
index 0a3a504b8ef2..e7a57fe18099 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/metadata-enable.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/metadata-enable.ll
@@ -8,6 +8,7 @@
; RUN: opt < %s -mcpu=corei7 -O1 -loop-vectorize -S -unroll-allow-partial=0 | FileCheck %s --check-prefix=O1VEC2
; RUN: opt < %s -mcpu=corei7 -Oz -loop-vectorize -S -unroll-allow-partial=0 | FileCheck %s --check-prefix=OzVEC2
; RUN: opt < %s -mcpu=corei7 -O3 -unroll-threshold=150 -vectorize-loops=false -S -unroll-allow-partial=0 | FileCheck %s --check-prefix=O3DIS
+; RUN: opt < %s -mcpu=corei7 -O1 -loop-vectorize -S -unroll-allow-partial=0 -enable-new-pm=1 | FileCheck %s --check-prefix=O1VEC2
; This file tests the llvm.loop.vectorize.enable metadata forcing
; vectorization even when optimization levels are too low, or when
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 3ba02dc8a5ca..37fb271824e9 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -759,9 +759,6 @@ int main(int argc, char **argv) {
return 1;
}
SmallVector<StringRef, 4> Passes;
- for (const auto &P : PassList) {
- Passes.push_back(P->getPassArgument());
- }
if (OptLevelO0)
Passes.push_back("default<O0>");
if (OptLevelO1)
@@ -774,6 +771,8 @@ int main(int argc, char **argv) {
Passes.push_back("default<Os>");
if (OptLevelOz)
Passes.push_back("default<Oz>");
+ for (const auto &P : PassList)
+ Passes.push_back(P->getPassArgument());
OutputKind OK = OK_NoOutput;
if (!NoOutput)
OK = OutputAssembly
More information about the llvm-commits
mailing list