summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2023-01-20 07:28:20 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-31 15:51:45 -0500
commit30989d137b8f3a8fddbfd116e04b48f23c24f86c (patch)
treedde55704c3a67e38bd511db194a8f206ca4ba96c
parentbe417a47c7695998dea0adc05489a7b8838a78b6 (diff)
downloadhaskell-30989d137b8f3a8fddbfd116e04b48f23c24f86c.tar.gz
nativeGen: Teach graph-colouring allocator that x18 is unusable
Previously trivColourable for AArch64 claimed that at 18 registers were trivially-colourable. This is incorrect as x18 is reserved by the platform on AArch64/Darwin. See #22798.
-rw-r--r--compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
index 26ce377ab1..1334fb2fe6 100644
--- a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
+++ b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
@@ -109,10 +109,8 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcInteger conflicts excl
ArchPPC -> 16
ArchPPC_64 _ -> 15
ArchARM _ _ _ -> panic "trivColorable ArchARM"
- -- We should be able to allocate *a lot* more in principle.
- -- essentially all 32 - SP, so 31, we'd trash the link reg
- -- as well as the platform and all others though.
- ArchAArch64 -> 18
+ -- N.B. x18 is reserved by the platform on AArch64/Darwin
+ ArchAArch64 -> 17
ArchAlpha -> panic "trivColorable ArchAlpha"
ArchMipseb -> panic "trivColorable ArchMipseb"
ArchMipsel -> panic "trivColorable ArchMipsel"