96 lines · plain
1; RUN: llc < %s -mtriple=arm-apple-ios5.0 -mcpu=cortex-a8 | FileCheck %s -check-prefix=A82; RUN: llc < %s -mtriple=arm-apple-ios5.0 -mcpu=swift | FileCheck %s -check-prefix=SWIFT3; RUN: llc < %s -mtriple=thumbv7-apple-macho -mcpu=cortex-a8 | FileCheck %s -check-prefix=A84 5; rdar://124813956 7define void @foo(i32 %x, i32 %y, ptr nocapture %P) nounwind ssp {8entry:9; A8-LABEL: foo:10; A8: bl ___divmodsi411; A8-NOT: bl ___divmodsi412 13; SWIFT-LABEL: foo:14; SWIFT: sdiv15; SWIFT: mls16; SWIFT-NOT: bl __divmodsi417 %div = sdiv i32 %x, %y18 store i32 %div, ptr %P, align 419 %rem = srem i32 %x, %y20 %arrayidx6 = getelementptr inbounds i32, ptr %P, i32 121 store i32 %rem, ptr %arrayidx6, align 422 ret void23}24 25define void @bar(i32 %x, i32 %y, ptr nocapture %P) nounwind ssp {26entry:27; A8-LABEL: bar:28; A8: bl ___udivmodsi429; A8-NOT: bl ___udivmodsi430 31; SWIFT-LABEL: bar:32; SWIFT: udiv33; SWIFT: mls34; SWIFT-NOT: bl __udivmodsi435 %div = udiv i32 %x, %y36 store i32 %div, ptr %P, align 437 %rem = urem i32 %x, %y38 %arrayidx6 = getelementptr inbounds i32, ptr %P, i32 139 store i32 %rem, ptr %arrayidx6, align 440 ret void41}42 43; rdar://928099144@flags = external unnamed_addr global i3245@tabsize = external unnamed_addr global i3246 47define void @do_indent(i32 %cols) nounwind {48entry:49; A8-LABEL: do_indent:50; SWIFT-LABEL: do_indent:51 %0 = load i32, ptr @flags, align 452 %1 = and i32 %0, 6710886453 %2 = icmp eq i32 %1, 054 br i1 %2, label %bb1, label %bb55 56bb:57; A8: bl ___divmodsi458; SWIFT: sdiv59; SWIFT: mls60; SWIFT-NOT: bl __divmodsi461 %3 = load i32, ptr @tabsize, align 462 %4 = srem i32 %cols, %363 %5 = sdiv i32 %cols, %364 %6 = tail call i32 @llvm.objectsize.i32.p0(ptr null, i1 false)65 %7 = tail call ptr @__memset_chk(ptr null, i32 9, i32 %5, i32 %6) nounwind66 br label %bb167 68bb1:69 %line_indent_len.0 = phi i32 [ %4, %bb ], [ 0, %entry ]70 %8 = getelementptr inbounds i8, ptr null, i32 %line_indent_len.071 store i8 0, ptr %8, align 172 ret void73}74 75declare i32 @llvm.objectsize.i32.p0(ptr, i1) nounwind readnone76declare ptr @__memset_chk(ptr, i32, i32, i32) nounwind77 78; rdar://1171460779define i32 @howmany(i32 %x, i32 %y) nounwind {80entry:81; A8-LABEL: howmany:82; A8: bl ___udivmodsi483; A8-NOT: ___udivsi384 85; SWIFT-LABEL: howmany:86; SWIFT: udiv87; SWIFT: mls88; SWIFT-NOT: bl __udivmodsi489 %rem = urem i32 %x, %y90 %div = udiv i32 %x, %y91 %not.cmp = icmp ne i32 %rem, 092 %add = zext i1 %not.cmp to i3293 %cond = add i32 %add, %div94 ret i32 %cond95}96