2 ; RUN: opt -passes=gvn -debug-only=local -disable-output 2>&1 < %s | FileCheck %s
4 define 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
7 %0 = zext i32 %beam to i64
10 for.cond.cleanup: ; preds = %for.inc
13 for.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
18 if.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
24 if.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
30 for.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