[llvm] [AArch64] Consider MOVaddr* as cheap if fuse-adrp-add (PR #121904)
Guy David via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 7 00:58:24 PST 2025
https://github.com/guy-david created https://github.com/llvm/llvm-project/pull/121904
These pseudo-instructions usually translate into a pair of adrp+add and have a single cycle latency on some micro-architectures.
>From 404a7fc8d35ffc327178378e60c87f96904679bf Mon Sep 17 00:00:00 2001
From: Guy David <guyda96 at gmail.com>
Date: Tue, 7 Jan 2025 10:57:12 +0200
Subject: [PATCH] [AArch64] Consider MOVaddr* as cheap if fuse-adrp-add
These pseudo-instructions usually translate into a pair of adrp+add and
have a single cycle latency on some micro-architectures.
---
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index fd24e49f948a20..6cb84d8623ea86 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -936,6 +936,14 @@ bool AArch64InstrInfo::isAsCheapAsAMove(const MachineInstr &MI) const {
return isCheapImmediate(MI, 32);
case AArch64::MOVi64imm:
return isCheapImmediate(MI, 64);
+
+ case AArch64::MOVaddr:
+ case AArch64::MOVaddrJT:
+ case AArch64::MOVaddrCP:
+ case AArch64::MOVaddrTLS:
+ case AArch64::MOVaddrEXT:
+ return Subtarget.hasFuseAdrpAdd() &&
+ !(MI.getOperand(1).getTargetFlags() & AArch64II::MO_TAGGED);
}
}
More information about the llvm-commits
mailing list