Delete fgArgTabEntry::node#24294
Conversation
be5e3c7 to
f1d4104
Compare
Et voila, poof goes |
eb2e4f9 to
09978d3
Compare
e771834 to
c727571
Compare
20069b6 to
67a9399
Compare
|
cc @sandreenko |
|
@dotnet/jit-contrib |
67a9399 to
47c5991
Compare
47c5991 to
dd0adb3
Compare
|
While removing It may seem like the asserts are completly useless since it is obviously impossible for Ideally this "late arg" nonsense should just go away. Remains to be seen when I'll get to it, I'm also trying to deal with struct related issues and that seems more useful at the moment. Well, at least until I try to do some struct related work and run into all this nonsense again. |
sandreenko
left a comment
There was a problem hiding this comment.
Overal look great, I like how simpler this part looks now.
No diffs. (crossgen/PMI x86/x64 and altjit arm32/arm64)
👍
Do you have PIN data?
| } | ||
|
|
||
| if (!Compare(op1->AsCall()->gtCallObjp, op2->AsCall()->gtCallObjp)) | ||
| if ((op1->AsCall()->gtCallThisArg != nullptr) != (op2->AsCall()->gtCallThisArg != nullptr)) |
There was a problem hiding this comment.
Nit: I would create a new block under case GT_CALL: and create locals for op1->gtCall, op1->AsCall()->gtCallThisArg, op2->AsCall()->gtCallThisArg.
| GenTree* GetArgNode(unsigned argIndex) | ||
| { | ||
| return GetArgEntry(argIndex)->node; | ||
| return GetArgEntry(argIndex)->GetNode(); |
There was a problem hiding this comment.
a random thing:
in GenTreeCall::Use::SetNode we check that assert(node != nullptr);, so as I understand our contract is that if we have a Use then we have a not-null node, but we don't check that in the Use constructor, so we can call GenTreeCall::Use(nullptr) and do bad things.
There was a problem hiding this comment.
Right, I need to check this. AFAIR I didn't add an assert in the Use constructor due to some funny code in fgArgInfo::fgArgInfo that was manufacturing uses out of thin air. That code is gone now so perhaps I can add an assert.
| oldArgs = oldArgs->GetNext(); | ||
| for (unsigned i = 0; i < argTableSize; i++) | ||
| { | ||
| if (argTable[i]->use == &(*oldUse)) |
There was a problem hiding this comment.
How much time do we spend in this quadratic loop?
Nit: I do not like &(*oldUse) with hiding castings.
There was a problem hiding this comment.
Luckily cloning calls isn't exactly common. The only case I know of is loop hoisiting and that only works with a few "pure" helpers that have 2 arguments.
I don't like &(*oldUse) but I don't understand what do you mean by hiding casts. The only way to avoid this seems to be to avoid using iterators but I'd like to avoid relying on the fact that the arg list is a linked list. It should be an array and using iterators makes changing it easier. Assuming we ever figure out how to deal with the few cases that require as to insert new arguments into this arg list...
There was a problem hiding this comment.
oldUse's type is UseIterator ,
*oldUse's type is 'Use&' (because of operator overload Use& operator*() const),
'&(*oldUse)'s type is Use*.
with inlining, it looks like &*(oldUse->m_use), maybe we can add Use* UseIterator::GetUse() const and call it here and below?
PIN shows no diff (-/+ 0.01%), that's why I didn't mention it. I suppose one would have expected a small improvement due to the simplification of For fun here's the PIN data: https://1drv.ms/x/s!Av4baJYSo5pjgtFn8rufpZgHaeRGog?e=I5hlUc The main reason I keep using PIN is that it can actually produce a number like 0.00% 😄. From time to time I compare an unmodified JIT and I've never seen diffs larger than 0.01%. |
This replace the
GenTree* fgArgTabEntry::nodepointer with a pointer to the late arg (use). This way the node pointer can still be obtained from eitherfgArgTabEntry::useorfgArgTabEntry::lateUseand we no longer need to special case operand replacement (with the exception of preservingGTF_LATE_ARG).Contributes to #26307
The extra
Usefor thethisarg does increase memory usage a bit, by around 0.05%. I think it's definitely worth it. And we could recover some of that if we eventually move thethisarg to the normal arg list so thatGenTreeCall(and all large nodes) becomes one pointer smaller.No diffs. (crossgen/PMI x86/x64 and altjit arm32/arm64)