[PATCH] D75567: [x86] Enable bypassing 64-bit division on generic x86-64

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 09:06:55 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf0903de1aa7a: [x86] Enable bypassing 64-bit division on generic x86-64 (authored by RKSimon).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75567/new/

https://reviews.llvm.org/D75567

Files:
  llvm/lib/Target/X86/X86.td
  llvm/test/CodeGen/X86/bypass-slow-division-tune.ll


Index: llvm/test/CodeGen/X86/bypass-slow-division-tune.ll
===================================================================
--- llvm/test/CodeGen/X86/bypass-slow-division-tune.ll
+++ llvm/test/CodeGen/X86/bypass-slow-division-tune.ll
@@ -66,9 +66,20 @@
 ; X64-LABEL: div64:
 ; X64:       # %bb.0: # %entry
 ; X64-NEXT:    movq %rdi, %rax
+; X64-NEXT:    movq %rdi, %rcx
+; X64-NEXT:    orq %rsi, %rcx
+; X64-NEXT:    shrq $32, %rcx
+; X64-NEXT:    je .LBB1_1
+; X64-NEXT:  # %bb.2:
 ; X64-NEXT:    cqto
 ; X64-NEXT:    idivq %rsi
 ; X64-NEXT:    retq
+; X64-NEXT:  .LBB1_1:
+; X64-NEXT:    # kill: def $eax killed $eax killed $rax
+; X64-NEXT:    xorl %edx, %edx
+; X64-NEXT:    divl %esi
+; X64-NEXT:    # kill: def $eax killed $eax def $rax
+; X64-NEXT:    retq
 ;
 ; SLM-LABEL: div64:
 ; SLM:       # %bb.0: # %entry
@@ -178,9 +189,20 @@
 ; X64-LABEL: div64_hugews:
 ; X64:       # %bb.0:
 ; X64-NEXT:    movq %rdi, %rax
+; X64-NEXT:    movq %rdi, %rcx
+; X64-NEXT:    orq %rsi, %rcx
+; X64-NEXT:    shrq $32, %rcx
+; X64-NEXT:    je .LBB4_1
+; X64-NEXT:  # %bb.2:
 ; X64-NEXT:    cqto
 ; X64-NEXT:    idivq %rsi
 ; X64-NEXT:    retq
+; X64-NEXT:  .LBB4_1:
+; X64-NEXT:    # kill: def $eax killed $eax killed $rax
+; X64-NEXT:    xorl %edx, %edx
+; X64-NEXT:    divl %esi
+; X64-NEXT:    # kill: def $eax killed $eax def $rax
+; X64-NEXT:    retq
 ;
 ; SLM-LABEL: div64_hugews:
 ; SLM:       # %bb.0:
Index: llvm/lib/Target/X86/X86.td
===================================================================
--- llvm/lib/Target/X86/X86.td
+++ llvm/lib/Target/X86/X86.td
@@ -1260,6 +1260,7 @@
   FeatureNOPL,
   Feature64Bit,
   FeatureSlow3OpsLEA,
+  FeatureSlowDivide64,
   FeatureSlowIncDec,
   FeatureMacroFusion,
   FeatureInsertVZEROUPPER


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75567.260937.patch
Type: text/x-patch
Size: 1744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200429/c92ba21e/attachment.bin>


More information about the llvm-commits mailing list