[llvm] [AArch64] Improve the codegen for sdiv 2 (PR #98324)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 07:13:42 PDT 2024


================
@@ -5,177 +5,95 @@
 ; RUN:   | FileCheck -check-prefixes=CHECK,SFB %s
 
 define signext i32 @sdiv2_32(i32 signext %0) {
-; NOSFB-LABEL: sdiv2_32:
-; NOSFB:       # %bb.0:
-; NOSFB-NEXT:    srliw a1, a0, 31
-; NOSFB-NEXT:    add a0, a0, a1
-; NOSFB-NEXT:    sraiw a0, a0, 1
-; NOSFB-NEXT:    ret
-;
-; SFB-LABEL: sdiv2_32:
----------------
dtcxzyw wrote:

On SiFive's cores with SFB (Short forward branch), `bgez + addi` only takes one cycle.


https://github.com/llvm/llvm-project/pull/98324


More information about the llvm-commits mailing list