aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-06-27 17:00:21 +0200
committerGitHub <noreply@github.com>2024-06-27 17:00:21 +0200
commit42c3edb4819ff2e9608f645fb5793dcb33b47f9c (patch)
tree1ae78d5fd07bcd7a8f6980b2310d742f07f818f9 /llvm/lib/CodeGen/MachineInstr.cpp
parent8a7730fb88445a019fe150d5db4f6642e43afd04 (diff)
downloadllvm-42c3edb4819ff2e9608f645fb5793dcb33b47f9c.zip
llvm-42c3edb4819ff2e9608f645fb5793dcb33b47f9c.tar.gz
llvm-42c3edb4819ff2e9608f645fb5793dcb33b47f9c.tar.bz2
[SmallPtrSet] Don't leave tombstones in small mode (#96762)
When erasing elements in small mode, we currently leave behind tombstones. This means that insertion into the SmallPtrSet also has to check for these, making the operation more expensive than it really should be. We don't really need the tombstones in small mode, because we can just replace with the last element in the set instead. This changes the order, but SmallPtrSet order is fundamentally unstable anyway. However, not leaving tombstones means that the erase() operation now invalidates iterators. This means that consumers that want to remove elements while iterating over the set have to use remove_if() instead. If they fail to do so, there will be an assertion failure thanks to debug epochs, so any such cases are easy to detect (and I have already fixed all cases inside llvm at least).
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions