[PATCH] D83708: Remove TwoAddressInstructinoPass::sink3AddrInstruction.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 13:26:24 PDT 2020


jyknight marked an inline comment as done.
jyknight added inline comments.


================
Comment at: llvm/test/CodeGen/X86/twoaddr-lea.ll:71
 bb3:
-; CHECK: subl %e[[REG0:[a-z0-9]+]],
-; CHECK: addq $4, %r[[REG0]]
+; CHECK: LBB3_3:
+; CHECK: addq $4, %r
----------------
craig.topper wrote:
> What's happening here? Previously the two instructions used the same register, but now they don't?
Correct. 

```
 _ham:                                   ## @ham
        .cfi_startproc
 ## %bb.0:                               ## %bb
        xorl    %r8d, %r8d
        movq    _global at GOTPCREL(%rip), %rdx
        movq    _global2 at GOTPCREL(%rip), %rsi
        xorl    %eax, %eax
        cmpl    $10, %eax
        jle     LBB3_2
 LBB3_6:                                 ## %bb2
                                         ## =>This Loop Header: Depth=1
                                         ##     Child Loop BB3_7 Depth 2
        movl    (%rdx), %edi
        leal    (%rdi,%rax), %ecx
        movslq  %ecx, %rcx
 LBB3_7:                                 ## %bb6
                                         ##   Parent Loop BB3_6 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
        movq    %rax, (%rsi)
        movq    %rcx, (%rsi)
        movl    %edi, (%rdx)
        testb   %r8b, %r8b
        jne     LBB3_7
 ## %bb.8:                               ## %bb9
                                         ##   in Loop: Header=BB3_6 Depth=1
        addq    $4, %rax
        cmpl    $10, %eax
        jg      LBB3_6
 LBB3_2:                                 ## %bb3.preheader
        xorl    %ecx, %ecx
 LBB3_3:                                 ## %bb3
                                         ## =>This Loop Header: Depth=1
                                         ##     Child Loop BB3_4 Depth 2
-       movl    %eax, %edx
-       subl    %ecx, %edx
-       movq    %rcx, %rsi
+       movq    %rcx, %rdx
        addq    $4, %rcx
+       movl    %eax, %esi
+       subl    %edx, %esi
 LBB3_4:                                 ## %bb4
                                         ##   Parent Loop BB3_3 Depth=1
                                         ## =>  This Inner Loop Header: Depth=2
-       testl   %edx, %edx
+       testl   %esi, %esi
        jne     LBB3_9
 ## %bb.5:                               ## %bb5
                                         ##   in Loop: Header=BB3_4 Depth=2
-       incq    %rsi
-       cmpq    %rcx, %rsi
+       incq    %rdx
+       cmpq    %rcx, %rdx
        jge     LBB3_3
        jmp     LBB3_4
 LBB3_9:                                 ## %bb8
        ud2
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83708





More information about the llvm-commits mailing list