[llvm] 893e351 - [test] Avoid legacy PM default pipelines (O0, O1 etc) when running opt

Bjorn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 00:58:17 PST 2022


Author: Bjorn Pettersson
Date: 2022-11-09T09:57:57+01:00
New Revision: 893e351f2f624e24b0743d58d87f30629b4054d4

URL: https://github.com/llvm/llvm-project/commit/893e351f2f624e24b0743d58d87f30629b4054d4
DIFF: https://github.com/llvm/llvm-project/commit/893e351f2f624e24b0743d58d87f30629b4054d4.diff

LOG: [test] Avoid legacy PM default pipelines (O0,O1 etc) when running opt

Two lit tests were found running something like this:
  opt -O<n> -pass-locked-to-legacy-PM ...

The expand-atomicrmw-xchg-fp.ll seem to have used -O1 just to ensure
that the -atomic-expand pass were thinking that it wasn't running at
O0 level. Same thing can be ensured by using the -codegen-opt-level=1
option, making it possible to avoid using O1 in that test case.

In the vector-reductions-expanded.ll test case it was possible to
split the RUN line into using two opt invocations. First running
"opt -O2" using the new PM, and then running "opt -expand-reductions"
using the legacy PM.

I think that given this patch we get closer to removing code related
to 'AddOptimizationPasses' in opt.cpp.

Differential Revision: https://reviews.llvm.org/D137626

Added: 
    

Modified: 
    llvm/test/Transforms/AtomicExpand/AArch64/expand-atomicrmw-xchg-fp.ll
    llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/AtomicExpand/AArch64/expand-atomicrmw-xchg-fp.ll b/llvm/test/Transforms/AtomicExpand/AArch64/expand-atomicrmw-xchg-fp.ll
index 2aafd2a921aa8..0f7da33b1652f 100644
--- a/llvm/test/Transforms/AtomicExpand/AArch64/expand-atomicrmw-xchg-fp.ll
+++ b/llvm/test/Transforms/AtomicExpand/AArch64/expand-atomicrmw-xchg-fp.ll
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -O1 -S -mtriple=aarch64-- -atomic-expand %s | FileCheck %s
-; RUN: opt -O1 -S -mtriple=aarch64-- -mattr=+outline-atomics -atomic-expand %s | FileCheck %s --check-prefix=OUTLINE-ATOMICS
+; RUN: opt -codegen-opt-level=1 -S -mtriple=aarch64-- -atomic-expand %s | FileCheck %s
+; RUN: opt -codegen-opt-level=1 -S -mtriple=aarch64-- -mattr=+outline-atomics -atomic-expand %s | FileCheck %s --check-prefix=OUTLINE-ATOMICS
 
 define void @atomic_swap_f16(half* %ptr, half %val) nounwind {
 ; CHECK-LABEL: @atomic_swap_f16(

diff  --git a/llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll b/llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll
index f6b3438fa8b35..00902f0fd9243 100644
--- a/llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll
+++ b/llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -O2 -expand-reductions -mattr=avx -S < %s | FileCheck %s
+; RUN: opt -O2 -mattr=avx < %s | opt -expand-reductions -mattr=avx -S | FileCheck %s
 
 ; Test if SLP vector reduction patterns are recognized
 ; and optionally converted to reduction intrinsics and


        


More information about the llvm-commits mailing list