summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2023-01-20 07:28:20 -0800
committerMatthew Pickering <matthewtpickering@gmail.com>2023-02-01 13:18:46 +0000
commitac6c24f7e189ce06469e42933ba23ac31a4e1539 (patch)
treeaafcbe20acb2bffd93a6a7fcf2c9b3835951a90f
parent3c21d69d387d3033737e8e9665d3830a1efa5452 (diff)
downloadhaskell-ac6c24f7e189ce06469e42933ba23ac31a4e1539.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. (cherry picked from commit 30989d137b8f3a8fddbfd116e04b48f23c24f86c)
-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"