[PATCH] D89647: [DSE] Use walker to skip noalias stores between current & clobber def.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 28 04:06:48 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb82f80057d69: [DSE] Use walker to skip noalias stores between current & clobber def. (authored by fhahn).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89647/new/
https://reviews.llvm.org/D89647
Files:
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/test/Transforms/DeadStoreElimination/MSSA/noop-stores.ll
Index: llvm/test/Transforms/DeadStoreElimination/MSSA/noop-stores.ll
===================================================================
--- llvm/test/Transforms/DeadStoreElimination/MSSA/noop-stores.ll
+++ llvm/test/Transforms/DeadStoreElimination/MSSA/noop-stores.ll
@@ -15,7 +15,6 @@
define void @test_load_volatile(i32* %Q) {
; CHECK-LABEL: @test_load_volatile(
; CHECK-NEXT: [[A:%.*]] = load volatile i32, i32* [[Q:%.*]], align 4
-; CHECK-NEXT: store i32 [[A]], i32* [[Q]], align 4
; CHECK-NEXT: ret void
;
%a = load volatile i32, i32* %Q
@@ -284,9 +283,7 @@
define void @test_noalias_store_between_load_and_store(i32* noalias %x, i32* noalias %y) {
; CHECK-LABEL: @test_noalias_store_between_load_and_store(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LV:%.*]] = load i32, i32* [[X:%.*]], align 4
; CHECK-NEXT: store i32 0, i32* [[Y:%.*]], align 4
-; CHECK-NEXT: store i32 [[LV]], i32* [[X]], align 4
; CHECK-NEXT: ret void
;
entry:
Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -2426,7 +2426,8 @@
// adding them to a worklist. Bail when we run into a memory def that
// does not match LoadAccess.
SetVector<MemoryAccess *> ToCheck;
- MemoryAccess *Current = Def->getDefiningAccess();
+ MemoryAccess *Current =
+ MSSA.getWalker()->getClobberingMemoryAccess(Def);
// We don't want to bail when we run into the store memory def. But,
// the phi access may point to it. So, pretend like we've already
// checked it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89647.301230.patch
Type: text/x-patch
Size: 1725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201028/d44dce5d/attachment.bin>
More information about the llvm-commits
mailing list