-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
JIT: Fold type checks with GDV #52370
Comments
Ah, actually it should be pretty simple to implement in New codegen: G_M58954_IG01: ;; offset=0000H
4883EC28 sub rsp, 40
;; bbWeight=1 PerfScore 0.25
G_M58954_IG02: ;; offset=0004H
B803000000 mov eax, 3
;; bbWeight=1 PerfScore 0.25
G_M58954_IG03: ;; offset=0009H
4883C428 add rsp, 40
C3 ret
;; bbWeight=1 PerfScore 1.25 So I'm going to mark it as 6.0 and will file a PR later once I finish active PRs. |
I wonder if we can catch this in GDV itself, re-checking the type of the Also curious why existing opts can't clean this up. |
Not in this case, as the GDV expansion happens before inlining.
Assertion prop doesn't propagate exact typeness for newobj. Seems like it should...? VN can't recover the vtable identity from an indir fed by a newobj. Seems like it could...? (also maybe non-nullness...?)
|
Have a fix for this in |
If we see a GT_IND whose base is JitNew, the value number of the IND is the same as the value number of the class handle for the new. Partial fix for dotnet#52370.
As I noted over in #52476 you should go ahead with a fix in morph too. The earlier we can clean up control flow, the better. |
Sure, will try once your PR is merged! |
If we see a GT_IND whose base is JitNew, the value number of the IND is the same as the value number of the class handle for the new. Partial fix for #52370.
#55124 found only just a few cases in real-world app and since it's just an opt - I'm moving it to 7.0 |
Fix: #66711 but since there were no hits I am closing this as non-actionable |
Current codegen for
Test
(PGO, GDV):After inlining we know the exact type of the GetAObj, so we should fold this:
We assign the exact class (
B
) to tmp4 which is then copied to tmp1 and checkedis B
(which is always true)./cc @AndyAyersMS
The text was updated successfully, but these errors were encountered: