• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; REQUIRES: asserts
2
3; RUN: opt -S -debug-counter=early-cse-skip=1,early-cse-count=1 -early-cse -earlycse-debug-hash \
4; RUN:        -debug-counter=newgvn-vn-skip=1,newgvn-vn-count=2 -newgvn \
5; RUN:        -instcombine -print-debug-counter < %s 2>&1 | FileCheck %s
6;; Test debug counter prints correct info in right order.
7; CHECK-LABEL: Counters and values:
8; CHECK:       early-cse
9; CHECK-SAME:  {4,1,1}
10; CHECK:       instcombine-visit
11; CHECK-SAME:  {12,0,-1}
12; CHECK:       newgvn-vn
13; CHECK-SAME:  {9,1,2}
14define i32 @f1(i32 %a, i32 %b) {
15bb:
16  %add1 = add i32 %a, %b
17  %add2 = add i32 %a, %b
18  %add3 = add i32 %a, %b
19  %add4 = add i32 %a, %b
20  %ret1 = add i32 %add1, %add2
21  %ret2 = add i32 %add3, %add4
22  %ret = add i32 %ret1, %ret2
23  ret i32 %ret
24}
25
26define i32 @f2(i32 %a, i32 %b) {
27bb:
28  %add1 = add i32 %a, %b
29  %add2 = add i32 %a, %b
30  %ret = add i32 %add1, %add2
31  ret i32 %ret
32}
33