2014-08-11 06:20:37 +08:00
|
|
|
; 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
|
[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-19 04:55:09 +08:00
|
|
|
; CHECK: mul r2, r0, r0
|
2014-08-11 06:20:37 +08:00
|
|
|
; CHECK: cmp r0, r1
|
|
|
|
; CHECK-NOT: mulseq r0, r0, r0
|
[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-19 04:55:09 +08:00
|
|
|
; CHECK: moveq r0, r2
|
2014-08-11 06:20:37 +08:00
|
|
|
; CHECK: bx lr
|
|
|
|
|