blob: 2a3d30a95492f838519d8fbcf0036aa644584fe9 [file] [log] [blame]
Reed Kotlerb0ee97a2013-06-09 23:23:46 +00001; RUN: llc -march=mipsel -mcpu=mips16 -relocation-model=pic < %s | FileCheck %s -check-prefix=cmp16
2
Reed Kotler71f28bf2013-06-22 19:35:08 +00003target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"
4target triple = "mipsel--linux-gnu"
Reed Kotlerb0ee97a2013-06-09 23:23:46 +00005
Reed Kotler71f28bf2013-06-22 19:35:08 +00006%struct.StorablePicture = type { i32, i32, i32, i32 }
Reed Kotlerb0ee97a2013-06-09 23:23:46 +00007
Reed Kotler71f28bf2013-06-22 19:35:08 +00008
9
10define void @getSubImagesLuma(%struct.StorablePicture* nocapture %s) #0 {
Reed Kotlerb0ee97a2013-06-09 23:23:46 +000011entry:
Reed Kotler71f28bf2013-06-22 19:35:08 +000012 %size_y = getelementptr inbounds %struct.StorablePicture* %s, i32 0, i32 1
Manman Renaef1b372013-09-30 18:17:35 +000013 %0 = load i32* %size_y, align 4
Reed Kotler71f28bf2013-06-22 19:35:08 +000014 %sub = add nsw i32 %0, -1
15 %add5 = add nsw i32 %0, 20
16 %cmp6 = icmp sgt i32 %add5, -20
17 br i1 %cmp6, label %for.body, label %for.end
Reed Kotlerb0ee97a2013-06-09 23:23:46 +000018
Reed Kotler71f28bf2013-06-22 19:35:08 +000019for.body: ; preds = %entry, %for.body
20 %j.07 = phi i32 [ %inc, %for.body ], [ -20, %entry ]
21 %call = tail call i32 bitcast (i32 (...)* @iClip3 to i32 (i32, i32, i32)*)(i32 0, i32 %sub, i32 %j.07) #2
22 %inc = add nsw i32 %j.07, 1
Manman Renaef1b372013-09-30 18:17:35 +000023 %1 = load i32* %size_y, align 4
Reed Kotler71f28bf2013-06-22 19:35:08 +000024 %add = add nsw i32 %1, 20
25 %cmp = icmp slt i32 %inc, %add
26 br i1 %cmp, label %for.body, label %for.end
Reed Kotlerb0ee97a2013-06-09 23:23:46 +000027
Reed Kotler71f28bf2013-06-22 19:35:08 +000028for.end: ; preds = %for.body, %entry
Reed Kotlerb0ee97a2013-06-09 23:23:46 +000029 ret void
30}
31
Reed Kotler71f28bf2013-06-22 19:35:08 +000032; cmp16: .ent getSubImagesLuma
33; cmp16: .end getSubImagesLuma
34declare i32 @iClip3(...) #1
Reed Kotlerb0ee97a2013-06-09 23:23:46 +000035
Bill Wendling80075c42013-08-22 21:28:54 +000036attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
37attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
Reed Kotler71f28bf2013-06-22 19:35:08 +000038attributes #2 = { nounwind }