[PATCH] D106024: [AbstractAttributor] Fix an issue that causes program hang
Shilei Tian via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 14 16:44:20 PDT 2021
tianshilei1992 created this revision.
Herald added subscribers: ormris, okura, uenoku, hiraditya.
Herald added a reviewer: uenoku.
tianshilei1992 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added subscribers: llvm-commits, bbn.
Herald added a project: LLVM.
Current implementation still uses invalid `ReachingKernels`, which causes the
folded value is incorrect eventually.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106024
Files:
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -3233,8 +3233,7 @@
auto &CB = cast<CallBase>(I);
auto &CBAA = A.getAAFor<AAKernelInfo>(
*this, IRPosition::callsite_function(CB), DepClassTy::OPTIONAL);
- if (CBAA.getState().isValidState())
- getState() ^= CBAA.getState();
+ getState() ^= CBAA.getState();
Function *Callee = CB.getCalledFunction();
if (Callee) {
@@ -3270,7 +3269,7 @@
auto &CAA =
A.getOrCreateAAFor<AAKernelInfo>(IRPosition::function(*Caller));
- if (CAA.isValidState()) {
+ if (CAA.ReachingKernelEntries.isValidState()) {
ReachingKernelEntries ^= CAA.ReachingKernelEntries;
return true;
}
@@ -3546,6 +3545,9 @@
auto &CallerKernelInfoAA = A.getAAFor<AAKernelInfo>(
*this, IRPosition::function(*getAnchorScope()), DepClassTy::REQUIRED);
+ if (!CallerKernelInfoAA.ReachingKernelEntries.isValidState())
+ return indicatePessimisticFixpoint();
+
for (Kernel K : CallerKernelInfoAA.ReachingKernelEntries) {
auto &AA = A.getAAFor<AAKernelInfo>(*this, IRPosition::function(*K),
DepClassTy::REQUIRED);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106024.358780.patch
Type: text/x-patch
Size: 1354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210714/52147c9e/attachment.bin>
More information about the llvm-commits
mailing list