23 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; REQUIRES: asserts3; RUN: opt -S -debug-counter=newgvn-vn=1-2 -passes=newgvn < %s 2>&1 | FileCheck %s4;; 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, 310; CHECK-NEXT: [[D:%.*]] = add i32 8, 811; CHECK-NEXT: ret i32 [[D]]12;13bb:14 %a = add i32 1, 315 %b = add i32 %a, %a16 %c = add i32 %a, %a17 %d = add i32 %b, %c18 ret i32 %d19}20 21 22 23