; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
; RUN: opt < %s -S | FileCheck %s
; A test that hits the quadratic runtime prevention in the diff algorithm and
; a more complex case of name conflict avoidance.
define i32 @func(i32 %x) {
; CHECK-LABEL: define i32 @func(
; CHECK-SAME: i32 [[X:%.*]]) {
; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X]], 3
; CHECK-NEXT: [[TMP2:%.*]] = call i32 @foo(i32 [[TMP1]])
; CHECK-NEXT: [[TMP3:%.*]] = call i32 @foo(i32 [[TMP2]])
; CHECK-NEXT: [[TMP4:%.*]] = call i32 @foo(i32 [[TMP3]])
; CHECK-NEXT: [[TMP5:%.*]] = call i32 @foo(i32 [[TMP4]])
; CHECK-NEXT: [[TMP6:%.*]] = call i32 @foo(i32 [[TMP5]])
; CHECK-NEXT: [[TMP7:%.*]] = call i32 @foo(i32 [[TMP6]])
; CHECK-NEXT: [[TMP8:%.*]] = xor i32 [[TMP7]], 1
; CHECK-NEXT: [[TMP13:%.*]] = call i32 @foo(i32 [[TMP8]])
; CHECK-NEXT: [[TMP9:%.*]] = add i32 [[TMP13]], 1
; CHECK-NEXT: [[TMP10:%.*]] = call i32 @foo(i32 [[TMP9]])
; CHECK-NEXT: [[TMP11:%.*]] = call i32 @foo(i32 [[TMP10]])
; CHECK-NEXT: [[TMP12:%.*]] = call i32 @foo(i32 [[TMP11]])
; CHECK-NEXT: ret i32 [[TMP12]]
;
%1 = mul i32 %x, 3
%2 = call i32 @foo(i32 %1)
%3 = call i32 @foo(i32 %2)
%4 = call i32 @foo(i32 %3)
%5 = call i32 @foo(i32 %4)
%6 = call i32 @foo(i32 %5)
%7 = call i32 @foo(i32 %6)
%8 = xor i32 %7, 1
%9 = call i32 @foo(i32 %8)
%10 = add i32 %9, 1
%11 = call i32 @foo(i32 %10)
%12 = call i32 @foo(i32 %11)
%13 = call i32 @foo(i32 %12)
ret i32 %13
}
declare i32 @foo(i1)