1 # RUN: llc -mtriple=aarch64 -run-pass aarch64-mi-peephole-opt -verify-machineinstrs -o - %s | FileCheck %s
4 # CHECK-LABEL: name: test1
6 tracksRegLiveness: true
8 - { id: 0, class: gpr32 }
9 - { id: 1, class: gpr32 }
10 - { id: 2, class: gpr32 }
11 - { id: 3, class: gpr32 }
12 - { id: 4, class: gpr64 }
22 %2:gpr32 = nsw ADDWrr %0, %1
27 ; CHECK-NOT: %3:gpr32 = ORRWrs $wzr, %2, 0
28 ; The ORRWrs should be removed.
29 %3:gpr32 = ORRWrs $wzr, %2, 0
30 %4:gpr64 = SUBREG_TO_REG 0, %3, %subreg.sub_32
35 RET_ReallyLR implicit $x0
39 # CHECK-LABEL: name: test2
41 tracksRegLiveness: true
43 - { id: 0, class: gpr64 }
44 - { id: 1, class: gpr32 }
45 - { id: 2, class: gpr32 }
46 - { id: 3, class: gpr64 }
55 %1:gpr32 = EXTRACT_SUBREG %0, %subreg.sub_32
60 ; CHECK: %2:gpr32 = ORRWrs $wzr, %1, 0
61 ; The ORRWrs should not be removed.
62 %2:gpr32 = ORRWrs $wzr, %1, 0
63 %3:gpr64 = SUBREG_TO_REG 0, %2, %subreg.sub_32
68 RET_ReallyLR implicit $x0