-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[AArch64] Assert expandMOVImm prioritizes optimal single MOVZ/N
#169341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AArch64] Assert expandMOVImm prioritizes optimal single MOVZ/N
#169341
Conversation
43e7361 to
9a2e070
Compare
expandMOVImm prioritizes optimal single MOVZ/…expandMOVImm prioritizes optimal single MOVZ/N
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
9a2e070 to
ab50da9
Compare
|
@llvm/pr-subscribers-backend-aarch64 Author: Tomer Shafir (tomershafir) ChangesThe expansion of move immediate in Full diff: https://github.com/llvm/llvm-project/pull/169341.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AArch64/AArch64ExpandImm.cpp b/llvm/lib/Target/AArch64/AArch64ExpandImm.cpp
index e9660ac140301..ae5818419cba5 100644
--- a/llvm/lib/Target/AArch64/AArch64ExpandImm.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ExpandImm.cpp
@@ -549,6 +549,8 @@ void AArch64_IMM::expandMOVImm(uint64_t Imm, unsigned BitSize,
// Prefer MOVZ/MOVN over ORR because of the rules for the "mov" alias.
if ((BitSize / 16) - OneChunks <= 1 || (BitSize / 16) - ZeroChunks <= 1) {
expandMOVImmSimple(Imm, BitSize, OneChunks, ZeroChunks, Insn);
+ assert(Insn.size() == 1 &&
+ "Move of immediate should have expanded to a single MOVZ/MOVN");
return;
}
|
efriedma-quic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The expansion of move immediate in `expandMOVImm` follows the priority of the `MOV` alias. In addition, the selection there properly prefers expansion based on perf optimality order. This change adds a simple assert that `expandMOVImmSimple` expands a single optimal MOVZ/N.
ab50da9 to
54f500f
Compare
…vm#169341) The expansion of move immediate in `expandMOVImm` follows the priority of the `MOV` alias. In addition, the selection there properly prefers expansion based on perf optimality order. This change adds a simple assert that `expandMOVImmSimple` expands a single optimal MOVZ/MOVK.
…vm#169341) The expansion of move immediate in `expandMOVImm` follows the priority of the `MOV` alias. In addition, the selection there properly prefers expansion based on perf optimality order. This change adds a simple assert that `expandMOVImmSimple` expands a single optimal MOVZ/MOVK.
…vm#169341) The expansion of move immediate in `expandMOVImm` follows the priority of the `MOV` alias. In addition, the selection there properly prefers expansion based on perf optimality order. This change adds a simple assert that `expandMOVImmSimple` expands a single optimal MOVZ/MOVK.
The expansion of move immediate in
expandMOVImmfollows the priority of theMOValias. In addition, the selection there properly prefers expansion based on perf optimality order. This change adds a simple assert thatexpandMOVImmSimpleexpands a single optimal MOVZ/MOVK.