[llvm] [AArch64][PAC] Specify Defs and Uses of PAUTH_(PROLOGUE|EPILOGUE) (PR #68205)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 04:05:29 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-aarch64

<details>
<summary>Changes</summary>

This is a follow-up to eb02ee44d32531931af5312cd450779011664eef.

---
Full diff: https://github.com/llvm/llvm-project/pull/68205.diff


2 Files Affected:

- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.td (+2) 
- (modified) llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir (+8-8) 


``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
index cd377d659ad3ee9..5293df90b880b8b 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
@@ -1482,12 +1482,14 @@ def : InstAlias<"xpaclri", (XPACLRI), 0>;
 
 // Pseudos
 
+let Uses = [LR, SP], Defs = [LR] in {
 // Insertion point of LR signing code.
 def PAUTH_PROLOGUE : Pseudo<(outs), (ins), []>, Sched<[]>;
 // Insertion point of LR authentication code.
 // The RET terminator of the containing machine basic block may be replaced
 // with a combined RETA(A|B) instruction when rewriting this Pseudo.
 def PAUTH_EPILOGUE : Pseudo<(outs), (ins), []>, Sched<[]>;
+}
 
 // These pointer authentication instructions require armv8.3a
 let Predicates = [HasPAuth] in {
diff --git a/llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir b/llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir
index 9c115a1de0db162..7d5a7e247087fc8 100644
--- a/llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir
+++ b/llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir
@@ -67,7 +67,7 @@ tracksRegLiveness: true
 body:             |
   bb.0 (%ir-block.0):
   liveins: $lr
-    frame-setup PAUTH_PROLOGUE
+    frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp
     $sp = frame-setup SUBXri $sp, 16, 0
     renamable $x8 = ADRP target-flags(aarch64-page) @v
     $x9 = ADDXri $sp, 12, 0
@@ -79,7 +79,7 @@ body:             |
     STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
     STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
     $sp = frame-destroy ADDXri $sp, 16, 0
-    frame-destroy PAUTH_EPILOGUE
+    frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp
     RET undef $lr
 
 # CHECK-LABEL:    name:            legal0
@@ -100,7 +100,7 @@ tracksRegLiveness: true
 body:             |
   bb.0 (%ir-block.0):
   liveins: $lr
-    frame-setup PAUTH_PROLOGUE
+    frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp
     $sp = frame-setup SUBXri $sp, 16, 0
     renamable $x8 = ADRP target-flags(aarch64-page) @v
     $x9 = ADDXri $sp, 12, 0
@@ -112,7 +112,7 @@ body:             |
     STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
     STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
     $sp = frame-destroy ADDXri $sp, 16, 0
-    frame-destroy PAUTH_EPILOGUE
+    frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp
     RET undef $lr
 
 # CHECK-LABEL:    name:            legal1
@@ -133,7 +133,7 @@ tracksRegLiveness: true
 body:             |
   bb.0 (%ir-block.0):
   liveins: $lr
-    frame-setup PAUTH_PROLOGUE
+    frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp
     $sp = frame-setup SUBXri $sp, 16, 0
     renamable $x8 = ADRP target-flags(aarch64-page) @v
     $x9 = ADDXri $sp, 12, 0
@@ -145,7 +145,7 @@ body:             |
     STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
     STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
     $sp = frame-destroy ADDXri $sp, 12, 0
-    frame-destroy PAUTH_EPILOGUE
+    frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp
     RET undef $lr
 
 ...
@@ -155,7 +155,7 @@ tracksRegLiveness: true
 body:             |
   bb.0 (%ir-block.0):
   liveins: $lr
-    frame-setup PAUTH_PROLOGUE
+    frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp
     $sp = frame-setup SUBXri $sp, 16, 0
     renamable $x8 = ADRP target-flags(aarch64-page) @v
     $x9 = ADDXri $sp, 12, 0
@@ -167,7 +167,7 @@ body:             |
     STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
     STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)
     $sp = frame-destroy ADDXri $sp, 12, 0
-    frame-destroy PAUTH_EPILOGUE
+    frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp
     RET undef $lr
 
 # CHECK-LABEL:    name:            illegal0

``````````

</details>


https://github.com/llvm/llvm-project/pull/68205


More information about the llvm-commits mailing list