aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorvporpo <vporpodas@google.com>2025-01-28 18:28:08 -0800
committerGitHub <noreply@github.com>2025-01-28 18:28:08 -0800
commit79cbad188afd5268235b00267d37ce39544dbd3c (patch)
tree844dd1bf0c2fc3db4e6775ddef3d73c12f69a3eb /clang/lib/Frontend/CompilerInvocation.cpp
parent6b654a09c2b689438237252d6f0fbcb25c993703 (diff)
downloadllvm-79cbad188afd5268235b00267d37ce39544dbd3c.zip
llvm-79cbad188afd5268235b00267d37ce39544dbd3c.tar.gz
llvm-79cbad188afd5268235b00267d37ce39544dbd3c.tar.bz2
[SandboxVec] Clear Context's state within runOnFunction() (#124842)
`sandboxir::Context` is defined at a pass-level scope with the `SandboxVectorizerPass` class because the function pass manager `FPM` object depends on it, and that is in pass-level scope to avoid recreating the pass pipeline every single time `runOnFunction()` is called. This means that the Context's state lives on across function passes. The problem is twofold: (i) the LLVM IR to Sandbox IR map can grow very large including objects from different functions, which is of no use to the vectorizer, as it's a function-level pass. (ii) this can result in stale data in the LLVM IR to Sandbox IR object map, as other passes may delete LLVM IR objects. To fix both issues this patch introduces a `Context::clear()` function that clears the `LLVMValueToValueMap`.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions