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

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 03:19:26 PST 2022


bjope created this revision.
bjope added reviewers: aeubanks, LemonBoy.
Herald added a project: All.
bjope requested review of this revision.
Herald added a project: LLVM.

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 <https://reviews.llvm.org/owners/package/1/> 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137626

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


Index: llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll
===================================================================
--- llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll
+++ 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
Index: llvm/test/Transforms/AtomicExpand/AArch64/expand-atomicrmw-xchg-fp.ll
===================================================================
--- llvm/test/Transforms/AtomicExpand/AArch64/expand-atomicrmw-xchg-fp.ll
+++ 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(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137626.473937.patch
Type: text/x-patch
Size: 1562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221108/bf3543d1/attachment.bin>


More information about the llvm-commits mailing list