1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/ARM/2014-08-04-muls-it.ll
Huihui Zhang 8b112ee806 [ARM] Comply with rules on ARMv8-A thumb mode partial deprecation of IT.
Summary:
When identifing instructions that can be folded into a MOVCC instruction,
checking for a predicate operand is not enough, also need to check for
thumb2 function, with restrict-IT, is the machine instruction eligible for
ARMv8 IT or not.

Notes in ARMv8-A Architecture Reference Manual, section "Partial deprecation of IT"
  https://usermanual.wiki/Pdf/ARM20Architecture20Reference20ManualARMv8.1667877052.pdf

"ARMv8-A deprecates some uses of the T32 IT instruction. All uses of IT that apply to
instructions other than a single subsequent 16-bit instruction from a restricted set
are deprecated, as are explicit references to the PC within that single 16-bit
instruction. This permits the non-deprecated forms of IT and subsequent instructions
to be treated as a single 32-bit conditional instruction."

Reviewers: efriedma, lebedev.ri, t.p.northover, jmolloy, aemerson, compnerd, stoklund, ostannard

Reviewed By: ostannard

Subscribers: ostannard, javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63474

llvm-svn: 363739
2019-06-18 20:55:09 +00:00

25 lines
640 B
LLVM

; RUN: llc -mtriple thumbv7-eabi -arm-restrict-it -filetype asm -o - %s \
; RUN: | FileCheck %s
define arm_aapcscc i32 @function(i32 %i, i32 %j) {
entry:
%cmp = icmp eq i32 %i, %j
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%mul = mul nsw i32 %i, %i
br label %if.end
if.end: ; preds = %if.then, %entry
%i.addr.0 = phi i32 [ %mul, %if.then ], [ %i, %entry ]
ret i32 %i.addr.0
}
; CHECK-LABEL: function
; CHECK: mul r2, r0, r0
; CHECK: cmp r0, r1
; CHECK-NOT: mulseq r0, r0, r0
; CHECK: moveq r0, r2
; CHECK: bx lr