You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question] impCloneExpr vs fgInsertCommaFormTemp + gtCloneExpr #35314
Looking at various parts of the importer, it looks like one of a couple approaches are used when a node needs to be copied. All of these code paths are functionally similar but with minor tweaks in the actual checks done and when a given node is copied to a local vs cloned. I was wondering if there is a "correct" one that should be getting used and if the various paths should be normalized to a single helper method?
I suspect that these should be unified, though it wouldn't surprise me that some of the differences were due to some varying requirements based on what phase it's in.
@dotnet/jit-contrib - any other insights?
I suspect that these should be unified, though it wouldn't surprise me that some of the differences were due to some varying requirements based on what phase it's in.
At least in the case of simd.cpp and hwintrinsic.cpp, it looks to all be during importation. Although, I didn't dig too deeply into all the callsites to validate that was definitely the case.
impCloneExpr checks for interference of the tree against the IL stack. You need to call this in the importer unless you know for sure you can't have any such interference. It doesn't make sense to call impCloneExpr outside of importation.
Given that we haven't had any bugs (that I know of) from the variety of approaches to handling duplicated operands, I'm tempted to say we should put off any cleanup work until after 5.0. We can try to clean up/unify early in 6.0.
Activity
tannergooding commentedon Apr 22, 2020
CC. @CarolEidt since I saw these differences when going through
simd.cppCarolEidt commentedon Apr 23, 2020
I suspect that these should be unified, though it wouldn't surprise me that some of the differences were due to some varying requirements based on what phase it's in.
@dotnet/jit-contrib - any other insights?
tannergooding commentedon Apr 23, 2020
At least in the case of
simd.cppandhwintrinsic.cpp, it looks to all be during importation. Although, I didn't dig too deeply into all the callsites to validate that was definitely the case.EgorBo commentedon Apr 23, 2020
in my PR I used
(not sure
OperIsLeaf()is necessary)AndyAyersMS commentedon Apr 23, 2020
impCloneExprchecks for interference of the tree against the IL stack. You need to call this in the importer unless you know for sure you can't have any such interference. It doesn't make sense to callimpCloneExproutside of importation.AndyAyersMS commentedon Jul 1, 2020
Given that we haven't had any bugs (that I know of) from the variety of approaches to handling duplicated operands, I'm tempted to say we should put off any cleanup work until after 5.0. We can try to clean up/unify early in 6.0.
Thoughts?
tannergooding commentedon Jul 1, 2020
That sounds reasonable to me. I was mostly just interested as I had seen a number of varying mechanisms 😄
AndyAyersMS commentedon Jul 1, 2020
Ok, I'm going to move this.