mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 19:45:40 -04:00

The "dead" markings allow existing target-independent optimizations, like MachineSink, to trigger more frequently. The CPSR defs would have eventually been marked dead by LiveVariables, so this only affects optimizations before regalloc. The ARMBaseInstrInfo.cpp change is fixing a bug which is only visible with this change: the transform adds a use to an otherwise dead def of CPSR. This is covered by existing regression tests. thumb2-tbh.ll breaks for Thumb1 due to MachineLICM changing the generated code; I'll fix it in D53452. Differential Revision: https://reviews.llvm.org/D53453 llvm-svn: 345420
60 lines
1.5 KiB
LLVM
60 lines
1.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc < %s -mtriple thumbv7-eabi | FileCheck %s -check-prefix=T2
|
|
; RUN: llc < %s -mtriple thumbv6m-eabi | FileCheck %s -check-prefix=T1
|
|
; <rdar://problem/7569620>
|
|
|
|
define i32 @compare_i_gt(i32 %a) {
|
|
; T2-LABEL: compare_i_gt:
|
|
; T2: @ %bb.0: @ %entry
|
|
; T2-NEXT: movs r1, #24
|
|
; T2-NEXT: cmn.w r0, #78
|
|
; T2-NEXT: it gt
|
|
; T2-NEXT: movgt r1, #42
|
|
; T2-NEXT: mov r0, r1
|
|
; T2-NEXT: bx lr
|
|
;
|
|
; T1-LABEL: compare_i_gt:
|
|
; T1: @ %bb.0: @ %entry
|
|
; T1-NEXT: movs r1, #77
|
|
; T1-NEXT: mvns r1, r1
|
|
; T1-NEXT: cmp r0, r1
|
|
; T1-NEXT: bgt .LBB0_2
|
|
; T1-NEXT: @ %bb.1: @ %entry
|
|
; T1-NEXT: movs r0, #24
|
|
; T1-NEXT: bx lr
|
|
; T1-NEXT: .LBB0_2:
|
|
; T1-NEXT: movs r0, #42
|
|
; T1-NEXT: bx lr
|
|
entry:
|
|
%cmp = icmp sgt i32 %a, -78
|
|
%ret = select i1 %cmp, i32 42, i32 24
|
|
ret i32 %ret
|
|
}
|
|
|
|
define i32 @compare_r_eq(i32 %a, i32 %b) {
|
|
; T2-LABEL: compare_r_eq:
|
|
; T2: @ %bb.0: @ %entry
|
|
; T2-NEXT: movs r2, #24
|
|
; T2-NEXT: cmn r0, r1
|
|
; T2-NEXT: it eq
|
|
; T2-NEXT: moveq r2, #42
|
|
; T2-NEXT: mov r0, r2
|
|
; T2-NEXT: bx lr
|
|
;
|
|
; T1-LABEL: compare_r_eq:
|
|
; T1: @ %bb.0: @ %entry
|
|
; T1-NEXT: cmn r0, r1
|
|
; T1-NEXT: beq .LBB1_2
|
|
; T1-NEXT: @ %bb.1: @ %entry
|
|
; T1-NEXT: movs r0, #24
|
|
; T1-NEXT: bx lr
|
|
; T1-NEXT: .LBB1_2:
|
|
; T1-NEXT: movs r0, #42
|
|
; T1-NEXT: bx lr
|
|
entry:
|
|
%sub = sub nsw i32 0, %b
|
|
%cmp = icmp eq i32 %a, %sub
|
|
%ret = select i1 %cmp, i32 42, i32 24
|
|
ret i32 %ret
|
|
}
|