[PATCH] D118044: [ARM] Undeprecate complex IT blocks

John Brawn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 27 08:21:40 PST 2022


john.brawn added inline comments.


================
Comment at: llvm/test/CodeGen/ARM/2013-05-05-IfConvertBug.ll:1-4
 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -mcpu=cortex-a8 | FileCheck %s
 ; RUN: llc < %s -mtriple=thumbv8 | FileCheck -check-prefix=CHECK-V8 %s
-; RUN: llc < %s -mtriple=thumbv7 -arm-restrict-it | FileCheck -check-prefix=CHECK-V8 %s
+; RUN: llc < %s -mtriple=thumbv8 -arm-restrict-it | FileCheck -check-prefix=CHECK-RESTRICT-IT %s
+; RUN: llc < %s -mtriple=thumbv7 -arm-restrict-it | FileCheck -check-prefix=CHECK-RESTRICT-IT %s
----------------
The code generated for -mtriple=thumbv7-apple-ios and -mtriple=thumbv8 is almost the same, so instead of changing the CHECK-V8 lines and adding new CHECK-RESTRICT-IT lines, you could instead rename all of the current CHECK-V8 lines to CHECK-RESTRICT-IT and instead have -mtriple=thumbv8 check the CHECK lines, i.e.
; RUN: llc < %s -mtriple=thumbv8 | FileCheck %s



================
Comment at: llvm/test/CodeGen/ARM/arm-and-tst-peephole.ll:42-62
 ; V8-LABEL: %tailrecurse.switch
 ; V8: cmp
+; V8-NEXT: it ne
+; V8-NEXT: bxne lr
+; V8-NEXT: @
+; V8-NEXT: @
+; V8-NEXT: orr.w
----------------
The checks here are kind of a mess, in that if we look at the generated code it looks like

```
.LBB0_1:                                @ %tailrecurse.switch
                                        @   in Loop: Header=BB0_3 Depth=1
        cmp     r3, #1
        it      ne
        bxne    lr
.LBB0_2:                                @ %sw.bb
                                        @   in Loop: Header=BB0_3 Depth=1
        orr.w   r1, r3, r1, lsl #1
        adds    r2, #4
        add.w   r12, r12, #1
.LBB0_3:                                @ %tailrecurse
                                        @ =>This Inner Loop Header: Depth=1
        ldr     r3, [r2, #-4]
        ands    r3, r3, #3
        beq     .LBB0_2
@ %bb.4:                                @ %tailrecurse.switch
                                        @   in Loop: Header=BB0_3 Depth=1
        cmp     r3, #3
        itt     eq
        moveq   r0, r2
        bxeq    lr
.LBB0_5:                                @ %tailrecurse.switch
                                        @   in Loop: Header=BB0_3 Depth=1
        cmp     r3, #2
        bne     .LBB0_1
@ %bb.6:                                @ %sw.bb8
        add     r1, r12
        add.w   r0, r0, r1
```
We have a load of V8-NEXT lines where it's variously: checking the instruction opcode; checking the entire instruction; checking for some text that appears in a comment (e.g. V8-NEXT: %tailrecurse.switch); checking that a comment appears but not what's in it (e.g. V8-NEXT: @).

I think it would make more sense to restructure so it's a sequence of
```
; V8-LABEL: @ %llvm_ir_name_in_a_comment
; V8: first_instruction_in_block
; V8-NEXT: next_instruction
; v8-NEXT: etc.
```


================
Comment at: llvm/test/CodeGen/ARM/arm-bf16-pcs.ll:190
 ; BASE-THUMB-NEXT:    strh.w r0, [sp, #6]
+; BASE-THUMB-NEXT:    uxth r1, r0
 ; BASE-THUMB-NEXT:    mov r0, r5
----------------
This, and the cases in other tests where we have a uxth/uxtb that moves, looks rather strange and not something I'd expect given that there's no IT here. Do you know what's going on here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118044



More information about the cfe-commits mailing list