[vectorIntrinsics+mask] RFR: 8264563: Add basic masking feature support for Vector API mask operations

Viswanathan, Sandhya sandhya.viswanathan at intel.com
Fri Apr 2 18:19:19 UTC 2021


Hi Xiaohong,

Thanks a lot for this. We are almost there. I was hoping that this PR will only have the java and blend node creation in backend. No predicate register support, no new IR nodes.  i.e. in this first patch Matcher::match_rule_supported_masked_vector() set as false for every architecture including SVE.

My thought for smooth progress steps is as follows:
1) Xiaohong commits *.java and blend node creation with Matcher::match_rule_supported_masked_vector() set as false for every architecture
2) Jatin commits mainline predicate register patch with x86 predicate registers
3) Xiaohong commits SVE predicate register support and basic new nodes creation 
4) Both x86/sve work can then go on in parallel.

For steps 1) the code needs to be approved by Paul Sandoz and Vladimir Ivanov. This step is most straight forward, and we should be able to get it in quickly.
For step 2) and 3) new node definition code needs to be approved by Vladimir Ivanov. Here step 2) has been already discussed extensively. Step 3) might need some discussion and back and forth.
Step 4) we could request for guidance from Vladimir Ivanov as needed

Please let me know what you think of this or if you have alternate suggestion.

Best Regards,
Sandhya  


-----Original Message-----
From: panama-dev <panama-dev-retn at openjdk.java.net> On Behalf Of Xiaohong Gong
Sent: Friday, April 02, 2021 2:38 AM
To: panama-dev at openjdk.java.net
Subject: [vectorIntrinsics+mask] RFR: 8264563: Add basic masking feature support for Vector API mask operations

Hi, this is the basic masking support PR for Vector API mask operations on platforms like SVE/AVX-512. The main codes are from [1], which contains:

- The predicate register allocation for Arm SVE, and vector mask type definition.
- The basic optimization for parts of the mask operations with masking feature. It contains:   
 
  1. Vector API java implementation changes for masked binary/store.
  2. C2 compiler mid-end changes, including new vector intrinsics implementation and mask IRs.

Note that for easier discussion, this PR only provides the changes for limited masked operations (e.g. binary/store) and the mask generations (e.g. load/compare/maskAll). We will continue working on the following missing parts:

- Mask support for other operations (unary,ternary,reduction,load,etc.)
- More mask IRs implementation (and/or/xor, toVector, allTrue, anyTrue, trueCount, eq, etc)
- Vector boxing/unboxing support for mask type (deoptimization support for predicate registers)

Also note that this PR doesn't contain any backend implementations. So the blend pattern will be generated as before. Regarding to the AArch64 SVE backend support, we will create a separate PR based on this one in future.
  
[1] https://github.com/openjdk/panama-vector/pull/40

See more details from:
http://cr.openjdk.java.net/~xgong/rfr/mask/Vector%20API%20masking%20support%20proposal%20for%20Arm%20SVE.pdf
http://cr.openjdk.java.net/~xgong/rfr/mask/VectorAPI%20masking%20support.pdf

Any suggestions and discussions are welcome! Thanks a lot!

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

Commit messages:
 - 8264563: Add basic masking feature support for Vector API mask operations
 - SVE predicate register allocation support

Changes: https://git.openjdk.java.net/panama-vector/pull/57/files
 Webrev: https://webrevs.openjdk.java.net/?repo=panama-vector&pr=57&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264563
  Stats: 2360 lines in 76 files changed: 1647 ins; 223 del; 490 mod
  Patch: https://git.openjdk.java.net/panama-vector/pull/57.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-vector pull/57/head:pull/57

PR: https://git.openjdk.java.net/panama-vector/pull/57


More information about the panama-dev mailing list