[llvm] r369997 - [MemorySSA] Fix insertUse.
Alina Sbirlea via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 26 17:34:48 PDT 2019
Author: asbirlea
Date: Mon Aug 26 17:34:47 2019
New Revision: 369997
URL: http://llvm.org/viewvc/llvm-project?rev=369997&view=rev
Log:
[MemorySSA] Fix insertUse.
Actually call the renamePass on inserted Phis.
Fixes PR42940.
Subscribers: llvm-commits
Modified:
llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp
llvm/trunk/test/Analysis/MemorySSA/PR42940.ll
Modified: llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp?rev=369997&r1=369996&r2=369997&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp (original)
+++ llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp Mon Aug 26 17:34:47 2019
@@ -255,12 +255,12 @@ void MemorySSAUpdater::insertUse(MemoryU
FirstDef = MD->getDefiningAccess();
MSSA->renamePass(MU->getBlock(), FirstDef, Visited);
- // We just inserted a phi into this block, so the incoming value will
- // become the phi anyway, so it does not matter what we pass.
- for (auto &MP : InsertedPHIs)
- if (MemoryPhi *Phi = cast_or_null<MemoryPhi>(MP))
- MSSA->renamePass(Phi->getBlock(), nullptr, Visited);
}
+ // We just inserted a phi into this block, so the incoming value will
+ // become the phi anyway, so it does not matter what we pass.
+ for (auto &MP : InsertedPHIs)
+ if (MemoryPhi *Phi = cast_or_null<MemoryPhi>(MP))
+ MSSA->renamePass(Phi->getBlock(), nullptr, Visited);
}
}
Modified: llvm/trunk/test/Analysis/MemorySSA/PR42940.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/MemorySSA/PR42940.ll?rev=369997&r1=369996&r2=369997&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/MemorySSA/PR42940.ll (original)
+++ llvm/trunk/test/Analysis/MemorySSA/PR42940.ll Mon Aug 26 17:34:47 2019
@@ -125,3 +125,65 @@ cleanup1270:
ret void
}
+ at g_1504 = external dso_local local_unnamed_addr global i16****, align 8
+
+define void @f5() {
+bb:
+ tail call fastcc void @f21()
+ br label %bb12.outer
+
+bb12.outer.loopexit: ; No predecessors!
+ br label %bb12.outer
+
+bb12.outer: ; preds = %bb12.outer.loopexit, %bb
+ br i1 undef, label %bb12.outer.split.us, label %bb12.preheader
+
+bb12.preheader: ; preds = %bb12.outer
+ br label %bb12
+
+bb12.outer.split.us: ; preds = %bb12.outer
+ br label %bb16.us.us
+
+bb16.us.us: ; preds = %bb16.us.us, %bb12.outer.split.us
+ br label %bb16.us.us
+
+bb12: ; preds = %bb77.1, %bb12.preheader
+ br i1 undef, label %bb25.preheader, label %bb77
+
+bb25.preheader: ; preds = %bb12.1, %bb12
+ br label %bb25
+
+bb25: ; preds = %l0, %bb25.preheader
+ br i1 undef, label %bb62, label %bb71.thread
+
+bb62: ; preds = %bb25
+ br i1 undef, label %bb92.loopexit, label %l0
+
+l0: ; preds = %bb62
+ br label %bb25
+
+bb71.thread: ; preds = %bb25
+ br label %bb92
+
+bb77: ; preds = %bb12
+ %tmp78 = load i16****, i16***** @g_1504, align 8
+ %tmp79 = load volatile i16***, i16**** %tmp78, align 8
+ br i1 undef, label %bb91, label %bb12.1
+
+bb91: ; preds = %bb77.1, %bb77
+ unreachable
+
+bb92.loopexit: ; preds = %bb62
+ br label %bb92
+
+bb92: ; preds = %bb92.loopexit, %bb71.thread
+ ret void
+
+bb12.1: ; preds = %bb77
+ br i1 undef, label %bb25.preheader, label %bb77.1
+
+bb77.1: ; preds = %bb12.1
+ br i1 undef, label %bb91, label %bb12
+}
+
+declare void @f21()
More information about the llvm-commits
mailing list