aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorNagyDonat <donat.nagy@ericsson.com>2024-04-23 10:20:34 +0200
committerGitHub <noreply@github.com>2024-04-23 10:20:34 +0200
commitce763bff081f8e97c7c3610ed0f15f14d60e875f (patch)
tree4162dc1f8f53b145cf38324f824519f960691f24 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parent05c1447b3eabe9cc4a27866094e46c57350c5d5a (diff)
downloadllvm-ce763bff081f8e97c7c3610ed0f15f14d60e875f.zip
llvm-ce763bff081f8e97c7c3610ed0f15f14d60e875f.tar.gz
llvm-ce763bff081f8e97c7c3610ed0f15f14d60e875f.tar.bz2
[analyzer] Fix performance of getTaintedSymbolsImpl() (#89606)
Previously the function ``` std::vector<SymbolRef> taint::getTaintedSymbolsImpl(ProgramStateRef State, const MemRegion *Reg, TaintTagType K, bool returnFirstOnly) ``` (one of the 4 overloaded variants under this name) was handling element regions in a highly inefficient manner: it performed the "also examine the super-region" step twice. (Once in the branch for element regions, and once in the more general branch for all `SubRegion`s -- note that `ElementRegion` is a subclass of `SubRegion`.) As pointer arithmetic produces `ElementRegion`s, it's not too difficult to get a chain of N nested element regions where this inefficient recursion would produce 2^N calls. This commit is essentially NFC, apart from the performance improvements and the removal of (probably irrelevant) duplicate entries from the return value of `getTaintedSymbols()` calls. Fixes #89045
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
0 files changed, 0 insertions, 0 deletions