diff options
author | Pierre van Houtryve <pierre.vanhoutryve@amd.com> | 2024-05-16 13:39:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 13:39:00 +0200 |
commit | 7d81062352f75cf328d91d4900af52c1842b950e (patch) | |
tree | 63adc11ff5462365e3c6f1991a6b871523f880f8 /lldb/packages/Python/lldbsuite/test/bench.py | |
parent | 0bc1ec5cda8d68a681534bda9fd121b7f58fb495 (diff) | |
download | llvm-7d81062352f75cf328d91d4900af52c1842b950e.zip llvm-7d81062352f75cf328d91d4900af52c1842b950e.tar.gz llvm-7d81062352f75cf328d91d4900af52c1842b950e.tar.bz2 |
[GlobalISel] Refactor Combiner MatchData & Apply C++ Code Handling (#92239)
Combiners that use C++ code in their "apply" pattern only use that. They
never mix it with MIR patterns as that has little added value.
This patch restricts C++ apply code so that if C++ is used, we cannot
use MIR patterns or builtins with it. Adding this restriction allows us
to merge calls to match and apply C++ code together, which in turns
makes it so we can just have MatchData variables on the stack.
So before, we would have
```
GIM_CheckCxxInsnPredicate // match
GIM_CheckCxxInsnPredicate // apply
GIR_Done
```
Alongside a massive C++ struct holding the MatchData of all rules
possible (which was a big space/perf issue).
Now we just have
```
GIR_DoneWithCustomAction
```
And the function being ran just does
```
unsigned SomeMatchData;
if (match(SomeMatchData))
apply(SomeMatchData)
```
This approach solves multiple issues in one:
- MatchData handling is greatly simplified and more efficient, "don't
pay for what you don't use"
- We reduce the size of the match table
- Calling C++ code has a certain overhead (we need a switch), and this
overhead is only paid once now.
Handling of C++ code inside PatFrags is unchanged though, that still
emits a `GIM_CheckCxxInsnPredicate`. This is completely fine as they
can't use MatchDatas.
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/bench.py')
0 files changed, 0 insertions, 0 deletions