Open gretay-js opened 2 years ago
Also, from the PR TODO list:
Reload
~~Not strictly IRC-related, but the spilling costs should not include any use by a probe.~~ See https://github.com/ocaml-flambda/flambda-backend/pull/945
Stack operands: revisit https://github.com/ocaml-flambda/flambda-backend/pull/771#discussion_r967049882
~~Not IRC-specific, but part of the pipeline: consider moving to dynamic arrays or doubly linked list for the layout.~~ See https://github.com/ocaml-flambda/flambda-backend/pull/1124
In cfg_stack_operands.ml
allow stack operands for Valueofint
and Intofvalue
and maybe Opaque
.
See comment in https://github.com/ocaml-flambda/flambda-backend/pull/855
There are likely missed opportunities for stack operands in IRC because of aliasing. Indeed, the functions rewriting arg/res to use stack operands do get a map of spilled registers, but that map does not include aliases.
Other missed opportunities for stack operands
are related to float
operations - See upstream's
version.
Port upstream's improvement to LS heuristics. note: https://github.com/ocaml-flambda/flambda-backend/pull/1464 is possibly equivalent while applying to all CFG-based allocators
There are no compilers hooks on the IRC pipeline. While we do not have spill/split there (yet), we could have a hook for liveness. The compiler hook for CFG is also not called on the IRC pipeline.
The IRC pipeline does not have an equivalent
of Available_regs
. See https://github.com/ocaml-flambda/flambda-backend/pull/1748
Remove the calls to See https://github.com/ocaml-flambda/flambda-backend/pull/1290Profile.record
introduced by https://github.com/ocaml-flambda/flambda-backend/pull/1095 and https://github.com/ocaml-flambda/flambda-backend/pull/1123.
~~Revisit the CR introduced by https://github.com/ocaml-flambda/flambda-backend/pull/1292, that is: ensure optimality of stack frame sizes.~~ See https://github.com/ocaml-flambda/flambda-backend/pull/1464
Split/rename preprocessing phase (i.e. https://github.com/ocaml-flambda/flambda-backend/pull/1442 and follow-ups):
Profile.record calls
after build-time optimization;~~In rewrite_gen
(Regalloc_rewrite
module),
the calls to Array.map
are not necessary since
the arrays are no longer shared. (It means that the
condition might also not be necessary.)~~
See https://github.com/ocaml-flambda/flambda-backend/pull/1544
~Get rid of the STACK_SLOTS_OPTIM
parameter introduced by https://github.com/ocaml-flambda/flambda-backend/pull/1464.~
See https://github.com/ocaml-flambda/flambda-backend/pull/1545
After https://github.com/ocaml-flambda/flambda-backend/pull/1441, Regalloc_utils.insert_block
accepts to insert an empty block. Double
check whether it is actually necessary, or
we can avoid ever inserting empty blocks.
In https://github.com/ocaml-flambda/flambda-backend/pull/1442, consider more destruction points,
as mentioned in the CR-soons in proc.ml
.
Get rid of Instruction.dummy
(and others)
once we have nullable types.
In RemoveDominatedSpillsForConstants
,
consider whether it would be better to
compute num_sets
through a forward
dataflow analysis. Also reconsider the status
of a missing key in this table:
As noted in https://github.com/ocaml-flambda/flambda-backend/pull/1741, the various optimizations can result in empty sets in the map. Double check whether the corresponding mappings can be safely be removed.
Not urgent since we currently only support
amd64, but IRC current ignores the
Proc.rotate_registers
variable (unlike
Coloring
).
amd64/reload.ml
has important comments about instruction set constraints on locations and sharing of registers. We should preserve this information when moving to the CFG pipeline, perhaps as part of the next version of stack operands.
A few items of followup after merging https://github.com/ocaml-flambda/flambda-backend/pull/678
Create a separate directory for regalloc (either under cfg or next to it, not sure)See https://github.com/ocaml-flambda/flambda-backend/pull/1306rewrite
: spilled_nodes as in https://github.com/ocaml-flambda/flambda-backend/pull/774#pullrequestreview-1097776074 , and possiby removingreset
by somehow making State.make and State.reset more uniform.