- User Since
- Oct 20 2016, 10:58 AM (164 w, 3 d)
Oct 16 2017
TODO: add a flag -fno-spill-costs to allow current behavior and update docs
Oct 15 2017
- fix 'Defined but not used: ‘reading’'
Also: will need to verify this, but it shouldn't slow down compilation if -O <2 because the spillQuickly path will be taken through linearSpill which preserves the behavior of HEAD (i.e. spill whichever reg we find first without performing any cost measures).
I ran benchmarks comparing this patch vs. master (2be55b85):
- with no flags
- with -fannotate-loops (linear allocator + enable optimization)
- with -fregs-graph -fannotate-loops (graph allocator + enable optimization)
This patch was dormant for months because I couldn't figure out why the testsuite was failing and was busy with other things. I figured it out as I was writing an email to update ghc-devs  and set to work again. I've since written more tests and re-run the benchmarks.
Jun 1 2017
RegAlloc unit tests are failing right now
- now exporting SpillLoc constructors
- converted LoopInfo from a tuple to a record type
- UniqFM -> UniqSet transition
- fixed type annotation for linearSpillResult
- wrote assertLinearSpills
- wrote testSpillSingleCandidate
- not testing unassigned regs because there might be unassigned regs that still aren't free
- added stack map check and RegAllocStats check
- renamed assertVRegSpilled -> checkVRegSpilled because it doesnt use assertIO
- wrote assertEither and genCandidatesInBoth
- added type annotations to top level filenames
- refactored SpillCost data type and plusSpillCost into their own module SpillCostType
- fixed haddock comment in canFallThrough
- fixed haddock comment in annotateLoop
- changed foldr -> foldl' in annotateLoop
- explaining why we drop head
- made spacing more consistent with GHC (4 spaces from the left)
Feb 7 2017
- fixed comment
- fixed bug in pickSpill
- fixed warnings
- updated todos
- removed unused imports
- applying lint suggestions
Feb 4 2017
- updated todos
- refactored NcgImpl into its own module to eliminate AsmCodeGen.hs-boot
Feb 3 2017
- fixing line length warnings
Jan 28 2017
Now collecting loop annotations and spill costs in Linear.RegAllocStats so they can be used for unit tests
Jan 26 2017
instead of dying on error now returning the first element if we dont have spill costs
choosing which register to spill using minimumBy instead of sortOn
Jan 25 2017
fixed filtering for registers we can spill in chooseSpillSlowly
Jan 24 2017
Added more comments
Integrating loop annotations with the linear register allocator plus general improvements.
Jan 17 2017
Jan 16 2017
@simonmar @DemiMarie Instead of fixing the graph allocator in this patch I've been working on integrating loop annotations with the linear allocator (to be enabled with -O2). This has turned out to be a larger task than I expected and I didn't want to send really rough code to phab. I'll clean it up & update this patch soon.
I think fixing the graph allocator should be its own patch.
Jan 13 2017
Jan 10 2017
Fixed the testLoop unit test
Changed SpillCost to track writes, reads, and instrs in loops
Changed loopMultiplier to reflect the other changes in SpillCost
Fixed bug in annotateLoop where we built up path backwards & forgot to reverse it
Jan 5 2017
Jan 3 2017
Jan 2 2017
Checking in first unit test.
Dec 31 2016
changed SpillCost.hs to count instructions inside loops
Current problem: since vregs aren't associated with loop information we're waiting until we have to spill something then multiplying everything by the loopMultiplier... which of course doesn't help with picking the right one.
Need to either be more specific with spill costs or change where we spill. The former is more practical--changing spill locations would require backtracking and might make the graph uncolorable (I think? someone else is welcome to weigh in on how this might affect graph colorability)
The goal now is to figure out which variables are used in a loop then spill the ones that aren't. This will be an application of the information we've already gathered, the hard work of finding loops is done (I think--need test cases).
Dec 28 2016
very much a work in progress, but thought I'd put it up on Phab sooner rather than later
- removed unused file
accidentally only sent HEAD, needed arc to squash everything together
Nov 8 2016
Moved banner comment
Added explanation for test exports in AsmCodeGen.hs
Added overall explanation to the top of the file and comments throughout.
Oct 31 2016
Oct 30 2016
Trying to get harbormaster to fire
Oct 27 2016
Removed unused variables.
Fixed accidental comma
Added haddock sections to AsmCodeGen and fixed test comments
Any ideas on how to write getNcgImpl? Like
Todo: write getNcgImpl in AsmCodeGen.hs, add it to the export list instead of x86NcgImpl, and document:
Removed Opt_KeepRegallocIntermediates in favor of Opt_D_dump_asm_stats and ignore_stderr
Oct 26 2016
Any suggestions for making this platform-agnostic without exposing too much of the guts of AsmCodeGen.hs?
Fixed line length warning
Oct 20 2016
@mpickering There was a discussion about this in IRC GHC. I used git diff master..HEAD, uploaded via the Phabricator web interface, and managed to (accidentally) evade the hook. It has since been fixed. Sorry about that.