diff options
author | Alina Sbirlea <asbirlea@google.com> | 2020-01-23 10:25:50 -0800 |
---|---|---|
committer | Alina Sbirlea <asbirlea@google.com> | 2020-01-23 11:06:16 -0800 |
commit | a0f627d58428efba18dbf882b1ff34764e439e59 (patch) | |
tree | 338647c70ba53fe988ced27d1eb3eb3e65b3e377 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | f2ccd5a956cd36141e1ea001f4e1dce359d949c5 (diff) | |
download | llvm-a0f627d58428efba18dbf882b1ff34764e439e59.zip llvm-a0f627d58428efba18dbf882b1ff34764e439e59.tar.gz llvm-a0f627d58428efba18dbf882b1ff34764e439e59.tar.bz2 |
[IndVarSimplify] Fix for MemorySSA preserve.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b2d511c..5b188fc 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -521,19 +521,20 @@ static bool areAllUsesEqual(Instruction *I) { /// delete it. If that makes any of its operands trivially dead, delete them /// too, recursively. Return true if a change was made. bool llvm::RecursivelyDeleteDeadPHINode(PHINode *PN, - const TargetLibraryInfo *TLI) { + const TargetLibraryInfo *TLI, + llvm::MemorySSAUpdater *MSSAU) { SmallPtrSet<Instruction*, 4> Visited; for (Instruction *I = PN; areAllUsesEqual(I) && !I->mayHaveSideEffects(); I = cast<Instruction>(*I->user_begin())) { if (I->use_empty()) - return RecursivelyDeleteTriviallyDeadInstructions(I, TLI); + return RecursivelyDeleteTriviallyDeadInstructions(I, TLI, MSSAU); // If we find an instruction more than once, we're on a cycle that // won't prove fruitful. if (!Visited.insert(I).second) { // Break the cycle and delete the instruction and its operands. I->replaceAllUsesWith(UndefValue::get(I->getType())); - (void)RecursivelyDeleteTriviallyDeadInstructions(I, TLI); + (void)RecursivelyDeleteTriviallyDeadInstructions(I, TLI, MSSAU); return true; } } |