summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Parser.y
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-06-02 19:27:13 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-23 22:48:18 -0400
commit7750bd456f32c3e91b9165587fe290122b9c2444 (patch)
tree4413a4e945b731aaea00a2e0195d9f546053c5b0 /compiler/GHC/Cmm/Parser.y
parent809caedffe489931efa8c96a60eaed6d7ff739b9 (diff)
downloadhaskell-7750bd456f32c3e91b9165587fe290122b9c2444.tar.gz
Cmm: introduce SAVE_REGS/RESTORE_REGS
We don't want to save both Fn and Dn register sets on x86-64 as they are aliased to the same arch register (XMMn). Moreover, when SAVE_STGREGS was used in conjunction with `jump foo [*]` which makes a set of Cmm registers alive so that they cover all arch registers used to pass parameter, we could have Fn, Dn and XMMn alive at the same time. It made the LLVM code generator choke (see #17920). Now `SAVE_REGS/RESTORE_REGS` and `jump foo [*]` use the same set of registers.
Diffstat (limited to 'compiler/GHC/Cmm/Parser.y')
-rw-r--r--compiler/GHC/Cmm/Parser.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Cmm/Parser.y b/compiler/GHC/Cmm/Parser.y
index 1c9f0ad041..e3d7e93486 100644
--- a/compiler/GHC/Cmm/Parser.y
+++ b/compiler/GHC/Cmm/Parser.y
@@ -1115,6 +1115,9 @@ stmtMacros = listToUFM [
( fsLit "LOAD_THREAD_STATE", \[] -> emitLoadThreadState ),
( fsLit "SAVE_THREAD_STATE", \[] -> emitSaveThreadState ),
+ ( fsLit "SAVE_REGS", \[] -> emitSaveRegs ),
+ ( fsLit "RESTORE_REGS", \[] -> emitRestoreRegs ),
+
( fsLit "LDV_ENTER", \[e] -> ldvEnter e ),
( fsLit "LDV_RECORD_CREATE", \[e] -> ldvRecordCreate e ),