[PATCH] D40634: [CGP] Enable select in complex addr mode

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 10 23:41:22 PST 2017


skatkov added a comment.

To make a review easier, the generated code before this patch:

  .globl  BinarySearch            # -- Begin function BinarySearch
  .p2align        4, 0x90
  .type   BinarySearch, at function

BinarySearch:                           # @BinarySearch

  .cfi_startproc

%bb.0:                                # %entry
==============================================

  movl    (%rsi), %eax
  jmp     .LBB4_2
  .p2align        4, 0x90

.LBB4_1:                                # %while.body

1. in Loop: Header=BB4_2 Depth=1 movl    %ecx, %eax leaq    16(%rdx), %rcx addq    $8, %rdx btl     %eax, %edi cmovaeq %rcx, %rdx movq    (%rdx), %rdx

.LBB4_2:                                # %while.body

  1. =>This Inner Loop Header: Depth=1 movl    (%rdx), %ecx cmpl    %ecx, %eax ja      .LBB4_1
1. %bb.3:                                # %while.end retq

.Lfunc_end4:

  .size   BinarySearch, .Lfunc_end4-BinarySearch
  .cfi_endproc

The generated code after this patch:

  .globl  BinarySearch            # -- Begin function BinarySearch
  .p2align        4, 0x90
  .type   BinarySearch, at function

BinarySearch:                           # @BinarySearch

  .cfi_startproc

%bb.0:                                # %entry
==============================================

  movl    (%rsi), %eax
  jmp     .LBB4_2
  .p2align        4, 0x90

.LBB4_1:                                # %while.body

1. in Loop: Header=BB4_2 Depth=1 movl    %ecx, %eax xorl    %ecx, %ecx btl     %eax, %edi setae   %cl movq    8(%rdx,%rcx,8), %rdx

.LBB4_2:                                # %while.body

  1. =>This Inner Loop Header: Depth=1 movl    (%rdx), %ecx cmpl    %ecx, %eax ja      .LBB4_1
1. %bb.3:                                # %while.end retq

.Lfunc_end4:

  .size   BinarySearch, .Lfunc_end4-BinarySearch
  .cfi_endproc


https://reviews.llvm.org/D40634





More information about the llvm-commits mailing list