RFR: 8241502: Migrate x86_64.ad to MacroAssembler

John Tortugo github.com+2249648+johntortugo at openjdk.java.net
Wed Mar 17 17:53:49 UTC 2021


On Mon, 15 Mar 2021 10:18:52 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Hi again, here is a quick update on the progress of this and an ask for advice.
>> 
>> I finished doing all conversions. I'm using an automated approach to validate the conversions: for each instruction that I converted I created an `enc_class` (just for debugging purposes) with pretty much the code that @dean-long provided above. However, I'm hitting a limitation on test coverage. I performed 248 conversions, but until now I was able to test only 203! I've tested tier1, tier2, and tier3 with different GCs, different VM options, on Linux and macOS. In other words, I've tried several things that I could think of but I couldn't make C2 use some instructions. 
>> 
>> I created a [Gist with the list of instructions I couldn't test so far](https://gist.github.com/JohnTortugo/c6d09a8ef6160422d6bf0ae5f894c1fe). Can you suggest something I can do to make C2 use those additional instructions?
>
> Was -Xcomp one of the flags you tried?  If so, then you may need to write new tests for those instructions without test coverage.  Or you could do the 203 first and file a new RFE for the remaining.

Hi @dean-long, thanks for the suggestions. Yes, "-Xcomp" is among the flags that I tried. In the end, what helped the most was commenting out some optimizations that simplify the IR graph - i.e., I commented out a bunch of <IRNode>::Ideal methods. I also tried commenting out some instructions in the .ad file and also changing `ins_costs`. These things helped quite a lot and I was able to get 26 more conversions validated; now the total of conversions + validations is 239. The conversions that I couldn't validate I didn't include in the PR; I'll follow your suggestion and create an RFE once the current PR is merged.

So, please consider this PR ready for review. I've tested these changes on Linux, Windows, and macOS with fastdebug and release binaries running jdk_tier1/2/3 and hotspot_all. Tests were also performed with different GCs: ZGC, Shenandoah, and G1.

I didn't remove the, now unused, `enc_classes` and related code; I think it would be better to keep them for a few more days to make easier any eventual debugging. I'll be happy to remove them if you think that's a better approach.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2420


More information about the hotspot-compiler-dev mailing list