Skip to content

Commit

Permalink
[SCEV] Fix ScalarEvolution tests under NPM
Browse files Browse the repository at this point in the history
Many tests use opt's -analyze feature, which does not translate well to
NPM and has better alternatives. The alternative here is to explicitly
add a pass that calls ScalarEvolution::print().

The legacy pass manager RUNs aren't changing, but they are now pinned to
the legacy pass manager.  For each legacy pass manager RUN, I added a
corresponding NPM RUN using the 'print<scalar-evolution>' pass. For
compatibility with update_analyze_test_checks.py and existing test
CHECKs, 'print<scalar-evolution>' now prints what -analyze prints per
function.

This was generated by the following Python script and failures were
manually fixed up:

import sys
for i in sys.argv:
    with open(i, 'r') as f:
        s = f.read()
    with open(i, 'w') as f:
        for l in s.splitlines():
            if "RUN:" in l and ' -analyze ' in l and '\\' not in l:
                f.write(l.replace(' -analyze ', ' -analyze -enable-new-pm=0 '))
                f.write('\n')
                f.write(l.replace(' -analyze ', ' -disable-output ').replace(' -scalar-evolution ', ' "-passes=print<scalar-evolution>" ').replace(" | ", " 2>&1 | "))
                f.write('\n')
            else:
                f.write(l)

There are a couple failures still in ScalarEvolution under NPM, but
those are due to other unrelated naming conflicts.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D83798
  • Loading branch information
aeubanks committed Jul 16, 2020
1 parent f7868f8 commit 9adbb5c
Show file tree
Hide file tree
Showing 154 changed files with 318 additions and 162 deletions.
5 changes: 5 additions & 0 deletions llvm/lib/Analysis/ScalarEvolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11937,6 +11937,11 @@ ScalarEvolutionVerifierPass::run(Function &F, FunctionAnalysisManager &AM) {

PreservedAnalyses
ScalarEvolutionPrinterPass::run(Function &F, FunctionAnalysisManager &AM) {
// For compatibility with opt's -analyze feature under legacy pass manager
// which was not ported to NPM. This keeps tests using
// update_analyze_test_checks.py working.
OS << "Printing analysis 'Scalar Evolution Analysis' for function '"
<< F.getName() << "':\n";
AM.getResult<ScalarEvolutionAnalysis>(F).print(OS);
return PreservedAnalyses::all();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR1533

@array = weak global [101 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=1]
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
; RUN: opt < %s -scalar-evolution -analyze -enable-new-pm=0 | FileCheck %s
; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s
; PR1597

; CHECK: Loop %bb: backedge-taken count is (-1 + (-1 * %x) + %y)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR1706

; CHECK: backedge-taken count is 13
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
; PR1810

define void @fun() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
; RUN: opt < %s -scalar-evolution -analyze -enable-new-pm=0 | FileCheck %s
; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s

; CHECK: Loop %header: backedge-taken count is (0 smax %n)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
; RUN: opt < %s -scalar-evolution -analyze -enable-new-pm=0 | FileCheck %s
; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s
; PR2002

; CHECK: Loop %loop: backedge-taken count is (100 + (-100 smax %n))
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
; PR2003

; CHECK: umax
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR2364

; CHECK: backedge-taken count is 61
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution 2>/dev/null
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution 2>/dev/null
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>/dev/null
; PR2433

define i32 @main1(i32 %argc, i8** %argv) nounwind {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 2>&1 | FileCheck %s
; PR2261

; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'foo'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 2>&1 | FileCheck %s
; PR2070

; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'a'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR2088

; CHECK: Unpredictable
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR2088

; CHECK: backedge-taken count is 113
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution \
; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR2607

define i32 @_Z1aj(i32 %j) nounwind {
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution \
; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR2607

define i32 @b(i32 %x, i32 %y) nounwind {
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution \
; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR2621

define i32 @a() nounwind {
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution \
; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s
; PR2621

define i32 @a() nounwind {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution
; RUN: opt < %s -disable-output -scalar-evolution
; PR1827

declare void @use(i32)
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2008-11-15-CubicOOM.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution
; RUN: opt < %s -disable-output -scalar-evolution
; PR2602

define i32 @a() nounwind {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 2>&1 | FileCheck %s

; CHECK: Loop %bb: backedge-taken count is (7 + (-1 * %argc))

Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s

; CHECK: Loop %bb: backedge-taken count is ((-5 + %x) /u 3)
; CHECK: Loop %bb: max backedge-taken count is 1431655764
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 2>&1 | FileCheck %s

; CHECK: Loop %bb: backedge-taken count is ((999 + (-1 * %x)) /u 3)
; CHECK: Loop %bb: max backedge-taken count is 334
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s

; CHECK: backedge-taken count is 255

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s

; CHECK: @f
; CHECK: Loop %bb16.preheader: backedge-taken count is (-1 + %c.idx.val)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 2>&1 | FileCheck %s
; XFAIL: *

; CHECK: (((-1 * %i0) + (100005 smax %i0)) /u 5)
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution 2>&1 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 2>&1 | FileCheck %s

; CHECK: /u 5

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
; PR3275

; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'func_15'
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s

; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test1'
; CHECK-NOT: (trunc i{{.*}}ext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
; PR3171

; CHECK: count is 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution
; RUN: opt < %s -disable-output -scalar-evolution
; PR4501

define void @test() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt -indvars -scalar-evolution -analyze < %s | FileCheck %s
; RUN: opt -indvars -scalar-evolution -analyze -enable-new-pm=0 < %s | FileCheck %s
; RUN: opt "-passes=loop(indvars),print<scalar-evolution>" -disable-output < %s 2>&1 | FileCheck %s
; This test checks if the SCEV analysis is printed out at all.
; It failed once as the RequiredTransitive option was not implemented
; correctly.
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2011-04-26-FoldAddRec.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -iv-users
; RUN: opt < %s -analyze -enable-new-pm=0 -iv-users
; RUN: opt < %s -disable-output -iv-users
; RUN: opt < %s -passes='print<iv-users>'
; PR9633: Tests that SCEV handles the mul.i2 recurrence being folded to
; constant zero.
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/2011-10-04-ConstEvolve.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s

; Exercise getConstantEvolvingPHIOperands on an interesting loop.
; This should complete in milliseconds, not minutes.
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 2>&1 | FileCheck %s

; PR1101

Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/ZeroStep.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt -analyze -scalar-evolution < %s -o - -S | FileCheck %s
; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s -o - -S | FileCheck %s
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s -o - -S 2>&1 | FileCheck %s

target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt < %s -S -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -S -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -S -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s

; Reduced from test-suite/MultiSource/Benchmarks/MiBench/office-ispell/correct.c
; getelementptr, obviously, takes pointer as it's base, and returns a pointer.
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/add-like-or.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt < %s -S -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -S -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -S -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s

define i8 @or-of-constant-with-no-common-bits-set(i8 %x, i8 %y) {
; CHECK-LABEL: 'or-of-constant-with-no-common-bits-set'
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/and-xor.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
; RUN: opt < %s -scalar-evolution -analyze -enable-new-pm=0 | FileCheck %s
; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s

; CHECK-LABEL: @test1
; CHECK: --> (zext
Expand Down
5 changes: 3 additions & 2 deletions llvm/test/Analysis/ScalarEvolution/avoid-assume-hang.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt %s -always-inline | opt -analyze -scalar-evolution
; RUN: opt %s -always-inline | opt -analyze -enable-new-pm=0 -scalar-evolution
; RUN: opt %s -always-inline 2>&1 | opt -disable-output -scalar-evolution
; There was optimization bug in ScalarEvolution, that causes too long
; compute time and stack overflow crash.

Expand Down Expand Up @@ -136,4 +137,4 @@ loop:

exit:
ret void
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution
; RUN: opt < %s -disable-output -scalar-evolution
; PR4537

; ModuleID = 'b.bc'
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/avoid-smax-0.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
; RUN: opt < %s -scalar-evolution -analyze -enable-new-pm=0 | FileCheck %s
; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s

; CHECK: Loop %bb3: backedge-taken count is (-1 + %n)

Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/avoid-smax-1.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution -S | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution -S | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -S 2>&1 | FileCheck %s

; Indvars should be able to find the trip count for the bb6 loop
; without using a maximum calculation (icmp, select) because it should
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/binomial-explision.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"

Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/constant_condition.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s

define i32 @branch_true(i32 %x, i32 %y) {
; CHECK-LABEL: Classifying expressions for: @branch_true
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s

; This test set ensures that we can correctly operate with recurrencies from
; different loops.
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/div-overflow.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
; RUN: opt < %s -scalar-evolution -analyze -enable-new-pm=0 | FileCheck %s
; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s

; CHECK: --> ((-128 * %a) /u -128)

Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/do-loop.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
; PR1614

; CHECK: smax
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt -analyze -scalar-evolution %s | FileCheck %s
; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution %s | FileCheck %s
; RUN: opt -disable-output "-passes=print<scalar-evolution>" %s 2>&1 | FileCheck %s

target triple = "x86_64-unknown-linux-gnu"

Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/exact_iter_count.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
; RUN: opt < %s -scalar-evolution -analyze -enable-new-pm=0 | FileCheck %s
; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s

; One side exit dominating the latch, exact backedge taken count is known.
define void @test_01() {
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/exhaustive-trip-counts.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Analysis/ScalarEvolution/exponential-behavior.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s

; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'f':

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -S -analyze -scalar-evolution < %s | FileCheck %s
; RUN: opt -S -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
; RUN: opt -S -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s

; The obvious case.
define i32 @div(i32 %val) nounwind {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -S -analyze -scalar-evolution < %s | FileCheck %s
; RUN: opt -S -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
; RUN: opt -S -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s

; These testcases aren't *identical* but they have the same/similar meaning.

Expand Down
Loading

0 comments on commit 9adbb5c

Please sign in to comment.