[PATCH] D141113: Improve mul 2^N +/- 2 pattern

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 09:05:03 PST 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/test/CodeGen/X86/mul-constant-result.ll:166-175
+; X86-NEXT:    .cfi_def_cfa_offset 8
+; X86-NEXT:    leal (%eax,%eax), %ecx
+; X86-NEXT:    shll $5, %eax
+; X86-NEXT:  .LBB0_23:
+; X86-NEXT:    subl %ecx, %eax
+; X86-NEXT:    popl %esi
+; X86-NEXT:    .cfi_def_cfa_offset 4
----------------
RKSimon wrote:
> pengfei wrote:
> > Regression?
> The increase in lines seems to be due to extra labels/cfi-directives - tbh I'd take the extra LEA if we reduce control flow instructions.
> The increase in lines seems to be due to extra labels/cfi-directives - tbh I'd take the extra LEA if we reduce control flow instructions.




================
Comment at: llvm/test/CodeGen/X86/mul-constant-result.ll:166-175
+; X86-NEXT:    .cfi_def_cfa_offset 8
+; X86-NEXT:    leal (%eax,%eax), %ecx
+; X86-NEXT:    shll $5, %eax
+; X86-NEXT:  .LBB0_23:
+; X86-NEXT:    subl %ecx, %eax
+; X86-NEXT:    popl %esi
+; X86-NEXT:    .cfi_def_cfa_offset 4
----------------
goldstein.w.n wrote:
> RKSimon wrote:
> > pengfei wrote:
> > > Regression?
> > The increase in lines seems to be due to extra labels/cfi-directives - tbh I'd take the extra LEA if we reduce control flow instructions.
> > The increase in lines seems to be due to extra labels/cfi-directives - tbh I'd take the extra LEA if we reduce control flow instructions.
> 
> 
> Regression?


I think that the tail of some cases fold when its `sub; sub` so lower LOC, more jumps.
Issue?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141113



More information about the llvm-commits mailing list