1; RUN: opt -basic-aa -loop-versioning -S < %s | FileCheck %s 2 3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 4 5; Do not version this loop because of a convergent operation 6 7; CHECK-LABEL: @f( 8; CHECK: call i32 @llvm.convergent( 9; CHECK-NOT: call i32 @llvm.convergent( 10define void @f(i32* %a, i32* %b, i32* %c) #0 { 11entry: 12 br label %for.body 13 14for.body: ; preds = %for.body, %entry 15 %ind = phi i64 [ 0, %entry ], [ %add, %for.body ] 16 17 %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind 18 %loadA = load i32, i32* %arrayidxA, align 4 19 20 %arrayidxB = getelementptr inbounds i32, i32* %b, i64 %ind 21 %loadB = load i32, i32* %arrayidxB, align 4 22 %convergentB = call i32 @llvm.convergent(i32 %loadB) 23 24 %mulC = mul i32 %loadA, %convergentB 25 26 %arrayidxC = getelementptr inbounds i32, i32* %c, i64 %ind 27 store i32 %mulC, i32* %arrayidxC, align 4 28 29 %add = add nuw nsw i64 %ind, 1 30 %exitcond = icmp eq i64 %add, 20 31 br i1 %exitcond, label %for.end, label %for.body 32 33for.end: ; preds = %for.body 34 ret void 35} 36 37declare i32 @llvm.convergent(i32) #1 38 39attributes #0 = { nounwind convergent } 40attributes #1 = { nounwind readnone convergent } 41