[PATCH] D146810: [CodeGen] Compile-time improvement for Machine Late Instructions Cleanup Pass.
Jonas Paulsson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 30 03:30:39 PDT 2023
jonpa added a comment.
In D146810#4221239 <https://reviews.llvm.org/D146810#4221239>, @vpykhtin wrote:
>> On SystemZ, the two versions show practically identical runtimes, so there is no winner. Is there any difference at all on your machine?
>
> Not really :) Something barely measurable like 2.13 and 2.09 seconds on the huge testcase. I'm curious which cases you use to compare to the current, non-map version?
>
>> I am thinking maybe it would be possible to lookup Reg only once by calling removeRedundantDef() with MI and also the KillMI. That way, clearKillsForDef() wouldn't have to duplicate the same lookup.
>
> I need to dig more into what is going on there.
If the map lookup time really matters, maybe it could be worth trying a vector of DefMI/KillMI pairs, so lookup time would be O(n) into the vector..? BTW, I really hope we don't have to use first/second accesses, something like RegInstrs[Reg].DefMI seems more readable...
If it's not possible to speed it up further, I think the simple version I tried is acceptable: it avoids the slowdowns in huge functions and is just barely slower on SPEC, which is then probably preferrable...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146810/new/
https://reviews.llvm.org/D146810
More information about the llvm-commits
mailing list