1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[AArch64][v8.3a] Add missing imp-defs on RETA*.

RETA always implicitly uses LR, unlike RET which merely has an
alias that defaults it to LR.
Additionally, RETA implicitly uses SP as well, which it uses as
a discriminator to authenticate LR.

This isn't usually noticeable, because RET_ReallyLR is used in most
of the backend.  However, the post-RA scheduler, if enabled, will
cause miscompiles if the imp-uses are missing.

While there, fix a typo in the lone affected testcase.
This commit is contained in:
Ahmed Bougacha 2019-06-25 18:44:39 -07:00
parent 66e06d497f
commit 7a21472d38
2 changed files with 3 additions and 2 deletions

View File

@ -1427,6 +1427,7 @@ class AuthOneOperand<bits<3> opc, bits<1> M, string asm>
let Inst{9-5} = Rn;
}
let Uses = [LR,SP] in
class AuthReturn<bits<3> op, bits<1> M, string asm>
: AuthBase<M, (outs), (ins), asm, "", []> {
let Inst{24} = 0;

View File

@ -142,7 +142,7 @@ body: |
INLINEASM &"", 1, 12, implicit-def dead early-clobber $lr
$w0 = ORRWrs $wzr, $wzr, 0
early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load 8 from %stack.0)
RETAA implicit killed $w0
RETAA implicit $sp, implicit $lr, implicit killed $w0
---
# Function starts with PACIBSP, which implicitly acts as BTI JC, so no change
@ -166,7 +166,7 @@ body: |
INLINEASM &"", 1, 12, implicit-def dead early-clobber $lr
$w0 = ORRWrs $wzr, $wzr, 0
early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load 8 from %stack.0)
RETAB implicit killed $w0
RETAB implicit $sp, implicit $lr, implicit killed $w0
---
# Function contains a jump table, so every target of the jump table must start