-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
arch:aarch32AArch32 (32 bit ARM) issuesAArch32 (32 bit ARM) issuestech-debtTechnical debt that would be nice to clean upTechnical debt that would be nice to clean up
Description
The compile times for the macaw-aarch32 are particularly severe. On my machine, it can easily take 10+ minutes to build macaw-aarch32 alone, and it requires several gigabytes of RAM to do so.
There are likely a couple of ways that we could improve things. To paraphrase a previous discussion with @danmatichuk:
- The bulk of the compilation time is spent compiling the Template Haskell–generated code in
Data.Macaw.ARM.Semantics.{ARMSemantics,ThumbSemantics}, which are monolithic modules that contain the semantics of every single ARM/Thumb instruction in the AArch32 ISA. GHC's compilation times are known to suffer when compiling extremely large modules, so it is likely that we would observe improvements by splitting these up into smaller modules. - Some of AArch32's instructions are polymorphic in the bit widths of certain arguments, but
macaw-aarch32will generate a copy of the semantics for each monomorphic instantiation of a particular instruction. This results in a rather excessive amount of code duplication in the Template Haskell–generated code. Finding a way to reduce this code duplication would likely improve the compile times quite a bit. - Similarly,
macaw-aarch32duplicates several instructions simply because they’re defined as separate instructions indismantle, so you might end up with five or six copies of instructions even thoughasl-translatoronly defines the instruction once. We should look more into this to see if this can be altered.
Metadata
Metadata
Assignees
Labels
arch:aarch32AArch32 (32 bit ARM) issuesAArch32 (32 bit ARM) issuestech-debtTechnical debt that would be nice to clean upTechnical debt that would be nice to clean up