1; RUN: opt %loadPolly -basic-aa -polly-codegen -S < %s | FileCheck %s 2; 3; Verify that we remove the misc intrinsics from the optimized SCoP. 4; 5; CHECK: for.body: 6; CHECK: call {}* @llvm.invariant.start 7; CHECK: for.body4: 8; CHECK: call void @llvm.assume 9; CHECK: call i1 @llvm.expect.i1 10; CHECK: call void @llvm.donothing 11; CHECK: for.end: 12; CHECK: call void @llvm.invariant.end 13; CHECK-NOT: call void @llvm.{{.*}} 14; 15; int A[1024]; 16; void jd() { 17; for (int i = 0; i < 1024; i++) { 18; int tmp[1024]; 19; for (int j = i; j < 1024; j++) 20; tmp[i] += A[j]; 21; A[i] = tmp[i]; 22; } 23; } 24; 25; ModuleID = 'test/Isl/CodeGen/lifetime_intrinsics.ll' 26target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 27 28@A = common global [1024 x i32] zeroinitializer, align 16 29 30; Function Attrs: nounwind uwtable 31define void @jd() #0 { 32entry: 33 %tmp = alloca [1024 x i32], align 16 34 %tmp3 = bitcast [1024 x i32]* @A to i8* 35 br label %for.cond 36 37for.cond: ; preds = %for.inc11, %entry 38 %indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc11 ], [ 0, %entry ] 39 %exitcond5 = icmp ne i64 %indvars.iv3, 1024 40 br i1 %exitcond5, label %for.body, label %for.end13 41 42for.body: ; preds = %for.cond 43 %lis = call {}* @llvm.invariant.start(i64 4096, i8* %tmp3) #1 44 br label %for.cond2 45 46for.cond2: ; preds = %for.inc, %for.body 47 %indvars.iv1 = phi i64 [ %indvars.iv.next2, %for.inc ], [ %indvars.iv3, %for.body ] 48 %lftr.wideiv = trunc i64 %indvars.iv1 to i32 49 %exitcond = icmp ne i32 %lftr.wideiv, 1024 50 br i1 %exitcond, label %for.body4, label %for.end 51 52for.body4: ; preds = %for.cond2 53 call void @llvm.assume(i1 %exitcond) 54 call i1 @llvm.expect.i1(i1 %exitcond, i1 1) 55 %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv1 56 %tmp6 = load i32, i32* %arrayidx, align 4 57 %arrayidx6 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3 58 call void @llvm.donothing() 59 %tmp7 = load i32, i32* %arrayidx6, align 4 60 %add = add nsw i32 %tmp7, %tmp6 61 store i32 %add, i32* %arrayidx6, align 4 62 br label %for.inc 63 64for.inc: ; preds = %for.body4 65 %indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1 66 br label %for.cond2 67 68for.end: ; preds = %for.cond2 69 %arrayidx8 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3 70 %tmp8 = load i32, i32* %arrayidx8, align 4 71 %arrayidx10 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv3 72 call void @llvm.invariant.end({}* %lis, i64 4096, i8* %tmp3) #1 73 store i32 %tmp8, i32* %arrayidx10, align 4 74 br label %for.inc11 75 76for.inc11: ; preds = %for.end 77 %indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1 78 br label %for.cond 79 80for.end13: ; preds = %for.cond 81 ret void 82} 83 84; Function Attrs: nounwind 85declare void @llvm.donothing() #1 86 87; Function Attrs: nounwind 88declare void @llvm.assume(i1) #1 89 90; Function Attrs: nounwind 91declare i1 @llvm.expect.i1(i1, i1) #1 92 93; Function Attrs: nounwind 94declare {}* @llvm.invariant.start(i64, i8* nocapture) #1 95 96; Function Attrs: nounwind 97declare void @llvm.invariant.end({}*, i64, i8* nocapture) #1 98 99attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" "use-soft-float"="false" } 100attributes #1 = { nounwind } 101