[llvm] [AArch64] Consider MOVaddr* as cheap if fuse-adrp-add (PR #121904)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 7 00:58:55 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-aarch64
Author: Guy David (guy-david)
<details>
<summary>Changes</summary>
These pseudo-instructions usually translate into a pair of adrp+add and have a single cycle latency on some micro-architectures.
---
Full diff: https://github.com/llvm/llvm-project/pull/121904.diff
1 Files Affected:
- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.cpp (+8)
``````````diff
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);
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/121904
More information about the llvm-commits
mailing list