Skip to content

Commit d32cce5

Browse files
authored
[AArch64][PAC] Specify Defs and Uses of PAUTH_(PROLOGUE|EPILOGUE)
This is a follow-up to eb02ee4.
1 parent ba01ce6 commit d32cce5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,12 +1482,14 @@ def : InstAlias<"xpaclri", (XPACLRI), 0>;
14821482

14831483
// Pseudos
14841484

1485+
let Uses = [LR, SP], Defs = [LR] in {
14851486
// Insertion point of LR signing code.
14861487
def PAUTH_PROLOGUE : Pseudo<(outs), (ins), []>, Sched<[]>;
14871488
// Insertion point of LR authentication code.
14881489
// The RET terminator of the containing machine basic block may be replaced
14891490
// with a combined RETA(A|B) instruction when rewriting this Pseudo.
14901491
def PAUTH_EPILOGUE : Pseudo<(outs), (ins), []>, Sched<[]>;
1492+
}
14911493

14921494
// These pointer authentication instructions require armv8.3a
14931495
let Predicates = [HasPAuth] in {

llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ tracksRegLiveness: true
6767
body: |
6868
bb.0 (%ir-block.0):
6969
liveins: $lr
70-
frame-setup PAUTH_PROLOGUE
70+
frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp
7171
$sp = frame-setup SUBXri $sp, 16, 0
7272
renamable $x8 = ADRP target-flags(aarch64-page) @v
7373
$x9 = ADDXri $sp, 12, 0
@@ -79,7 +79,7 @@ body: |
7979
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
8080
STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
8181
$sp = frame-destroy ADDXri $sp, 16, 0
82-
frame-destroy PAUTH_EPILOGUE
82+
frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp
8383
RET undef $lr
8484
8585
# CHECK-LABEL: name: legal0
@@ -100,7 +100,7 @@ tracksRegLiveness: true
100100
body: |
101101
bb.0 (%ir-block.0):
102102
liveins: $lr
103-
frame-setup PAUTH_PROLOGUE
103+
frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp
104104
$sp = frame-setup SUBXri $sp, 16, 0
105105
renamable $x8 = ADRP target-flags(aarch64-page) @v
106106
$x9 = ADDXri $sp, 12, 0
@@ -112,7 +112,7 @@ body: |
112112
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
113113
STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
114114
$sp = frame-destroy ADDXri $sp, 16, 0
115-
frame-destroy PAUTH_EPILOGUE
115+
frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp
116116
RET undef $lr
117117
118118
# CHECK-LABEL: name: legal1
@@ -133,7 +133,7 @@ tracksRegLiveness: true
133133
body: |
134134
bb.0 (%ir-block.0):
135135
liveins: $lr
136-
frame-setup PAUTH_PROLOGUE
136+
frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp
137137
$sp = frame-setup SUBXri $sp, 16, 0
138138
renamable $x8 = ADRP target-flags(aarch64-page) @v
139139
$x9 = ADDXri $sp, 12, 0
@@ -145,7 +145,7 @@ body: |
145145
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
146146
STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
147147
$sp = frame-destroy ADDXri $sp, 12, 0
148-
frame-destroy PAUTH_EPILOGUE
148+
frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp
149149
RET undef $lr
150150
151151
...
@@ -155,7 +155,7 @@ tracksRegLiveness: true
155155
body: |
156156
bb.0 (%ir-block.0):
157157
liveins: $lr
158-
frame-setup PAUTH_PROLOGUE
158+
frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp
159159
$sp = frame-setup SUBXri $sp, 16, 0
160160
renamable $x8 = ADRP target-flags(aarch64-page) @v
161161
$x9 = ADDXri $sp, 12, 0
@@ -167,7 +167,7 @@ body: |
167167
STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
168168
STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
169169
$sp = frame-destroy ADDXri $sp, 12, 0
170-
frame-destroy PAUTH_EPILOGUE
170+
frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp
171171
RET undef $lr
172172
173173
# CHECK-LABEL: name: illegal0

0 commit comments

Comments
 (0)