1; RUN: opt < %s -simplifycfg -S | FileCheck %s 2 3; Checks that the SimplifyCFG pass won't duplicate a call to a function marked 4; convergent. 5; 6; CHECK: call void @barrier 7; CHECK-NOT: call void @barrier 8define void @check(i1 %cond, i32* %out) { 9entry: 10 br i1 %cond, label %if.then, label %if.end 11 12if.then: 13 store i32 5, i32* %out 14 br label %if.end 15 16if.end: 17 %x = phi i1 [ true, %entry ], [ false, %if.then ] 18 call void @barrier() 19 br i1 %x, label %cond.end, label %cond.false 20 21cond.false: 22 br label %cond.end 23 24cond.end: 25 ret void 26} 27 28declare void @barrier() convergent 29