[MSSA][NewPM] Handle tests with -print-memoryssa
authorArthur Eubanks <aeubanks@google.com>
Wed, 5 Aug 2020 18:12:29 +0000 (11:12 -0700)
committerArthur Eubanks <aeubanks@google.com>
Wed, 5 Aug 2020 22:59:45 +0000 (15:59 -0700)
-print-memoryssa in legacy PM is print<memoryssa> in NPM.
Pin tests with -print-memoryssa to legacy PM.
Add corresponding tests for NPM where missing.
This fixes "unknown pass name 'print-memoryssa'".

Some tests still fail in Analysis/MemorySSA due to other passes that
haven't been ported.

pr43427.ll and pr43438.ll required adding -aa-pipeline=basic-aa,
-loop-simplify (since it doesn't run on legacy PM by default), and
decrementing some of the MemoryPhi numbers.

Reviewed By: asbirlea

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

31 files changed:
llvm/test/Analysis/MemorySSA/assume.ll
llvm/test/Analysis/MemorySSA/atomic-clobber.ll
llvm/test/Analysis/MemorySSA/basicaa-memcpy.ll
llvm/test/Analysis/MemorySSA/constant-memory.ll
llvm/test/Analysis/MemorySSA/cyclicphi.ll
llvm/test/Analysis/MemorySSA/debugvalue2.ll
llvm/test/Analysis/MemorySSA/function-clobber.ll
llvm/test/Analysis/MemorySSA/function-mem-attrs.ll
llvm/test/Analysis/MemorySSA/invariant-groups.ll
llvm/test/Analysis/MemorySSA/lifetime-simple.ll
llvm/test/Analysis/MemorySSA/load-invariant.ll
llvm/test/Analysis/MemorySSA/loop-rotate-disablebasicaa.ll
llvm/test/Analysis/MemorySSA/loop_rotate_remove_trivial_phis.ll
llvm/test/Analysis/MemorySSA/many-dom-backedge.ll
llvm/test/Analysis/MemorySSA/many-doms.ll
llvm/test/Analysis/MemorySSA/multi-edges.ll
llvm/test/Analysis/MemorySSA/multiple-backedges-hal.ll
llvm/test/Analysis/MemorySSA/multiple-locations.ll
llvm/test/Analysis/MemorySSA/no-disconnected.ll
llvm/test/Analysis/MemorySSA/optimize-use.ll
llvm/test/Analysis/MemorySSA/phi-translation.ll
llvm/test/Analysis/MemorySSA/pr28880.ll
llvm/test/Analysis/MemorySSA/pr36883.ll
llvm/test/Analysis/MemorySSA/pr41640.ll
llvm/test/Analysis/MemorySSA/pr43317.ll
llvm/test/Analysis/MemorySSA/pr43427.ll
llvm/test/Analysis/MemorySSA/pr43438.ll
llvm/test/Analysis/MemorySSA/ptr-const-mem.ll
llvm/test/Analysis/MemorySSA/scalable-vec.ll
llvm/test/Analysis/MemorySSA/update_unroll.ll
llvm/test/Analysis/MemorySSA/volatile-clobber.ll

index 12d24df..08c82a1 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Ensures that assumes are treated as not reading or writing memory.
index 79a9392..0e3e89d 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Ensures that atomic loads count as MemoryDefs
index e33169a..83a5544 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -disable-output -basic-aa -print-memoryssa %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -basic-aa -enable-new-pm=0 -print-memoryssa %s 2>&1 | FileCheck %s
 
 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
 
index 4c25513..5130cd4 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>' -verify-memoryssa < %s 2>&1 | FileCheck %s
 ;
 ; Things that BasicAA can prove points to constant memory should be
 ; liveOnEntry, as well.
index 36d34ef..6c3eea7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 
 %struct.hoge = type { i32, %struct.widget }
index 90784ae..1876e72 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -disable-basic-aa -print-memoryssa -disable-output %s 2>&1 | FileCheck %s
+; RUN: opt -disable-basic-aa -enable-new-pm=0 -print-memoryssa -disable-output %s 2>&1 | FileCheck %s
 
 ; Note that the test crashes the MemorySSA verification when doing loop-rotate,
 ; if debuginfo is modelled in MemorySSA, due to the fact that MemorySSA is not
index b9b16bd..d223643 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Ensuring that external functions without attributes are MemoryDefs
index 7860576..05c9772 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Test that various function attributes give us sane results.
index 4558020..56ad579 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>' -verify-memoryssa < %s 2>&1 | FileCheck %s
 ;
 ; Currently, MemorySSA doesn't support invariant groups. So, we should ignore
 ; launder.invariant.group intrinsics entirely. We'll need to pay attention to
index ef274c9..33327c5 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ; This test checks a number of things:
 ; First, the lifetime markers should not clobber any uses of Q or P.
index 1375122..2620633 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>' -verify-memoryssa -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Invariant loads should be considered live on entry, because, once the
index 3845f59..0a539e3 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: opt -disable-basic-aa -print-memoryssa -disable-output %s 2>&1 | FileCheck %s
+; RUN: opt -disable-basic-aa -enable-new-pm=0 -print-memoryssa -disable-output %s 2>&1 | FileCheck %s
+; RUN: opt -passes='print<memoryssa>' -disable-output %s 2>&1 | FileCheck %s
 
 ; Note: if @foo is modelled as a MemoryDef, this test will assert with -loop-rotate, due to MemorySSA not
 ; being preserved when moving instructions that may not read from or write to memory.
index e0352df..d96a3d4 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: opt -loop-rotate -print-memoryssa -disable-output -enable-mssa-loop-dependency -verify-memoryssa %s 2>&1 |  FileCheck %s
+; RUN: opt -loop-rotate -enable-new-pm=0 -print-memoryssa -disable-output -enable-mssa-loop-dependency -verify-memoryssa %s 2>&1 |  FileCheck %s
+; RUN: opt -passes='loop-mssa(loop-rotate),print<memoryssa>' -disable-output -verify-memoryssa %s 2>&1 |  FileCheck %s
 ; REQUIRES: asserts
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
index 73f9eb2..4e125a7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; many-dom.ll, with an added back-edge back into the switch.
index 1a2422c..9eeca0c 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Testing many dominators, specifically from a switch statement in C.
index f8b573f..d29c60d 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Makes sure we have a sane model if both successors of some block is the same
index 6d1f92a..2b3c6a0 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 
 ; hfinkel's case
index 32a6a20..bbbccb3 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Checks that basicAA is doing some amount of disambiguation for us
index d3b2db8..6fb6a10 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; This test ensures we don't end up with multiple reaching defs for a single
index 4acb59e..ec0d5c3 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,NOLIMIT
-; RUN: opt -memssa-check-limit=0 -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LIMIT
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,NOLIMIT
+; RUN: opt -memssa-check-limit=0 -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LIMIT
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,NOLIMIT
 ; RUN: opt -memssa-check-limit=0 -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LIMIT
 
index 93ebc86..3909437 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,NOLIMIT
-; RUN: opt -memssa-check-limit=0 -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LIMIT
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,NOLIMIT
+; RUN: opt -memssa-check-limit=0 -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LIMIT
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,NOLIMIT
 ; RUN: opt -memssa-check-limit=0 -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LIMIT
 
index 850ac04..dc542d6 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 
 ; This testcase is reduced from SingleSource/Benchmarks/Misc/fbench.c
index 7493df4..49d9c18 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -memoryssa -analyze < %s 2>&1 -S | FileCheck %s
+; RUN: opt -basic-aa -memoryssa -enable-new-pm=0 -analyze < %s 2>&1 -S | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -S < %s 2>&1 | FileCheck %s
 ;
 ; We weren't properly considering the args in callsites in equality or hashing.
index 5d2d523..cf25535 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: opt -disable-output -licm -print-memoryssa -enable-mssa-loop-dependency=true < %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -licm -enable-new-pm=0 -print-memoryssa -enable-mssa-loop-dependency=true < %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -passes='loop-mssa(licm),print<memoryssa>' < %s 2>&1 | 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"
 
index b1fbfdb..eb46252 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: opt -disable-output -licm -print-memoryssa -enable-mssa-loop-dependency=true < %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -licm -enable-new-pm=0 -print-memoryssa -enable-mssa-loop-dependency=true < %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -passes='loop-mssa(licm),print<memoryssa>' < %s 2>&1 | FileCheck %s
 @v_274 = external dso_local global i64, align 1
 @v_295 = external dso_local global i16, align 1
 @v_335 = external dso_local global i32, align 1
index f708878..cb8afbb 100644 (file)
@@ -1,9 +1,10 @@
-; RUN: opt -disable-output -licm -print-memoryssa -enable-mssa-loop-dependency=true < %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -loop-simplify -licm -enable-new-pm=0 -print-memoryssa -enable-mssa-loop-dependency=true < %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -aa-pipeline=basic-aa -passes='loop-mssa(licm),print<memoryssa>' < %s 2>&1 | FileCheck %s
 
 ; CHECK-LABEL: @f()
-; CHECK: 8 = MemoryPhi(
 ; CHECK: 7 = MemoryPhi(
-; CHECK: 9 = MemoryPhi(
+; CHECK: 6 = MemoryPhi(
+; CHECK: 8 = MemoryPhi(
 define void @f() {
 entry:
   %e = alloca i16, align 1
index 69bbced..e15ab0e 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: opt -disable-output -licm -print-memoryssa -enable-mssa-loop-dependency=true < %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -loop-simplify -licm -enable-new-pm=0 -print-memoryssa -enable-mssa-loop-dependency=true < %s 2>&1 | FileCheck %s
+; RUN: opt -disable-output -aa-pipeline=basic-aa -passes='loop-mssa(licm),print<memoryssa>' < %s 2>&1 | FileCheck %s
 target triple = "x86_64-unknown-linux-gnu"
 
 ; CHECK-LABEL: @main()
@@ -46,11 +47,11 @@ if.end569:                                        ; preds = %if.else568, %if.the
 
 
 ; CHECK-LABEL: @f()
-; CHECK: 8 = MemoryPhi(
 ; CHECK: 7 = MemoryPhi(
-; CHECK: 11 = MemoryPhi(
+; CHECK: 6 = MemoryPhi(
 ; CHECK: 10 = MemoryPhi(
 ; CHECK: 9 = MemoryPhi(
+; CHECK: 8 = MemoryPhi(
 define void @f() {
 entry:
   %e = alloca i16, align 1
index 47581e3..76d5ef7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze -memssa-check-limit=0 < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze -memssa-check-limit=0 < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>' -verify-memoryssa -disable-output -memssa-check-limit=0 < %s 2>&1 | FileCheck %s
 target datalayout = "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
 target triple = "amdgcn"
index 4efbf48..9c5f745 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>' -verify-memoryssa -disable-output < %s 2>&1 | FileCheck %s
 
 ; CHECK-LABEL: define <vscale x 4 x i32> @f(
index 5fa4eac..cdf5d18 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: opt -enable-mssa-loop-dependency -verify-memoryssa  -loop-rotate -S %s | FileCheck %s
+; RUN: opt -enable-new-pm=0 -enable-mssa-loop-dependency -verify-memoryssa  -loop-rotate -S %s | FileCheck %s
+; RUN: opt -verify-memoryssa -passes='loop-mssa(loop-rotate)' -S %s | FileCheck %s
 ; REQUIRES: asserts
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
index be46af7..3a7e989 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basic-aa -print-memoryssa -verify-memoryssa -enable-new-pm=0 -analyze < %s 2>&1 | FileCheck %s
 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
 ;
 ; Ensures that volatile stores/loads count as MemoryDefs