diff options
| author | Augusto Noronha <anoronha@apple.com> | 2026-02-23 11:41:13 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-23 11:41:13 -0800 |
| commit | b3f3b57aed375b53d1801d532333bd66417b11ef (patch) | |
| tree | 8f78fa540d4f46637fad8b32cbdeffb9116ad580 /offload/test/ompt/veccopy_data.c | |
| parent | 5edbaf9c82983eb8be0ace107ef8399fb6eac938 (diff) | |
| download | llvm-main.zip llvm-main.tar.gz llvm-main.tar.bz2 | |
d7fb086668dff68 changed some calls from SymbolContextList::Append to
SymbolContextList::AppendIfUnique. This has unfortunately caused a huge
slow down in operations involving a large amount of symbol contexts (for
example, trying to autocomplete from an empty input "b <TAB>" will add
every function to the list), since AppendIfUnique scans the entire
symbol context list. Speed this up by adding a hash set to quickly
answer whether a symbol context is on the list or not.
This takes the time from running "b <TAB>" when debugging yaml2obj on my
machine from 600 seconds down to 13, which is about the same as before
d7fb086668dff68.
Note that AppendIfUnique has a logic error, which has been present since
its introduction. This has to do with the behavior controlled by
"merge_symbol_into_function", which will try to merge symbols with
symbol context containing the equivalent function to that symbol.
The previous patch tried to correct this by adding
CompareConsideringPossiblyNullSymbol(), which is not quite correct.
With CompareConsideringPossiblyNullSymbol(), if symbols are added in
this order:
- Symbol context without symbol.
- Equivalent symbol context with symbol.
The list will have only one symbol context WITHOUT the symbol.
If we stop using CompareConsideringPossiblyNullSymbol() and instead go
back to the == operator which d7fb086668dff68 introduced, with symbols
added in this order, the following will happen:
- Symbol context without symbol.
- Equivalent symbol context with symbol.
- The bare symbol, with "merge_symbol_into_function = true", the list
will have the same symbol twice.
This patch does not attempt to solve this, and instead focuses on the
performance issue d7fb086668dff68 introduced.
rdar://170477680
Diffstat (limited to 'offload/test/ompt/veccopy_data.c')
0 files changed, 0 insertions, 0 deletions
