[InstCombine] Signed saturation tests. NFC
[llvm-complete.git] / test / Transforms / LoopVectorize / PowerPC / vectorize-only-for-real.ll
blob8abc25ece35c64e08e89a9f52e4dc5ee252733e4
1 ; RUN: opt -S -loop-vectorize < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-bgq-linux"
5 ; Function Attrs: nounwind
6 define zeroext i32 @test() #0 {
7 ; CHECK-LABEL: @test
8 ; CHECK-NOT: x i32>
10 entry:
11   %a = alloca [1600 x i32], align 4
12   %c = alloca [1600 x i32], align 4
13   %0 = bitcast [1600 x i32]* %a to i8*
14   call void @llvm.lifetime.start(i64 6400, i8* %0) #3
15   br label %for.body
17 for.cond.cleanup:                                 ; preds = %for.body
18   %1 = bitcast [1600 x i32]* %c to i8*
19   call void @llvm.lifetime.start(i64 6400, i8* %1) #3
20   %arraydecay = getelementptr inbounds [1600 x i32], [1600 x i32]* %a, i64 0, i64 0
21   %arraydecay1 = getelementptr inbounds [1600 x i32], [1600 x i32]* %c, i64 0, i64 0
22   %call = call signext i32 @bar(i32* %arraydecay, i32* %arraydecay1) #3
23   br label %for.body6
25 for.body:                                         ; preds = %for.body, %entry
26   %indvars.iv25 = phi i64 [ 0, %entry ], [ %indvars.iv.next26, %for.body ]
27   %arrayidx = getelementptr inbounds [1600 x i32], [1600 x i32]* %a, i64 0, i64 %indvars.iv25
28   %2 = trunc i64 %indvars.iv25 to i32
29   store i32 %2, i32* %arrayidx, align 4
30   %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1
31   %exitcond27 = icmp eq i64 %indvars.iv.next26, 1600
32   br i1 %exitcond27, label %for.cond.cleanup, label %for.body
34 for.cond.cleanup5:                                ; preds = %for.body6
35   call void @llvm.lifetime.end(i64 6400, i8* nonnull %1) #3
36   call void @llvm.lifetime.end(i64 6400, i8* %0) #3
37   ret i32 %add
39 for.body6:                                        ; preds = %for.body6, %for.cond.cleanup
40   %indvars.iv = phi i64 [ 0, %for.cond.cleanup ], [ %indvars.iv.next, %for.body6 ]
41   %s.022 = phi i32 [ 0, %for.cond.cleanup ], [ %add, %for.body6 ]
42   %arrayidx8 = getelementptr inbounds [1600 x i32], [1600 x i32]* %c, i64 0, i64 %indvars.iv
43   %3 = load i32, i32* %arrayidx8, align 4
44   %add = add i32 %3, %s.022
45   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
46   %exitcond = icmp eq i64 %indvars.iv.next, 1600
47   br i1 %exitcond, label %for.cond.cleanup5, label %for.body6
50 ; Function Attrs: argmemonly nounwind
51 declare void @llvm.lifetime.start(i64, i8* nocapture) #1
53 ; Function Attrs: argmemonly nounwind
54 declare void @llvm.lifetime.end(i64, i8* nocapture) #1
56 declare signext i32 @bar(i32*, i32*) #2
58 attributes #0 = { nounwind "target-cpu"="a2q" "target-features"="+qpx,-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
59 attributes #1 = { argmemonly nounwind }
60 attributes #2 = { "target-cpu"="a2q" "target-features"="+qpx,-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
61 attributes #3 = { nounwind }