[PATCH] D37424: [ForwardOp] Remove read accesses for all instructions that have been moved
Michael Kruse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 3 08:57:25 PDT 2017
Meinersbur added a comment.
Hi Tobias.
thank for uploading the test case.
This fixes the problem:
diff --git a/lib/Transform/ForwardOpTree.cpp b/lib/Transform/ForwardOpTree.cpp
index dffd3cb1..78ff481f 100644
--- a/lib/Transform/ForwardOpTree.cpp
+++ b/lib/Transform/ForwardOpTree.cpp
@@ -419,7 +419,7 @@ public:
// available to all instructions following in the instruction list), but
// do not add another MemoryAccess.
MemoryAccess *Access = TargetStmt->getArrayAccessOrNULLFor(LI);
- if (Access && !DoIt)
+ if (Access && TargetStmt != UseStmt && !DoIt)
return FD_CanForwardLeaf;
if (DoIt)
We could improve the robustness of VirtualUse by giving priority to whether the value is in the instruction list (over looking for input MemoryAccesses). It would allow ignoring the input MemoryAccess when the value is available as intra- and inter-access. The explicit instruction list did not exist when VirtualUse was designed.
https://reviews.llvm.org/D37424
More information about the llvm-commits
mailing list