Commit e446830
Add pattern matching for SVE intrinsics that operate on mask operands (#114438)
* Add pattern matching for SVE intrinsics that operate on mask operands
Introduces `fgMorphTryUseAllMaskVariant` for ARM64 that looks for various
named intrinsics that have operands that look 'mask-like'. E.g. source
operands originating from Sve.CreateTrueMask* may be recognized as
masks, causing the JIT to prefer to use the predicated version of the
instruction as codegen for the intrinsic. It will also inspect
ConditionalSelect intrinsic nodes to match instructions with governing
predicates. The transform runs during morph.
It's possible to emit the following instructions after this patch:
* ZIP{1,2} <Pd>.<T>, <Pn>.<T>, <Pm>.<T> (Sve.ZipLow, Sve.ZipHigh)
* UZP{1,2} <Pd>.<T>, <Pn>.<T>, <Pm>.<T> (Sve.UnzipEven, Sve.UnzipOdd)
* TRN{1,2} <Pd>.<T>, <Pn>.<T>, <Pm>.<T> (Sve.TransposeEven, Sve.TransposeOdd)
* REV <Pd>.<T>, <Pn>.<T> (Sve.ReverseElement)
* AND <Pd>.B, <Pg>/Z, <Pn>.B, <Pm>.B (Sve.And)
* BIC <Pd>.B, <Pg>/Z, <Pn>.B, <Pm>.B (Sve.BitwiseClear)
* EOR <Pd>.B, <Pg>/Z, <Pn>.B, <Pm>.B (Sve.Xor)
* ORR <Pd>.B, <Pg>/Z, <Pn>.B, <Pm>.B (Sve.Or)
* SEL <Pd>.B, <Pg>, <Pn>.B, <Pm>.B (Sve.ConditionalSelect)
Contributes towards #101970
* Fix test failure and add FileCheck tests
* Don't run tests on OSX
* Don't run tests for Mono
* Move the transform later in fgOptimizeHWIntrinsic
* Rename gtNewSimdAllFalseMaskNode
* Re-design using HW_Flag_AllMaskVariant
* Add missing function documentation in hwintrinsic.h
* Fix integer comparison and add assertion
* Refactor to follow similar path to XARCH
* fix the refactoring
* jit formatting
* Move code into morph.cpp
---------
Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>1 parent 27984a3 commit e446830
File tree
9 files changed
+564
-156
lines changed- src
- coreclr/jit
- tests/JIT/opt/SVE
9 files changed
+564
-156
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3132 | 3132 | | |
3133 | 3133 | | |
3134 | 3134 | | |
| 3135 | + | |
3135 | 3136 | | |
3136 | 3137 | | |
3137 | 3138 | | |
| |||
6691 | 6692 | | |
6692 | 6693 | | |
6693 | 6694 | | |
| 6695 | + | |
| 6696 | + | |
| 6697 | + | |
| 6698 | + | |
| 6699 | + | |
| 6700 | + | |
| 6701 | + | |
| 6702 | + | |
| 6703 | + | |
6694 | 6704 | | |
6695 | 6705 | | |
6696 | 6706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
236 | 241 | | |
237 | 242 | | |
238 | 243 | | |
| |||
1133 | 1138 | | |
1134 | 1139 | | |
1135 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1136 | 1202 | | |
1137 | 1203 | | |
1138 | 1204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3341 | 3341 | | |
3342 | 3342 | | |
3343 | 3343 | | |
3344 | | - | |
| 3344 | + | |
3345 | 3345 | | |
3346 | 3346 | | |
3347 | 3347 | | |
| |||
3355 | 3355 | | |
3356 | 3356 | | |
3357 | 3357 | | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
3358 | 3372 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
705 | 713 | | |
706 | 714 | | |
707 | 715 | | |
| |||
2478 | 2486 | | |
2479 | 2487 | | |
2480 | 2488 | | |
| 2489 | + | |
2481 | 2490 | | |
2482 | 2491 | | |
2483 | 2492 | | |
| |||
0 commit comments