diff options
author | Yichao Yu <yyc1992@gmail.com> | 2020-11-23 19:11:17 -0500 |
---|---|---|
committer | Yichao Yu <yyc1992@gmail.com> | 2020-11-24 12:12:00 -0500 |
commit | a248eca6659779116a6fb348117d74a0b8a05316 (patch) | |
tree | 2ac4322bb95da952ca5bad9cd968fc134e4f7fce /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 25777080549bb62b6e46a1809f93257969f5dd53 (diff) | |
download | llvm-a248eca6659779116a6fb348117d74a0b8a05316.zip llvm-a248eca6659779116a6fb348117d74a0b8a05316.tar.gz llvm-a248eca6659779116a6fb348117d74a0b8a05316.tar.bz2 |
Clear NewGEPBases after finish using them in CodeGenPrep pass
AFAICT all other set/map are correctly cleared in `runOnFunction`.
With assertion enabled this causes a crash when the module is freed and potentially if a later pass delete the instruction (not observed in real world though). Without assertion this can potentially cause confusing result when running on a new Function/Module.
Reviewed By: loladiro
Differential Revision: https://reviews.llvm.org/D84031
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 4ddfe0a..40e92b9 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -544,6 +544,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) { LargeOffsetGEPID.clear(); } + NewGEPBases.clear(); SunkAddrs.clear(); if (!DisableBranchOpts) { |