diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-04-16 03:08:26 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-04-16 03:08:26 +0000 |
commit | 65279cb9bd985721ac6ad090fed02298396ba06d (patch) | |
tree | 90635f8faaf5ca81e97efea429fba55aa23a4e4c /test/CodeGen/ARM/divmod.ll | |
parent | 86837e8745bdfc49bd1c5d762170631704c8cf93 (diff) | |
download | llvm-65279cb9bd985721ac6ad090fed02298396ba06d.tar.gz llvm-65279cb9bd985721ac6ad090fed02298396ba06d.tar.bz2 llvm-65279cb9bd985721ac6ad090fed02298396ba06d.tar.xz |
Fix divmod libcall lowering. Convert to {S|U}DIVREM first and then expand the node to a libcall. rdar://9280991
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129633 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/divmod.ll')
-rw-r--r-- | test/CodeGen/ARM/divmod.ll | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/divmod.ll b/test/CodeGen/ARM/divmod.ll index 04b8fbf0f0..9c90a8296b 100644 --- a/test/CodeGen/ARM/divmod.ll +++ b/test/CodeGen/ARM/divmod.ll @@ -25,3 +25,34 @@ entry: store i32 %rem, i32* %arrayidx6, align 4 ret void } + +; rdar://9280991 +@flags = external unnamed_addr global i32 +@tabsize = external unnamed_addr global i32 + +define void @do_indent(i32 %cols) nounwind { +entry: +; CHECK: do_indent: + %0 = load i32* @flags, align 4 + %1 = and i32 %0, 67108864 + %2 = icmp eq i32 %1, 0 + br i1 %2, label %bb1, label %bb + +bb: +; CHECK: bl ___divmodsi4 + %3 = load i32* @tabsize, align 4 + %4 = srem i32 %cols, %3 + %5 = sdiv i32 %cols, %3 + %6 = tail call i32 @llvm.objectsize.i32(i8* null, i1 false) + %7 = tail call i8* @__memset_chk(i8* null, i32 9, i32 %5, i32 %6) nounwind + br label %bb1 + +bb1: + %line_indent_len.0 = phi i32 [ %4, %bb ], [ 0, %entry ] + %8 = getelementptr inbounds i8* null, i32 %line_indent_len.0 + store i8 0, i8* %8, align 1 + ret void +} + +declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readnone +declare i8* @__memset_chk(i8*, i32, i32, i32) nounwind |