Skip to content

Commit 43e7361

Browse files
committed
[AArch64] Assert that expandMOVImm prioritizes optimal single MOVZ/MOVN
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.
1 parent 35ffe10 commit 43e7361

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Target/AArch64/AArch64ExpandImm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ void AArch64_IMM::expandMOVImm(uint64_t Imm, unsigned BitSize,
549549
// Prefer MOVZ/MOVN over ORR because of the rules for the "mov" alias.
550550
if ((BitSize / 16) - OneChunks <= 1 || (BitSize / 16) - ZeroChunks <= 1) {
551551
expandMOVImmSimple(Imm, BitSize, OneChunks, ZeroChunks, Insn);
552+
assert(Insn.size() == 1 && "Move of immediate should have expanded to a single MOVZ/MOVN");
552553
return;
553554
}
554555

0 commit comments

Comments
 (0)