1# RUN: llc %s -o - -run-pass=peephole-opt | FileCheck %s 2 3# Check that we don't optimize out a subs due to areCFlagsAccessedBetweenInstrs 4# returning the wrong result; it should check the cneg before the subs which does 5# modify cflags. 6 7# CHECK-LABEL: f 8# CHECK: SUBSWrr 9# CHECK-NEXT: SUBWrr 10# CHECK-NEXT: CSNEGWr 11# CHECK-NEXT: SUBSWri 12# CHECK-NEXT: CSNEGWr 13# CHECK-NEXT: Bcc 14 15--- | 16 target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128" 17 target triple = "aarch64-w64-windows-gnu" 18 19 define dso_local void @f() { 20 ret void 21 } 22 23... 24--- 25name: f 26registers: 27 - { id: 43, class: gpr32, preferred-register: '' } 28 - { id: 44, class: gpr32, preferred-register: '' } 29 - { id: 46, class: gpr32, preferred-register: '' } 30 - { id: 47, class: gpr32, preferred-register: '' } 31 - { id: 48, class: gpr32common, preferred-register: '' } 32 - { id: 49, class: gpr32common, preferred-register: '' } 33 - { id: 50, class: gpr32, preferred-register: '' } 34 - { id: 51, class: gpr32, preferred-register: '' } 35 - { id: 52, class: gpr32, preferred-register: '' } 36 - { id: 53, class: gpr32, preferred-register: '' } 37body: | 38 bb.0: 39 successors: %bb.0 40 41 %43 = MOVi32imm 1 42 %44 = MOVi32imm 1 43 %46 = MOVi32imm 1 44 %47 = MOVi32imm 1 45 %48 = nsw SUBSWrr killed %43, killed %46, implicit-def dead $nzcv 46 %49 = nsw SUBSWrr killed %44, killed %47, implicit-def dead $nzcv 47 %50 = SUBSWri %48, 0, 0, implicit-def $nzcv 48 %51 = CSNEGWr %48, %48, 5, implicit $nzcv 49 %52 = SUBSWri %49, 0, 0, implicit-def $nzcv 50 %53 = CSNEGWr %49, %49, 5, implicit $nzcv 51 Bcc 1, %bb.0, implicit $nzcv 52 RET_ReallyLR 53 54... 55