-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Track actual SSA memory usage #14953
Conversation
Currently SsaBuilder use comp->getAllocator() in a lot of places so a lot of the memory it allocates lands in CMK_Generic instead of CMK_SSA. Same for CopyProp phase.
|
JitMemStats diff: - SSA | 36352868 | 1.97%
+ SSA | 90515140 | 4.92%
ValueNumber | 345182286 | 18.75%
- LvaTable | 86994265 | 4.72%
+ LvaTable | 86994265 | 4.73%
UnwindInfo | 197280 | 0.01%
hashBv | 5911128 | 0.32%
bitset | 26976168 | 1.47%
FixedBitVect | 7028 | 0.00%
- Generic | 141367200 | 7.68%
+ Generic | 43900160 | 2.38%
IndirAssignMap | 139904 | 0.01%
FieldSeqStore | 4820344 | 0.26%
LoopOpt | 66360 | 0.00%
LoopHoist | 1615000 | 0.09%
Unknown | 18985445 | 1.03%
RangeCheck | 9590968 | 0.52%
+ CopyProp | 42872960 | 2.33%
|
|
So SSA memory usage is more than double than previously recorded. And judging by the changes I have made most of this additional memory usage comes from dominance computation, that one uses |
Do we have any hacks to use |
Interesting idea. I suppose that if you include the compiler's own std headers and define The JIT is really in a bad spot with regards to data structures. jitstd is usable but incomplete and out of date - But in the specific case of SSA dominance computation the data structure implementation is less of a problem, Working on it, preliminary results look pretty good. |
|
One example of improvement in #14965. The dominator tree is currently something like
|
|
Changes in this PR looks good to me. I think @BruceForstall knows the historical context of these jitstd structs decisions, maybe some of them are outdated and we can change them now. cc @dotnet/jit-contrib |
|
It looks like there's still some memory that's not properly accounted for. Both SSA and CopyProp use |
CarolEidt
left a comment
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. I wouldn't mind having @BruceForstall or @briansull also take a look, and perhaps comment on the history of jitstd. As I (barely) recall, its origins arose around both some limitations of older compilers we were constrained to use, along with some other dependencies that made the use of std:: not possible.
|
Another bit of memory that belongs to SSA but ends up in the |
|
We generally can't use STL (aka std::) in code that links with the PAL (including the JIT). Trying to do so leads to a zillion compilation errors on various platforms, related to utilcode. One of the biggest issues is that wchar_t is 32-bits on Linux and 16-bits on Windows, and that shows through with std::string/std::wstring. ToolBox\SOS\Strike actually does use it, with some number of hacks. I tried to use it for superpmi, but then gave up and added even more stuff in src\inc\clr_std (namely, string). Historically, we also had issues with compiling using toolsets that didn't support STL. And issues with the STL exception handling mode, too, I think. |
Currently
SsaBuilderusescomp->getAllocator()in a lot of places so a lot of the memory it allocates lands inCMK_Genericinstead ofCMK_SSA.Same for CopyProp phase.