[PATCH] D109177: [MemorySSA] Properly handle liveOnEntry in the walker printer
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 2 12:52:07 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG813a7f1ad7b0: [MemorySSA] Properly handle liveOnEntry in the walker printer (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109177/new/
https://reviews.llvm.org/D109177
Files:
llvm/lib/Analysis/MemorySSA.cpp
llvm/test/Analysis/MemorySSA/print-walker.ll
Index: llvm/test/Analysis/MemorySSA/print-walker.ll
===================================================================
--- llvm/test/Analysis/MemorySSA/print-walker.ll
+++ llvm/test/Analysis/MemorySSA/print-walker.ll
@@ -1,15 +1,15 @@
; RUN: opt -passes='print<memoryssa-walker>' -disable-output < %s 2>&1 | FileCheck %s
; CHECK: define void @test
-; CHECK: 1 = MemoryDef(liveOnEntry)->liveOnEntry - clobbered by 0 = MemoryDef(liveOnEntry)
+; CHECK: 1 = MemoryDef(liveOnEntry)->liveOnEntry - clobbered by liveOnEntry
; CHECK: store i8 42, i8* %a1
-; CHECK: 2 = MemoryDef(1)->liveOnEntry - clobbered by 0 = MemoryDef(liveOnEntry)
+; CHECK: 2 = MemoryDef(1)->liveOnEntry - clobbered by liveOnEntry
; CHECK: store i8 42, i8* %a2
; CHECK: MemoryUse(1) MustAlias - clobbered by 1 = MemoryDef(liveOnEntry)->liveOnEntry
; CHECK: %l1 = load i8, i8* %a1
; CHECK: MemoryUse(2) MustAlias - clobbered by 2 = MemoryDef(1)->liveOnEntry
; CHECK: %l2 = load i8, i8* %a2
-; CHECK: 3 = MemoryDef(2)->liveOnEntry - clobbered by 0 = MemoryDef(liveOnEntry)
+; CHECK: 3 = MemoryDef(2)->liveOnEntry - clobbered by liveOnEntry
; CHECK: store i8 42, i8* %p
; CHECK: 4 = MemoryDef(3)->3 MustAlias - clobbered by 3 = MemoryDef(2)->liveOnEntry
; CHECK: store i8 42, i8* %p
Index: llvm/lib/Analysis/MemorySSA.cpp
===================================================================
--- llvm/lib/Analysis/MemorySSA.cpp
+++ llvm/lib/Analysis/MemorySSA.cpp
@@ -95,6 +95,8 @@
VerifyMemorySSAX("verify-memoryssa", cl::location(VerifyMemorySSA),
cl::Hidden, cl::desc("Enable verification of MemorySSA."));
+const static char LiveOnEntryStr[] = "liveOnEntry";
+
namespace {
/// An assembly annotator class to print Memory SSA information in
@@ -133,8 +135,13 @@
if (MemoryAccess *MA = MSSA->getMemoryAccess(I)) {
MemoryAccess *Clobber = Walker->getClobberingMemoryAccess(MA);
OS << "; " << *MA;
- if (Clobber)
- OS << " - clobbered by " << *Clobber;
+ if (Clobber) {
+ OS << " - clobbered by ";
+ if (MSSA->isLiveOnEntryDef(Clobber))
+ OS << LiveOnEntryStr;
+ else
+ OS << *Clobber;
+ }
OS << "\n";
}
}
@@ -2154,8 +2161,6 @@
return dominates(Dominator, cast<MemoryAccess>(Dominatee.getUser()));
}
-const static char LiveOnEntryStr[] = "liveOnEntry";
-
void MemoryAccess::print(raw_ostream &OS) const {
switch (getValueID()) {
case MemoryPhiVal: return static_cast<const MemoryPhi *>(this)->print(OS);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109177.370375.patch
Type: text/x-patch
Size: 2519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210902/df39b66b/attachment.bin>
More information about the llvm-commits
mailing list