[PATCH] D81271: Correctly report modified status for AMDGPUUnifyDivergentExitNodes
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 5 09:26:04 PDT 2020
foad created this revision.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.
foad added reviewers: serge-sans-paille, arsenm, cfang, cwabbott, piotr.
Related to https://reviews.llvm.org/D80916
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D81271
Files:
llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
Index: llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
@@ -216,6 +216,7 @@
bool InsertExport = false;
+ bool Changed = false;
for (BasicBlock *BB : PDT.getRoots()) {
if (isa<ReturnInst>(BB->getTerminator())) {
if (!isUniformlyReached(DA, *BB))
@@ -281,6 +282,7 @@
BB->getTerminator()->eraseFromParent();
BranchInst::Create(TransitionBB, DummyReturnBB, BoolTrue, BB);
}
+ Changed = true;
}
}
@@ -299,6 +301,7 @@
BB->getTerminator()->eraseFromParent();
BranchInst::Create(UnreachableBlock, BB);
}
+ Changed = true;
}
if (!ReturningBlocks.empty()) {
@@ -322,15 +325,16 @@
// actually reached here.
ReturnInst::Create(F.getContext(), RetVal, UnreachableBlock);
ReturningBlocks.push_back(UnreachableBlock);
+ Changed = true;
}
}
// Now handle return blocks.
if (ReturningBlocks.empty())
- return false; // No blocks return
+ return Changed; // No blocks return
if (ReturningBlocks.size() == 1 && !InsertExport)
- return false; // Already has a single return block
+ return Changed; // Already has a single return block
const TargetTransformInfo &TTI
= getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81271.268842.patch
Type: text/x-patch
Size: 1477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200605/821a41d8/attachment.bin>
More information about the llvm-commits
mailing list