[PowerPC] Do not emit record-form rotates when record-form andi/andis suffices
[llvm-core.git] / test / CodeGen / Hexagon / swiz.ll
blob14776cc13ef1a85763b2837cb87110abab2bc3ed
1 ; RUN: llc -march=hexagon < %s | FileCheck %s
2 ; CHECK: swiz
4 target triple = "hexagon"
6 %s.0 = type { [4 x i32], [2 x i32], [64 x i8] }
8 ; Function Attrs: nounwind
9 define void @f0(%s.0* nocapture %a0, i8* nocapture %a1, i32 %a2) #0 {
10 b0:
11   %v0 = getelementptr inbounds %s.0, %s.0* %a0, i32 0, i32 2, i32 0
12   br label %b1
14 b1:                                               ; preds = %b1, %b0
15   %v1 = phi i16 [ 16, %b0 ], [ %v22, %b1 ]
16   %v2 = phi i8* [ %v0, %b0 ], [ %v21, %b1 ]
17   %v3 = getelementptr inbounds i8, i8* %v2, i32 3
18   %v4 = load i8, i8* %v3, align 1, !tbaa !0
19   %v5 = zext i8 %v4 to i32
20   %v6 = shl nuw nsw i32 %v5, 8
21   %v7 = getelementptr inbounds i8, i8* %v2, i32 2
22   %v8 = load i8, i8* %v7, align 1, !tbaa !0
23   %v9 = zext i8 %v8 to i32
24   %v10 = or i32 %v6, %v9
25   %v11 = shl nuw i32 %v10, 16
26   %v12 = getelementptr inbounds i8, i8* %v2, i32 1
27   %v13 = load i8, i8* %v12, align 1, !tbaa !0
28   %v14 = zext i8 %v13 to i32
29   %v15 = shl nuw nsw i32 %v14, 8
30   %v16 = load i8, i8* %v2, align 1, !tbaa !0
31   %v17 = zext i8 %v16 to i32
32   %v18 = or i32 %v11, %v15
33   %v19 = or i32 %v18, %v17
34   %v20 = bitcast i8* %v2 to i32*
35   store i32 %v19, i32* %v20, align 4, !tbaa !3
36   %v21 = getelementptr inbounds i8, i8* %v2, i32 4
37   %v22 = add i16 %v1, -1
38   %v23 = icmp eq i16 %v22, 0
39   br i1 %v23, label %b2, label %b1
41 b2:                                               ; preds = %b1
42   ret void
45 attributes #0 = { nounwind }
47 !0 = !{!1, !1, i64 0}
48 !1 = !{!"omnipotent char", !2}
49 !2 = !{!"Simple C/C++ TBAA"}
50 !3 = !{!4, !4, i64 0}
51 !4 = !{!"int", !1}