1; RUN: opt -basicaa -gvn -S < %s | FileCheck %s 2 3target datalayout = "e-p:64:64:64" 4 5; CHECK-LABEL: @foo( 6; CHECK: entry.end_crit_edge: 7; CHECK: %n.pre = load i32, i32* %q.phi.trans.insert 8; CHECK: then: 9; CHECK: store i32 %z 10; CHECK: end: 11; CHECK: %n = phi i32 [ %n.pre, %entry.end_crit_edge ], [ %z, %then ] 12; CHECK: ret i32 %n 13 14@G = external global [100 x i32] 15define i32 @foo(i32 %x, i32 %z) { 16entry: 17 %tobool = icmp eq i32 %z, 0 18 br i1 %tobool, label %end, label %then 19 20then: 21 %i = sext i32 %x to i64 22 %p = getelementptr [100 x i32], [100 x i32]* @G, i64 0, i64 %i 23 store i32 %z, i32* %p 24 br label %end 25 26end: 27 %j = sext i32 %x to i64 28 %q = getelementptr [100 x i32], [100 x i32]* @G, i64 0, i64 %j 29 %n = load i32, i32* %q 30 ret i32 %n 31} 32