Skip to content

Commit 7c8f989

Browse files
tomershafiraadeshps-mcw
authored andcommitted
[AArch64] Assert expandMOVImm prioritizes optimal single MOVZ/N (llvm#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.
1 parent fa822d7 commit 7c8f989

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/AArch64/AArch64ExpandImm.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ 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 &&
553+
"Move of immediate should have expanded to a single MOVZ/MOVN");
552554
return;
553555
}
554556

0 commit comments

Comments
 (0)