xref: /llvm-project/llvm/test/Transforms/Util/local-dbg-print.ll (revision 23caf9e9e70464340ca490a0c75af0eeadcb981c)
1; REQUIRES: asserts
2; RUN: opt -passes=gvn -debug-only=local -disable-output 2>&1 < %s | FileCheck %s
3
4define void @replaceDominatedUsesWith_debug(ptr nocapture writeonly %a, i32 %beam) {
5; CHECK: Replace dominated use of 'i64 %indvars.iv' with   %0 = zext i32 %beam to i64 in   %1 = shl nuw nsw i64 %indvars.iv, 1
6entry:
7  %0 = zext i32 %beam to i64
8  br label %for.body
9
10for.cond.cleanup:                                 ; preds = %for.inc
11  ret void
12
13for.body:                                         ; preds = %entry, %for.inc
14  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ]
15  %cmp1 = icmp eq i64 %indvars.iv, %0
16  br i1 %cmp1, label %if.then, label %if.else
17
18if.then:                                          ; preds = %for.body
19  %1 = shl nuw nsw i64 %indvars.iv, 1
20  %arrayidx = getelementptr inbounds i32, ptr %a, i64 %1
21  store i32 0, ptr %arrayidx, align 4
22  br label %for.inc
23
24if.else:                                          ; preds = %for.body
25  %2 = shl nuw nsw i64 %indvars.iv, 1
26  %arrayidx4 = getelementptr inbounds i32, ptr %a, i64 %2
27  store i32 1, ptr %arrayidx4, align 4
28  br label %for.inc
29
30for.inc:                                          ; preds = %if.then, %if.else
31  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
32  %exitcond.not = icmp eq i64 %indvars.iv.next, 10000
33  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
34}
35