blob: 094932933fbc6097e530415f0069ecda8059d028 [file] [log] [blame]
Colin LeMahieub8575b12015-06-13 21:46:39 +00001; RUN: llc -march=hexagon < %s | FileCheck %s
2; CHECK: r{{[0-9]+}} = add(r{{[0-9]+}}.{{L|l}}, r{{[0-9]+}}.{{H|h}})
3
4target 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"
5target triple = "hexagon-unknown-none"
6
Sjoerd Meijer520a18d2016-09-13 08:51:59 +00007%struct.aDataType = type { i16, i16, i16, i16, i16, i16*, i16*, i16*, i8*, i16*, i16*, i16*, i8* }
Colin LeMahieub8575b12015-06-13 21:46:39 +00008
Sjoerd Meijer520a18d2016-09-13 08:51:59 +00009define i8* @a_get_score(%struct.aDataType* nocapture %pData, i16 signext %gmmModelIndex, i16* nocapture %pGmmScoreL16Q4) #0 {
10entry:
11 %numSubVector = getelementptr inbounds %struct.aDataType, %struct.aDataType* %pData, i32 0, i32 3
12 %0 = load i16, i16* %numSubVector, align 2, !tbaa !0
13 %and = and i16 %0, -4
14 %b = getelementptr inbounds %struct.aDataType, %struct.aDataType* %pData, i32 0, i32 8
15 %1 = load i8*, i8** %b, align 4, !tbaa !3
Colin LeMahieub8575b12015-06-13 21:46:39 +000016 %conv3 = sext i16 %and to i32
Sjoerd Meijer520a18d2016-09-13 08:51:59 +000017 %cmp21 = icmp sgt i16 %and, 0
18 br i1 %cmp21, label %for.inc.preheader, label %for.end
19
20for.inc.preheader: ; preds = %entry
21 br label %for.inc
22
23for.inc: ; preds = %for.inc.preheader, %for.inc
24 %j.022 = phi i32 [ %phitmp, %for.inc ], [ 0, %for.inc.preheader ]
25 %add13 = mul i32 %j.022, 65536
Colin LeMahieub8575b12015-06-13 21:46:39 +000026 %sext = add i32 %add13, 262144
27 %phitmp = ashr exact i32 %sext, 16
Sjoerd Meijer520a18d2016-09-13 08:51:59 +000028 %cmp = icmp slt i32 %phitmp, %conv3
29 br i1 %cmp, label %for.inc, label %for.end.loopexit
Colin LeMahieub8575b12015-06-13 21:46:39 +000030
Sjoerd Meijer520a18d2016-09-13 08:51:59 +000031for.end.loopexit: ; preds = %for.inc
32 br label %for.end
33
34for.end: ; preds = %for.end.loopexit, %entry
35 ret i8* %1
36}
Sjoerd Meijer05453992016-09-13 08:08:06 +000037
Colin LeMahieub8575b12015-06-13 21:46:39 +000038attributes #0 = { nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
39
40!0 = !{!"short", !1}
41!1 = !{!"omnipotent char", !2}
42!2 = !{!"Simple C/C++ TBAA"}
43!3 = !{!"any pointer", !1}