Skip to content

Commit 65e5006

Browse files
committed
[NPM][opt] Run -O# after other passes in legacy PM compatibility mode
Generally tests run -O# before other passes, not after.
1 parent 340181f commit 65e5006

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/test/Transforms/LoopVectorize/X86/metadata-enable.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
; RUN: opt < %s -mcpu=corei7 -O1 -loop-vectorize -S -unroll-allow-partial=0 | FileCheck %s --check-prefix=O1VEC2
99
; RUN: opt < %s -mcpu=corei7 -Oz -loop-vectorize -S -unroll-allow-partial=0 | FileCheck %s --check-prefix=OzVEC2
1010
; RUN: opt < %s -mcpu=corei7 -O3 -unroll-threshold=150 -vectorize-loops=false -S -unroll-allow-partial=0 | FileCheck %s --check-prefix=O3DIS
11+
; RUN: opt < %s -mcpu=corei7 -O1 -loop-vectorize -S -unroll-allow-partial=0 -enable-new-pm=1 | FileCheck %s --check-prefix=O1VEC2
1112

1213
; This file tests the llvm.loop.vectorize.enable metadata forcing
1314
; vectorization even when optimization levels are too low, or when

llvm/tools/opt/opt.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,9 +759,6 @@ int main(int argc, char **argv) {
759759
return 1;
760760
}
761761
SmallVector<StringRef, 4> Passes;
762-
for (const auto &P : PassList) {
763-
Passes.push_back(P->getPassArgument());
764-
}
765762
if (OptLevelO0)
766763
Passes.push_back("default<O0>");
767764
if (OptLevelO1)
@@ -774,6 +771,8 @@ int main(int argc, char **argv) {
774771
Passes.push_back("default<Os>");
775772
if (OptLevelOz)
776773
Passes.push_back("default<Oz>");
774+
for (const auto &P : PassList)
775+
Passes.push_back(P->getPassArgument());
777776
OutputKind OK = OK_NoOutput;
778777
if (!NoOutput)
779778
OK = OutputAssembly

0 commit comments

Comments
 (0)