You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement machine dependent peephole optimizer at lower time #8035
New pass is intended to exploit machine dependent instructions and allow for low level optimization based on specific instruction semantics.
Goals:
Run before register allocation to remove issues with false dependencies and allow reduction in register pressure.
Exploit specific features of the target ISA. Including but not limited to:
Immediate encoding size/shift semantics
Particular condition flag implementation
Target dependent address mode formation
Allow more sophisticated instruction selection:
bt{s|r|c} formation
Aggressive optimization around condition flag/branch sequences.
Avoid machine glass jaws like LCP.
Reorder/rework instructions to reduce register pressure.
Particular open questions:
Which dataflow formulation should be used? Adjacent in window? Expression temp def/use? Unaliased SSA or some cheaper extended basic block approximation?
Run just before RA or at higher tier run after?
How to encapsulate a transform.
How to enforce a high level of debug dump/tracing functionality for managing the transforms.
This is a big and perhaps controversial feature, but is intended to allow for more proactive engagement on code selection opts for collaborators with interests in particular targets.
Add random repro case for bit shifting that we're currently missing on x86.
Presumably you're referring to the and x, 31 added by the C# compiler. That can be easily be removed in lowering or morph. I once tried in morph, saves ~500 bytes in jitdiff fx.
@russellhadley The morph version is in dotnet/coreclr#8744. I did it in morph thinking that it may be a good idea to get rid of unnecessary instructions early but then gave up on it because morph is already too hairy. I suppose I'll make a lower version one of these days. After all the example you have is written by me, I just found it on my HDD :)
Activity
russellhadley commentedon May 9, 2017
Add random repro case for bit shifting that we're currently missing on x86. https://gist.github.com/russellhadley/e55fc9a918626166d98077aa3c8047c6
mikedn commentedon May 10, 2017
Presumably you're referring to the
and x, 31added by the C# compiler. That can be easily be removed in lowering or morph. I once tried in morph, saves ~500 bytes in jitdiff fx.russellhadley commentedon May 10, 2017
@mikedn If you have the change we'd take it. :) The example was in an old issue in our internal database and I was just cleaning house.
mikedn commentedon May 10, 2017
@russellhadley The morph version is in dotnet/coreclr#8744. I did it in morph thinking that it may be a good idea to get rid of unnecessary instructions early but then gave up on it because morph is already too hairy. I suppose I'll make a lower version one of these days. After all the example you have is written by me, I just found it on my HDD :)
mikedn commentedon May 15, 2017
PR for shift count masking removal in lowering: dotnet/coreclr#11594