[llvm] AArch64: Clear hasSideEffects on AUT and AUTPAC. (PR #141330)

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri May 23 21:12:42 PDT 2025


https://github.com/pcc created https://github.com/llvm/llvm-project/pull/141330

With hasSideEffects=1 we unnecessarily inhibit certain optimizations in
the backend such as code motion which lead to slightly less efficient
codegen when the pseudo instructions are used frequently, e.g. in the
PFP use case. These annotations do not cause the instructions to be kept
without a use because the underlying intrinsics are IntrNoMem. Users
should be expected to use another means of keeping the use alive if they
need the trapping side effect without a use (e.g. llvm.fake.use).


>From 9fba42bac24cd633051fe624db483cd204a355c5 Mon Sep 17 00:00:00 2001
From: Peter Collingbourne <peter at pcc.me.uk>
Date: Fri, 23 May 2025 21:12:27 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.6-beta.1
---
 llvm/lib/Target/AArch64/AArch64InstrInfo.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
index 61055a66e8858..5674721be90c4 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
@@ -1943,7 +1943,7 @@ let Predicates = [HasPAuth] in {
   def AUT : Pseudo<(outs), (ins i32imm:$Key, i64imm:$Disc, GPR64noip:$AddrDisc),
                    []>, Sched<[WriteI, ReadI]> {
     let isCodeGenOnly = 1;
-    let hasSideEffects = 1;
+    let hasSideEffects = 0;
     let mayStore = 0;
     let mayLoad = 0;
     let Size = 32;
@@ -1960,7 +1960,7 @@ let Predicates = [HasPAuth] in {
                     i32imm:$PACKey, i64imm:$PACDisc, GPR64noip:$PACAddrDisc),
                []>, Sched<[WriteI, ReadI]> {
     let isCodeGenOnly = 1;
-    let hasSideEffects = 1;
+    let hasSideEffects = 0;
     let mayStore = 0;
     let mayLoad = 0;
     let Size = 48;



More information about the llvm-commits mailing list