aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorAlina Sbirlea <asbirlea@google.com>2020-01-23 10:25:50 -0800
committerAlina Sbirlea <asbirlea@google.com>2020-01-23 11:06:16 -0800
commita0f627d58428efba18dbf882b1ff34764e439e59 (patch)
tree338647c70ba53fe988ced27d1eb3eb3e65b3e377 /llvm/lib/Transforms/Utils/Local.cpp
parentf2ccd5a956cd36141e1ea001f4e1dce359d949c5 (diff)
downloadllvm-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.cpp7
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;
}
}