[PATCH] D147437: [LICM] Don't require optimized uses
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 02:20:49 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7553bad1ac61: [LICM] Don't require optimized uses (authored by nikic).
Changed prior to commit:
https://reviews.llvm.org/D147437?vs=510455&id=511026#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147437/new/
https://reviews.llvm.org/D147437
Files:
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/test/Analysis/MemorySSA/pr43427.ll
llvm/test/Analysis/MemorySSA/pr45927.ll
llvm/test/Analysis/MemorySSA/pr49859.ll
Index: llvm/test/Analysis/MemorySSA/pr49859.ll
===================================================================
--- llvm/test/Analysis/MemorySSA/pr49859.ll
+++ llvm/test/Analysis/MemorySSA/pr49859.ll
@@ -67,7 +67,7 @@
br label %for.end
; CHECK: for.end:
-; CHECK-NEXT: ; MemoryUse([[NO12]])
+; CHECK-NEXT: ; MemoryUse([[NO20]])
; CHECK-NEXT: %3 = load i8, ptr %sum, align 1
for.end: ; preds = %final.cleanup
%8 = load i8, ptr %sum, align 1
Index: llvm/test/Analysis/MemorySSA/pr45927.ll
===================================================================
--- llvm/test/Analysis/MemorySSA/pr45927.ll
+++ llvm/test/Analysis/MemorySSA/pr45927.ll
@@ -24,7 +24,7 @@
; CHECK-NEXT: store i16 %inc.i.lcssa, ptr @c, align 1
; CHECK-NEXT: ; [[NO2:.*]] = MemoryDef([[NO6]])
; CHECK-NEXT: store i16 1, ptr @a, align 1
-; CHECK-NEXT: ; MemoryUse([[NO2]])
+; CHECK-NEXT: ; MemoryUse([[NO6]])
; CHECK-NEXT: %tmp2 = load i16, ptr @c, align 1
; CHECK-NEXT: br label %g.exit
Index: llvm/test/Analysis/MemorySSA/pr43427.ll
===================================================================
--- llvm/test/Analysis/MemorySSA/pr43427.ll
+++ llvm/test/Analysis/MemorySSA/pr43427.ll
@@ -19,7 +19,7 @@
; CHECK-NEXT: [[NO7]] = MemoryPhi({lbl2,[[NO8]]},{for.end,2})
; CHECK: cleanup:
-; CHECK-NEXT: MemoryUse([[NO7]])
+; CHECK-NEXT: MemoryUse([[NO2]])
; CHECK-NEXT: %cleanup.dest = load i32, ptr undef, align 1
; CHECK: lbl1.backedge:
Index: llvm/lib/Transforms/Scalar/LICM.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LICM.cpp
+++ llvm/lib/Transforms/Scalar/LICM.cpp
@@ -401,7 +401,6 @@
bool Changed = false;
assert(L->isLCSSAForm(*DT) && "Loop is not in LCSSA form.");
- MSSA->ensureOptimizedUses();
// If this loop has metadata indicating that LICM is not to be performed then
// just exit.
@@ -1304,7 +1303,8 @@
if (auto *Accesses = MSSA->getBlockAccesses(BB)) {
for (const auto &MA : *Accesses)
if (const auto *MU = dyn_cast<MemoryUse>(&MA)) {
- auto *MD = MU->getDefiningAccess();
+ auto *MD = getClobberingMemoryAccess(*MSSA, BAA, Flags,
+ const_cast<MemoryUse *>(MU));
if (!MSSA->isLiveOnEntryDef(MD) &&
CurLoop->contains(MD->getBlock()))
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147437.511026.patch
Type: text/x-patch
Size: 2391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230405/d9a9038c/attachment.bin>
More information about the llvm-commits
mailing list