[Git][ghc/ghc][master] AArch64: fix MOVK regUsageOfInstr to mark dst as both read and written
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 2823b039 by Ian Duncan at 2026-03-26T03:52:21-04:00 AArch64: fix MOVK regUsageOfInstr to mark dst as both read and written MOVK (move with keep) modifies only a 16-bit slice of the destination register, so the destination is both read and written. The register allocator must know this to avoid clobbering live values. Update regUsageOfInstr to list the destination in both src and dst sets. No regression test: triggering the misallocation requires specific register pressure around a MOVK sequence, which is difficult to reliably provoke from Haskell source. - - - - - 1 changed file: - compiler/GHC/CmmToAsm/AArch64/Instr.hs Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -119,7 +119,7 @@ regUsageOfInstr platform instr = case instr of LSL dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) LSR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) MOV dst src -> usage (regOp src, regOp dst) - MOVK dst src -> usage (regOp src, regOp dst) + MOVK dst src -> usage (regOp src ++ regOp dst, regOp dst) MOVZ dst src -> usage (regOp src, regOp dst) MVN dst src -> usage (regOp src, regOp dst) ORR _fmt dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2823b03966e495581f4695f07649c588... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2823b03966e495581f4695f07649c588... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)