1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll
Arthur Eubanks 09cfe7939a [SCEV] Fix ScalarEvolution tests under NPM
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
2020-07-16 11:24:07 -07:00

59 lines
2.4 KiB
LLVM

; 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 {
entry:
br label %bb1
bb: ; preds = %bb1
add i16 %x17.0, 1 ; <i16>:0 [#uses=2]
add i16 %0, %x16.0 ; <i16>:1 [#uses=2]
add i16 %1, %x15.0 ; <i16>:2 [#uses=2]
add i16 %2, %x14.0 ; <i16>:3 [#uses=2]
add i16 %3, %x13.0 ; <i16>:4 [#uses=2]
add i16 %4, %x12.0 ; <i16>:5 [#uses=2]
add i16 %5, %x11.0 ; <i16>:6 [#uses=2]
add i16 %6, %x10.0 ; <i16>:7 [#uses=2]
add i16 %7, %x9.0 ; <i16>:8 [#uses=2]
add i16 %8, %x8.0 ; <i16>:9 [#uses=2]
add i16 %9, %x7.0 ; <i16>:10 [#uses=2]
add i16 %10, %x6.0 ; <i16>:11 [#uses=2]
add i16 %11, %x5.0 ; <i16>:12 [#uses=2]
add i16 %12, %x4.0 ; <i16>:13 [#uses=2]
add i16 %13, %x3.0 ; <i16>:14 [#uses=2]
add i16 %14, %x2.0 ; <i16>:15 [#uses=2]
add i16 %15, %x1.0 ; <i16>:16 [#uses=1]
add i32 %i.0, 1 ; <i32>:17 [#uses=1]
br label %bb1
bb1: ; preds = %bb, %entry
%x2.0 = phi i16 [ 0, %entry ], [ %15, %bb ] ; <i16> [#uses=1]
%x3.0 = phi i16 [ 0, %entry ], [ %14, %bb ] ; <i16> [#uses=1]
%x4.0 = phi i16 [ 0, %entry ], [ %13, %bb ] ; <i16> [#uses=1]
%x5.0 = phi i16 [ 0, %entry ], [ %12, %bb ] ; <i16> [#uses=1]
%x6.0 = phi i16 [ 0, %entry ], [ %11, %bb ] ; <i16> [#uses=1]
%x7.0 = phi i16 [ 0, %entry ], [ %10, %bb ] ; <i16> [#uses=1]
%x8.0 = phi i16 [ 0, %entry ], [ %9, %bb ] ; <i16> [#uses=1]
%x9.0 = phi i16 [ 0, %entry ], [ %8, %bb ] ; <i16> [#uses=1]
%x10.0 = phi i16 [ 0, %entry ], [ %7, %bb ] ; <i16> [#uses=1]
%x11.0 = phi i16 [ 0, %entry ], [ %6, %bb ] ; <i16> [#uses=1]
%x12.0 = phi i16 [ 0, %entry ], [ %5, %bb ] ; <i16> [#uses=1]
%x13.0 = phi i16 [ 0, %entry ], [ %4, %bb ] ; <i16> [#uses=1]
%x14.0 = phi i16 [ 0, %entry ], [ %3, %bb ] ; <i16> [#uses=1]
%x15.0 = phi i16 [ 0, %entry ], [ %2, %bb ] ; <i16> [#uses=1]
%x16.0 = phi i16 [ 0, %entry ], [ %1, %bb ] ; <i16> [#uses=1]
%x17.0 = phi i16 [ 0, %entry ], [ %0, %bb ] ; <i16> [#uses=1]
%i.0 = phi i32 [ 0, %entry ], [ %17, %bb ] ; <i32> [#uses=2]
%x1.0 = phi i16 [ 0, %entry ], [ %16, %bb ] ; <i16> [#uses=2]
icmp ult i32 %i.0, 8888 ; <i1>:18 [#uses=1]
br i1 %18, label %bb, label %bb2
bb2: ; preds = %bb1
zext i16 %x1.0 to i32 ; <i32>:19 [#uses=1]
ret i32 %19
}
; CHECK: Exits: -19168