-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize multi-dimensional array access #70271
Optimize multi-dimensional array access #70271
Commits on Jul 1, 2022
-
Multi-dimensional array cleanups
1. Remove unused `gtArrElemType` member from GenTreeArrIndex, GenTreeArrOffs 2. Add function iheader documentation for `impArrayAccessIntrinsic` 3. Add JITDUMP output reasons for rejecting MD intrinsics in `impArrayAccessIntrinsic` No diffs
Configuration menu - View commit details
-
Copy full SHA for a869ba4 - Browse repository at this point
Copy the full SHA a869ba4View commit details -
Fix GT_ARR_LENGTH to use TYP_BYREF, not TYP_REF
This doesn't lead to any asm diffs because it was always contained. However, we BYREF is the correct type, since we've added to the array object base.
Configuration menu - View commit details
-
Copy full SHA for 46f1397 - Browse repository at this point
Copy the full SHA 46f1397View commit details
Commits on Jul 2, 2022
-
It still needs support in ValueNumber, RangeCheck, CSE, RangeProp. No diffs.
Configuration menu - View commit details
-
Copy full SHA for d0fb518 - Browse repository at this point
Copy the full SHA d0fb518View commit details -
Configuration menu - View commit details
-
Copy full SHA for bbd89d0 - Browse repository at this point
Copy the full SHA bbd89d0View commit details -
Implement xarch codegen for GT_MDARR_LENGTH, GT_MDARR_LOWER_BOUND
Add skeleton for MD array ops morphing. No diffs
Configuration menu - View commit details
-
Copy full SHA for 6e1bcc2 - Browse repository at this point
Copy the full SHA 6e1bcc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c80b2c - Browse repository at this point
Copy the full SHA 6c80b2cView commit details -
Implement early morphing of multi-dimensional array expressions
Also, 1. Convert dim/rank types to `unsigned` 2. Assume type of GT_MDARR_LENGTH, GT_MDARR_LOWER_BOUND are TYP_INT 3. Fix: add GT_MDARR_LOWER_BOUND to GenTree::VisitOperands 4. Add dump of GT_MDARR_LENGTH, GT_MDARR_LOWER_BOUND `dim` field to tree dumps (required to distinguish them) 5. Change impArrayAccessIntrinsic() to cast index types to TYP_INT but only under `compJitEarlyExpandMDArrays` to avoid asm diffs. 6. Temporary: create new, unique value numbers for GT_MDARR_LENGTH, GT_MDARR_LOWER_BOUND; otherwise, they get optimized incorrectly by not looking at dimension value.
Configuration menu - View commit details
-
Copy full SHA for 1c619ad - Browse repository at this point
Copy the full SHA 1c619adView commit details -
1. Check for root opts.compJitEarlyExpandMDArrays flag, not in inlinee Compiler 2. Fix order of evaluation for index expressions; copy index expressions with side effects.
Configuration menu - View commit details
-
Copy full SHA for 53dc58b - Browse repository at this point
Copy the full SHA 53dc58bView commit details -
- Change assert that index type is TYP_INT to check genActualType instead of type. - Change order of evaluation so array is evaluated first, before index expressions. - Only morph MD array ops if the function and block have them. - Remove unused `BBF_HAS_NEWARRAY`, add `BBF_HAS_MD_IDX_LEN`, `BBF_HAS_MDARRAYREF` - Add `OMF_HAS_MDNEWARRAY, `OMF_HAS_MDARRAYREF` - Add asserts that GT_ARR_ELEM doesn't exist by lowering if we're doing early lowering of MD arrays - Remove unneeded `ARR_ST_POST_VERIFY`, `ARR_LD_POST_VERIFY`
Configuration menu - View commit details
-
Copy full SHA for e816b6a - Browse repository at this point
Copy the full SHA e816b6aView commit details -
Remove unnecessary lowering/codegen
SimpleLowering is lowering MDARR_LEN, MD_ARR_LOWER_BOUND
Configuration menu - View commit details
-
Copy full SHA for 5d0e1e5 - Browse repository at this point
Copy the full SHA 5d0e1e5View commit details -
Implement value numbering for GT_MDARR_LENGTH, GT_MDARR_LOWER_BOUND
New CSEs and hoisted expressions are seen.
Configuration menu - View commit details
-
Copy full SHA for e058789 - Browse repository at this point
Copy the full SHA e058789View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ad712a - Browse repository at this point
Copy the full SHA 7ad712aView commit details -
Replace GenTreeArrLen, GenTreeArrLowerBound with GenTreeMDArr
Introduce GenTreeArrCommon as parent of GenTreeArrLen, GenTreeMDArr.
Configuration menu - View commit details
-
Copy full SHA for 4198176 - Browse repository at this point
Copy the full SHA 4198176View commit details -
Enable early MD array expansion
Configuration variables: 1. `COMPlus_JitEarlyExpandMDArrays`. Set to zero to disable early MD expansion. Default is 1 (enabled). 2. If `COMPlus_JitEarlyExpandMDArrays=0`, use `COMPlus_JitEarlyExpandMDArraysFilter` to selectively enable early MD expansion for a method set (e.g., syntax like `JitDump`)
Configuration menu - View commit details
-
Copy full SHA for 39de3ae - Browse repository at this point
Copy the full SHA 39de3aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 40019df - Browse repository at this point
Copy the full SHA 40019dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92c73fe - Browse repository at this point
Copy the full SHA 92c73feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a14656 - Browse repository at this point
Copy the full SHA 7a14656View commit details -
Configuration menu - View commit details
-
Copy full SHA for a0d0812 - Browse repository at this point
Copy the full SHA a0d0812View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f7836c - Browse repository at this point
Copy the full SHA 0f7836cView commit details