[llvm] r371147 - [AArch64] Add testcase for codegen for sdiv by 2.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 16:40:03 PDT 2019


Author: efriedma
Date: Thu Sep  5 16:40:03 2019
New Revision: 371147

URL: http://llvm.org/viewvc/llvm-project?rev=371147&view=rev
Log:
[AArch64] Add testcase for codegen for sdiv by 2.


Modified:
    llvm/trunk/test/CodeGen/AArch64/sdivpow2.ll

Modified: llvm/trunk/test/CodeGen/AArch64/sdivpow2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/sdivpow2.ll?rev=371147&r1=371146&r2=371147&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/sdivpow2.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/sdivpow2.ll Thu Sep  5 16:40:03 2019
@@ -87,3 +87,22 @@ define i64 @test7(i64 %x) {
   ret i64 %div
 }
 
+define i64 @test8(i64 %x) {
+; ISEL-LABEL: test8:
+; ISEL:       // %bb.0:
+; ISEL-NEXT:    cmp x0, #0 // =0
+; ISEL-NEXT:    cinc x8, x0, lt
+; ISEL-NEXT:    asr x0, x8, #1
+; ISEL-NEXT:    ret
+;
+; FAST-LABEL: test8:
+; FAST:       // %bb.0:
+; FAST-NEXT:    add x8, x0, #1 // =1
+; FAST-NEXT:    cmp x0, #0 // =0
+; FAST-NEXT:    csel x8, x8, x0, lt
+; FAST-NEXT:    asr x0, x8, #1
+; FAST-NEXT:    ret
+  %div = sdiv i64 %x, 2
+  ret i64 %div
+}
+




More information about the llvm-commits mailing list