RFR: 8308339: AArch64: Remove extra `UseSVE` Predicate in ad file

Andrew Haley aph at openjdk.org
Tue May 30 08:45:56 UTC 2023


On Wed, 24 May 2023 02:16:16 GMT, Fei Gao <fgao at openjdk.org> wrote:

> If a match rule belongs to one of the following situations, we can remove extra `UseSVE` Predicate:
> 
> 1. If any src operand type is `pReg`, which is SVE specific, we can remove `Predicate(UseSVE > 0)`. But if only dst operand type is `pReg`, we can't remove `Predicate(UseSVE > 0)`, since the DFA of matcher selects by src operands and instruction cost, not involving dst operand.
> 
> 2. If matcher can use src operand type, i.e., `pReg` or `vReg`, to distinguish sve from neon, we can remove
> `Predicate(UseSVE == 0)` for rules on neon.
> 
> 3. When the condition in `Predicate()` is false on current platform, it's definitely impossible to generate the corresponding node pattern from C2. Then we can remove `Predicate()`, like removing `predicate(UseSVE > 0)` for all `PopulateIndex` rules.
> 
> After the patch, the code size of libjvm.so decreased from 25.42M to 25.39M, by 25.3K.
> 
> Testing:
>   No new failures found on tier 1 - 3.
>   No significant performance regression compared with master.

src/hotspot/cpu/aarch64/aarch64_vector.ad line 450:

> 448: 
> 449: instruct loadV_masked(vReg dst, vmemA mem, pRegGov pg) %{
> 450:   predicate(UseSVE > 0);

How about


  // This predicate is unneeded because only SVE has pRegs.
  // predicate(UseSVE > 0);

I still don't like it much, but at least it's clear.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14112#discussion_r1209938305


More information about the hotspot-compiler-dev mailing list