-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix weight computation in jit #47470
Conversation
This appears to be a typo. weight1 is from dsc1 and weight2 is from dsc2. If we checking whether dsc1 is a register arg, we should be adjusting weight1, not weight2.
d2ee67d
to
28fcc06
Compare
Thanks for spotting this. Looks like I introduced this in dotnet/coreclr#19077. The fix looks good- any chance you can run diffs? The change above only had diffs in 2 methods... curious if this undoes that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Sorry, I am not sure what this means. |
It means to assess what impact this change has on the code the jit generates. If you have built locally for say x64, it should be as simple as running
I'm happy to run diffs for you, if you prefer. |
Thanks for clarifying this. I would love to give this a shot and learn something new. Let me try this out. |
I ran it locally because I was curious, but will let you post the results ... I am a bit surprised by what I found. |
Sorry for being so thick. I am not having any luck trying to get this running This is what I did:
That leads to errors like
An strace shows that it's trying to find that file in
|
Thanks for trying it out. Looks like we may need to adjust something for Linux? cc @BruceForstall @dotnet/jit-contrib I will dig in later today if Bruce doesn't get there first. |
Odd, it should find it in the Core_Root directory, and it does appear to be there. I don't know why it would look there. superpmi.py tries to set the current directory to the Core_Root path before running commands. Do you see an output line like "Using coredistools found at" ? I'll try to repro on Linux sometime (I haven't used the py script on Linux lately) |
Yes, I see this:
And that's the correct location. |
This comment seems rather suspicious: runtime/src/coreclr/ToolBox/superpmi/superpmi/neardiffer.cpp Lines 72 to 73 in 54f0d4b
The superpmi shared objects are in a different location than the "Using coredistools found at" location:
|
@BruceForstall am trying to repro but also though I'd look into the minimal build steps required to be able to run this. Looks like we expect the test overlay (core_root) and so at least a full runtime build plus a test overlay setup? Do we copy the SPMI shims into core_root? |
@omajid things work for me on Ubuntu if I do the following build steps:
for output I get
and the files are co-located:
|
Thanks! I made some progress following your steps:
libcoredistools.so is in the right place now:
But asmdiff still fails:
It looks like a dependency is missing:
Fedora seems to be using a newer version of ncurses ( For now, this gets me running:
|
Was this the surprising part?
|
It shouldn't be required to have a Core_Root, although superpmi.py will create one if it's not there, just to copy over a coredistools, and so that dir can be used as the "current directory" when spawning superpmi.
I think the "generate layout" step of the Core_Root building process does that, but that's only necessary for collection, not replay/asmdiffs. It looks like the main problem identified is that the prebuilt version of coredistools doesn't work on (some versions of?) Fedora without additional dependencies being installed. Note that coredistools is built out of https://github.com/dotnet/jitutils an an irregular basis, and then you just pick up the published nuget packages. cc @echesakovMSFT |
I wonder whether we can make the coredistools binary depending on smaller subset of libraries. |
Yes, you'd think if we took pains to handle cases like this specially it should matter. Thanks for checking diffs. |
Thanks for helping me learn this! Much appreciated! |
This appears to be a typo.
weight1
is fromdsc1
andweight2
is fromdsc2
. If we are checking whetherdsc1
is a register arg, we should be adjustingweight1
, notweight2
.