Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc < %s -mtriple=arm-apple-ios5.0 | FileCheck %s
      2 
      3 define void @foo(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp {
      4 entry:
      5 ; CHECK: foo:
      6 ; CHECK: bl ___divmodsi4
      7 ; CHECK-NOT: bl ___divmodsi4
      8   %div = sdiv i32 %x, %y
      9   store i32 %div, i32* %P, align 4
     10   %rem = srem i32 %x, %y
     11   %arrayidx6 = getelementptr inbounds i32* %P, i32 1
     12   store i32 %rem, i32* %arrayidx6, align 4
     13   ret void
     14 }
     15 
     16 define void @bar(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp {
     17 entry:
     18 ; CHECK: bar:
     19 ; CHECK: bl ___udivmodsi4
     20 ; CHECK-NOT: bl ___udivmodsi4
     21   %div = udiv i32 %x, %y
     22   store i32 %div, i32* %P, align 4
     23   %rem = urem i32 %x, %y
     24   %arrayidx6 = getelementptr inbounds i32* %P, i32 1
     25   store i32 %rem, i32* %arrayidx6, align 4
     26   ret void
     27 }
     28 
     29 ; rdar://9280991
     30 @flags = external unnamed_addr global i32
     31 @tabsize = external unnamed_addr global i32
     32 
     33 define void @do_indent(i32 %cols) nounwind {
     34 entry:
     35 ; CHECK: do_indent:
     36   %0 = load i32* @flags, align 4
     37   %1 = and i32 %0, 67108864
     38   %2 = icmp eq i32 %1, 0
     39   br i1 %2, label %bb1, label %bb
     40 
     41 bb:
     42 ; CHECK: bl ___divmodsi4
     43   %3 = load i32* @tabsize, align 4
     44   %4 = srem i32 %cols, %3
     45   %5 = sdiv i32 %cols, %3
     46   %6 = tail call i32 @llvm.objectsize.i32(i8* null, i1 false)
     47   %7 = tail call i8* @__memset_chk(i8* null, i32 9, i32 %5, i32 %6) nounwind
     48   br label %bb1
     49 
     50 bb1:
     51   %line_indent_len.0 = phi i32 [ %4, %bb ], [ 0, %entry ]
     52   %8 = getelementptr inbounds i8* null, i32 %line_indent_len.0
     53   store i8 0, i8* %8, align 1
     54   ret void
     55 }
     56 
     57 declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readnone
     58 declare i8* @__memset_chk(i8*, i32, i32, i32) nounwind
     59