diff options
author | Sanjay Patel <spatel@rotateright.com> | 2019-01-31 22:33:11 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2019-01-31 22:33:11 +0000 |
commit | d16ca2fcbed759d39c724a1bf28b9c966dee6e03 (patch) | |
tree | f4bd8ce8737f46526ce3b6106e910dad6c060ac1 | |
parent | 9560b79fb04e955d130fd2f923c86c9c6ab78a0d (diff) | |
download | bcm5719-llvm-d16ca2fcbed759d39c724a1bf28b9c966dee6e03.tar.gz bcm5719-llvm-d16ca2fcbed759d39c724a1bf28b9c966dee6e03.zip |
[x86] add test for missed opportunity to use 'inc'; NFC
llvm-svn: 352805
-rw-r--r-- | llvm/test/CodeGen/X86/slow-incdec.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/slow-incdec.ll b/llvm/test/CodeGen/X86/slow-incdec.ll index 5e466f99a38..05ec82e505a 100644 --- a/llvm/test/CodeGen/X86/slow-incdec.ll +++ b/llvm/test/CodeGen/X86/slow-incdec.ll @@ -53,3 +53,33 @@ define i32 @dec_size(i32 %x) optsize { %r = add i32 %x, -1 ret i32 %r } + +declare {i32, i1} @llvm.uadd.with.overflow.i32(i32, i32) +declare void @other(i32* ) nounwind; + +define void @cond_ae_to_cond_ne(i32* %p) nounwind { +; CHECK-LABEL: cond_ae_to_cond_ne: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax +; CHECK-NEXT: addl $1, (%eax) +; CHECK-NEXT: jae .LBB4_1 +; CHECK-NEXT: # %bb.2: # %if.end4 +; CHECK-NEXT: jmp other # TAILCALL +; CHECK-NEXT: .LBB4_1: # %return +; CHECK-NEXT: retl +entry: + %t0 = load i32, i32* %p, align 8 + %add_ov = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %t0, i32 1) + %inc = extractvalue { i32, i1 } %add_ov, 0 + store i32 %inc, i32* %p, align 8 + %ov = extractvalue { i32, i1 } %add_ov, 1 + br i1 %ov, label %if.end4, label %return + +if.end4: + tail call void @other(i32* %p) nounwind + br label %return + +return: + ret void +} + |