xref: /llvm-project/llvm/test/Other/debugcounter-newgvn.ll (revision d46e37348ec3f8054b10bcbbe7c11149d7f61031)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; REQUIRES: asserts
3; RUN: opt -S -debug-counter=newgvn-vn=1-2 -passes=newgvn  < %s 2>&1 | FileCheck %s
4;; Test that, with debug counters on, we don't value number the first instruction, only the second and third,
5;; which means we do not discover the return is constant.
6define i32 @vntest() {
7; CHECK-LABEL: @vntest(
8; CHECK-NEXT:  bb:
9; CHECK-NEXT:    [[A:%.*]] = add i32 1, 3
10; CHECK-NEXT:    [[D:%.*]] = add i32 8, 8
11; CHECK-NEXT:    ret i32 [[D]]
12;
13bb:
14  %a = add i32 1, 3
15  %b = add i32 %a, %a
16  %c = add i32 %a, %a
17  %d = add i32 %b, %c
18  ret i32 %d
19}
20
21
22
23