bugAsmHWloop.ll
2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
; RUN: llc -march=hexagon < %s | FileCheck %s
; CHECK: {
; CHECK: loop0(.LBB
; CHECK-NOT: loop0(##.LBB
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
target triple = "hexagon"
define i32 @q6zip_uncompress(i8* %out_buf, i32* %out_buf_size, i8* %in_buf, i32 %in_buf_size, i8* nocapture %dict, i32 %dict_size) nounwind {
entry:
%0 = bitcast i8* %in_buf to i32*
%incdec.ptr = getelementptr inbounds i8, i8* %in_buf, i32 4
%1 = load i32, i32* %0, align 4, !tbaa !0
%2 = ptrtoint i8* %incdec.ptr to i32
%and.i = and i32 %2, 31
%sub.i = sub i32 %2, %and.i
%3 = inttoptr i32 %sub.i to i8*
%add.i = add i32 %in_buf_size, 31
%sub2.i = add i32 %add.i, %and.i
%div.i = lshr i32 %sub2.i, 5
%4 = tail call i32 @llvm.hexagon.A2.combine.ll(i32 32, i32 %div.i) nounwind
%5 = tail call i64 @llvm.hexagon.A4.combineir(i32 32, i32 %4) nounwind
tail call void asm sideeffect "l2fetch($0,$1)", "r,r,~{memory}"(i8* %3, i64 %5) nounwind, !srcloc !3
%6 = ptrtoint i8* %out_buf to i32
br label %for.body.i
for.body.i: ; preds = %for.body.i, %entry
%i.02.i = phi i32 [ 0, %entry ], [ %inc.i, %for.body.i ]
%addr.addr.01.i = phi i32 [ %6, %entry ], [ %add.i14, %for.body.i ]
tail call void asm sideeffect "dczeroa($0)", "r"(i32 %addr.addr.01.i) nounwind, !srcloc !4
%add.i14 = add i32 %addr.addr.01.i, 32
%inc.i = add i32 %i.02.i, 1
%exitcond.i = icmp eq i32 %inc.i, 128
br i1 %exitcond.i, label %while.cond.preheader, label %for.body.i
while.cond.preheader: ; preds = %for.body.i
%and = and i32 %1, 3
switch i32 %and, label %infloop.preheader [
i32 0, label %exit_inflate.split
i32 2, label %if.then.preheader
]
if.then.preheader: ; preds = %while.cond.preheader
br label %if.then
infloop.preheader: ; preds = %while.cond.preheader
br label %infloop
if.then: ; preds = %if.then.preheader, %if.then
tail call void @llvm.prefetch(i8* %incdec.ptr, i32 0, i32 3, i32 1)
br label %if.then
exit_inflate.split: ; preds = %while.cond.preheader
ret i32 0
infloop: ; preds = %infloop.preheader, %infloop
br label %infloop
}
declare void @llvm.prefetch(i8* nocapture, i32, i32, i32) nounwind
declare i64 @llvm.hexagon.A4.combineir(i32, i32) nounwind readnone
declare i32 @llvm.hexagon.A2.combine.ll(i32, i32) nounwind readnone
!0 = !{!"long", !1}
!1 = !{!"omnipotent char", !2}
!2 = !{!"Simple C/C++ TBAA"}
!3 = !{i32 18362}
!4 = !{i32 18893}