Commit Graph
28 Commits
Author SHA1 Message Date
Ryan Houdek 704b8f9679 Disables Redundant Context Load Elimination pass.
It's currently broken (Due to not 100% valid IR?)
2020-03-06 07:55:37 +02:00
Ryan Houdek b199ce70e9 Changes over IRValidation to the new format.
We still can't pass this validation pass
2020-03-06 07:55:37 +02:00
Ryan Houdek b7c7a34cf6 Changes (aggressively) how branching is handled in the frontend.
This changes over CondJump to have a defined True and False branch path.
Additionally needing to change over everything to handle this.
This now means that a false branch condition will no longer assume
fallthrough past this instruction.
Currently the x86-64 JIT generates an additional jmp instruction on
fallthrough that isn't optimized away.

This is working towards improvements in our IR branching model and
improving IRValidation in doing so.
This is working towards the model that IRBlocks can only have 0-2
successors.
Ret/Exit - 0 successors
Jump - 2 successors
CondJump - 2 successors

TBD:
Syscall/CPUID - Breaking block?
2020-03-06 07:55:37 +02:00
Scott Mansell 597ee06243 Add ConstProp for Mul 2020-03-06 07:55:36 +02:00
Scott Mansell 5263f94d84 Elimitate loads before const prop 2020-03-06 07:55:36 +02:00
Scott Mansell b148afef4b Add Dead Code Elimitation pass
Refactor the previous WIP to use NumUses
2020-03-06 07:55:36 +02:00
Scott Mansell b34465544a Fix Incorrect tracking during Redudent Flag pass 2020-03-06 07:55:36 +02:00
Scott Mansell 8e34a74030 Keep node usage when compacting 2020-03-06 07:55:36 +02:00
Scott Mansell d1f2d85d0c Fix up usage tracking of Args.
Make sure we keep them up to date when removing
nodes.
2020-03-06 07:55:36 +02:00
Scott Mansell b054807270 WIP Dead Code Elimitation pass 2020-03-06 07:55:36 +02:00
Ryan Houdek aabc6f6de2 Extends ConstProp pass a bit more.
Still doesn't cover all the IROps but it hits quite a few more that I
could see.
2020-03-06 07:55:35 +02:00
Ryan Houdek 0eb86389de Cleans up RA spill slot calculation.
RA spill slots now have live ranges so we can reuse the spill slot.
This can reduce spill stack usage significantly in code ranges with
large live ranges.
2020-03-06 07:55:35 +02:00
Ryan Houdek 012805fd72 Fixes multiblock and a few bugs in RA.
This makes it so multiblock can now be enabled with the JITs.
Results in a decent performance increase by itself.
2020-03-06 07:55:35 +02:00
Ryan Houdek c105c52d67 Changes IRValidation to use the new IR::GetArgs function. 2020-03-06 07:55:34 +02:00
Ryan Houdek 52b5ac9e19 Changes slightly how IR::IRHeader is represented 2020-03-06 07:55:33 +02:00
Ryan Houdek f27f9485f6 Changes IR::CondJump's condition to dump textually. 2020-03-06 07:55:33 +02:00
Ryan Houdek a8ff6414c1 Fixes indent failure on IR dumping.
Depending on IR ordering then it could have wrapped around to max
indent.
2020-03-06 07:55:22 +02:00
Ryan Houdek a8bb815a76 Adds IR::ADD to constprop pass. 2020-03-06 07:55:21 +02:00
Ryan Houdek 218f38ff3d Adds new IR::GetArgs function
This returns SSA args that will eventually be register allocated.
2020-03-06 07:55:20 +02:00
Ryan Houdek 13a15d6f3e Fix RA pass to support spilling 2020-03-06 07:55:17 +02:00
Ryan Houdek d645e58721 Remove some debug logs 2020-03-06 07:55:15 +02:00
Ryan Houdek 1dbeff462c Fixes Redundant Context Load Elimination pass
Allows other passes to see more things it can optimize
`ReplaceAllUsesWith` is a bit of a trap and needs to be replaced.
2020-03-06 07:55:14 +02:00
Ryan Houdek 199cfd76d8 Refactor IR and other changes that are hard to split
I had to change how blocks are represented to make it easier to parse
This required a fairly substantial refactor that makes it so blocks are
represented differently and we can walk them sequentially.

This will make future analysis easier to deal with.
Had to rewrite the passes and core's parsing of the IR afterwards.

Moved RA in to a optimization pass to be shared between the JIT backends
This works because x86-64 and AArch64 RA can be identical.

Still doesn't support PHI nodes or spilling correctly, this is the first
step in the process of getting there.
2020-03-06 07:55:13 +02:00
Ryan Houdek 0d20ec0f2c [MemoryMapper] Adds debug only GetPointer with size check. 2020-03-06 07:52:35 +02:00
Ryan Houdek 065e72141a Reenable optimization passes
Keep validation pass disabled for now
2020-03-06 07:51:08 +02:00
Ryan Houdek f7834cb32c Let the IRCompaction pass DCE dead ops 2020-03-06 07:50:24 +02:00
Ryan Houdek 8c8be231d8 Cleanup some ugly usage of OrderedNode's NodeOffset
ID() gives us the clean ID, no need to calculate it manually
2020-03-06 07:50:15 +02:00
Ryan Houdek 7252050e42 Initial commit 2020-03-06 07:48:39 +02:00