[all-commits] [llvm/llvm-project] 9996e7: [Support] Implement LLVM_ENABLE_REVERSE_ITERATION ...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Fri Jul 21 08:47:07 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9996e71f2d73a76dc62eb12fc3012aae91014b27
https://github.com/llvm/llvm-project/commit/9996e71f2d73a76dc62eb12fc3012aae91014b27
Author: Fangrui Song <i at maskray.me>
Date: 2023-07-21 (Fri, 21 Jul 2023)
Changed paths:
M llvm/lib/Support/StringMap.cpp
M llvm/test/CMakeLists.txt
M llvm/test/CodeGen/MIR/AMDGPU/virtreg-uses-unallocatable-class.mir
M llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s
M llvm/test/TableGen/GlobalISelCombinerMatchTableEmitter/pattern-parsing.td
M llvm/test/lit.site.cfg.py.in
M llvm/utils/lit/lit/llvm/config.py
Log Message:
-----------
[Support] Implement LLVM_ENABLE_REVERSE_ITERATION for StringMap
ProgrammersManual.html says
> StringMap iteration order, however, is not guaranteed to be deterministic, so any uses which require that should instead use a std::map.
This patch makes -DLLVM_REVERSE_ITERATION=on (currently
-DLLVM_ENABLE_REVERSE_ITERATION=on works as well) shuffle StringMap
iteration order (actually flipping the hash so that elements not in the
same bucket are reversed) to catch violations, similar to D35043 for
DenseMap. This should help change the hash function (e.g., D142862,
D155781).
With a lot of fixes, there are still some violations. This patch
implements the "reverse_iteration" lit feature to skip such tests.
Eventually we should remove this feature.
`ninja check-{llvm,clang,clang-tools}` are clean with
`#define LLVM_ENABLE_REVERSE_ITERATION 1`.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D155789
More information about the All-commits
mailing list