Skip to content

Commit

Permalink
[SimpleLoopUnswitch] Use loop-mssa in more tests (NFC)
Browse files Browse the repository at this point in the history
We had a lot of -verify-memoryssa tests that did not actually use
MemorySSA, because they were not using the loop-mssa adaptor.
  • Loading branch information
nikic committed Nov 27, 2024
1 parent 284d4e0 commit 2eb40aa
Show file tree
Hide file tree
Showing 31 changed files with 32 additions and 36 deletions.
2 changes: 1 addition & 1 deletion llvm/test/Analysis/MemorySSA/loop-unswitch.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -S -passes=simple-loop-unswitch -disable-basic-aa -verify-memoryssa < %s | FileCheck %s
; RUN: opt -S -passes="loop-mssa(simple-loop-unswitch)" -disable-basic-aa -verify-memoryssa < %s | FileCheck %s
; REQUIRES: asserts

target triple = "x86_64-unknown-linux-gnu"
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Analysis/MemorySSA/pr40037.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; REQUIRES: asserts
; RUN: opt -S -passes=simple-loop-unswitch -verify-memoryssa < %s | FileCheck %s
; RUN: opt -S -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa < %s | FileCheck %s

target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
target triple = "s390x-ibm-linux"
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Analysis/MemorySSA/pr40749_2.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -S -passes=licm,simple-loop-unswitch -verify-memoryssa %s | FileCheck %s
; RUN: opt -S -passes="loop-mssa(licm,simple-loop-unswitch)" -verify-memoryssa %s | FileCheck %s
; REQUIRES: asserts
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
target triple = "s390x-ibm-linux"
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Analysis/MemorySSA/pr43641.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -passes=simple-loop-unswitch -enable-nontrivial-unswitch -verify-memoryssa -S < %s | FileCheck %s
; RUN: opt -passes="loop-mssa(simple-loop-unswitch)" -enable-nontrivial-unswitch -verify-memoryssa -S < %s | FileCheck %s
; REQUIRES: asserts

; CHECK-LABEL: @c
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Analysis/MemorySSA/pr46574.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -passes='loop-mssa(loop-instsimplify,loop-simplifycfg,licm,simple-loop-unswitch)' -enable-nontrivial-unswitch %s -disable-output
; RUN: opt -passes='loop-mssa(loop-instsimplify,loop-simplifycfg,licm,simple-loop-unswitch)' -enable-nontrivial-unswitch -verify-memoryssa %s -disable-output
; REQUIRES: asserts

%0 = type { i24, i32, i32, i8 }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -passes=simple-loop-unswitch -enable-nontrivial-unswitch -verify-memoryssa -S %s | FileCheck %s
; RUN: opt -passes="loop-mssa(simple-loop-unswitch)" -enable-nontrivial-unswitch -verify-memoryssa -S %s | FileCheck %s
; REQUIRES: asserts

target triple = "x86_64-unknown-linux-gnu"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -disable-output
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -disable-output

%struct.BLEND_MAP = type { i16, i16, i16, i32, ptr }
%struct.BLEND_MAP_ENTRY = type { float, i8, { [5 x float], [4 x i8] } }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -disable-output
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -disable-output

define void @init_caller_save() {
entry:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; PR1333
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -disable-output
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -disable-output

target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
target triple = "i686-pc-linux-gnu"
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/SimpleLoopUnswitch/2007-05-09-tl.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -disable-output
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -disable-output
; PR1333

define void @pp_cxx_expression() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes='loop(simple-loop-unswitch),instcombine' -verify-memoryssa -disable-output
; RUN: opt < %s -passes='loop-mssa(simple-loop-unswitch),instcombine' -verify-memoryssa -disable-output

@str3 = external constant [3 x i8] ; <ptr> [#uses=1]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -disable-output
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -disable-output

define i32 @main(i32 %argc, ptr %argv) {
entry:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -disable-output
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -disable-output
; PR1559

target triple = "i686-pc-linux-gnu"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; RUN: opt < %s -S -passes='loop(simple-loop-unswitch),instcombine' -verify-memoryssa | FileCheck %s
; RUN: opt < %s -S -passes='loop-mssa(simple-loop-unswitch),instcombine' -verify-memoryssa | FileCheck %s

@.str9 = external constant [1 x i8]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes='loop(simple-loop-unswitch),instcombine,gvn' -verify-memoryssa -disable-output
; RUN: opt < %s -passes='loop-mssa(simple-loop-unswitch),instcombine,gvn' -verify-memoryssa -disable-output
; PR2372
target triple = "i386-pc-linux-gnu"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa
; PR8622
@g_38 = external global i32, align 4

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -passes=simple-loop-unswitch -verify-memoryssa -disable-output < %s
; RUN: opt -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -disable-output < %s
; PR10031

define i32 @test(i32 %command) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes='sroa,simple-loop-unswitch' -verify-memoryssa -disable-output
; RUN: opt < %s -passes='sroa,loop-mssa(simple-loop-unswitch)' -verify-memoryssa -disable-output
; PR11016
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-macosx10.7.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -S -passes=simple-loop-unswitch -verify-loop-info -verify-dom-info -verify-memoryssa | FileCheck %s
; RUN: opt < %s -S -passes="loop-mssa(simple-loop-unswitch)" -verify-loop-info -verify-dom-info -verify-memoryssa | FileCheck %s
; PR12343: -passes=simple-loop-unswitch crash on indirect branch

; CHECK: %0 = icmp eq i64 undef, 0
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/SimpleLoopUnswitch/2012-05-20-Phi.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -disable-output
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -disable-output
; PR12887
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -S | FileCheck %s
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -S | FileCheck %s

; In cases where two address spaces do not have the same size pointer, the
; input for the addrspacecast should not be used as a substitute for itself
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -S 2>&1 | FileCheck %s
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -S 2>&1 | FileCheck %s

; This is to test trivial loop unswitch only happens when trivial condition
; itself is an LIV loop condition (not partial LIV which could occur in and/or).
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/SimpleLoopUnswitch/cleanuppad.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -S -passes=simple-loop-unswitch -verify-memoryssa < %s | FileCheck %s
; RUN: opt -S -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa < %s | FileCheck %s
target triple = "x86_64-pc-win32"

define void @f(i32 %doit, i1 %x, i1 %y) personality ptr @__CxxFrameHandler3 {
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/SimpleLoopUnswitch/copy-metadata.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -S | FileCheck %s
; RUN: opt < %s -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -S | FileCheck %s

; This test checks if unswitched condition preserve make.implicit metadata.
define i32 @test(i1 %cond) {
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/SimpleLoopUnswitch/crash.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; RUN: opt < %s -passes=simple-loop-unswitch -verify-memoryssa -disable-output
; RUN: opt < %s -passes='simple-loop-unswitch<nontrivial>' -verify-memoryssa -disable-output
; RUN: opt < %s -passes='loop-mssa(simple-loop-unswitch)' -verify-memoryssa -disable-output
; RUN: opt < %s -passes='loop-mssa(simple-loop-unswitch<nontrivial>)' -verify-memoryssa -disable-output

define void @test1(ptr %S2) {
entry:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -passes=simple-loop-unswitch -verify-memoryssa -S < %s | FileCheck %s
; RUN: opt -passes="loop-mssa(simple-loop-unswitch)" -verify-memoryssa -S < %s | FileCheck %s

define void @f(i32 %n, ptr %ptr) {
; CHECK-LABEL: @f(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
; Specifically exercise the cost modeling for non-trivial loop unswitching.
;
; RUN: opt -passes='loop(simple-loop-unswitch<nontrivial>),verify<loops>' -unswitch-threshold=5 -S < %s | FileCheck %s
; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -unswitch-threshold=5 -S < %s | FileCheck %s
; RUN: opt -passes='simple-loop-unswitch<nontrivial>' -unswitch-threshold=5 -verify-memoryssa -S < %s | FileCheck %s
; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -unswitch-threshold=5 -S -verify-memoryssa < %s | FileCheck %s

declare void @a()
declare void @b()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -freeze-loop-unswitch-cond -passes='loop(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
; RUN: opt -freeze-loop-unswitch-cond -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
; RUN: opt -freeze-loop-unswitch-cond -passes='simple-loop-unswitch<nontrivial>' -verify-memoryssa -S < %s | FileCheck %s
; RUN: opt -freeze-loop-unswitch-cond -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -S -verify-memoryssa < %s | FileCheck %s

declare i32 @a()
declare i32 @b()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes='loop(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
; RUN: opt -passes='simple-loop-unswitch<nontrivial>' -verify-memoryssa -verify-loop-info -S < %s | FileCheck %s
; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -S -verify-memoryssa < %s | FileCheck %s

declare ptr @pluto()
declare void @llvm.experimental.guard(i1, ...)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
; RUN: opt -passes='loop(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
; RUN: opt -passes='simple-loop-unswitch<nontrivial>' -verify-memoryssa -S < %s | FileCheck %s
; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -S -verify-memoryssa < %s | FileCheck %s

declare i32 @a()
declare i32 @b()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt -passes=simple-loop-unswitch -verify-loop-info -verify-dom-info -verify-memoryssa -disable-output < %s
; RUN: opt -passes="loop-mssa(simple-loop-unswitch)" -verify-loop-info -verify-dom-info -verify-memoryssa -disable-output < %s

; Loop unswitch should be able to unswitch these loops and
; preserve LCSSA and LoopSimplify forms.
Expand Down

0 comments on commit 2eb40aa

Please sign in to comment.