[llvm] 72e4da4 - Correctly report modified status for AMDGPUUnifyDivergentExitNodes
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 5 11:49:49 PDT 2020
Author: Jay Foad
Date: 2020-06-05T19:49:37+01:00
New Revision: 72e4da45bd73e6cd16dbb564b2cc515bc8512e57
URL: https://github.com/llvm/llvm-project/commit/72e4da45bd73e6cd16dbb564b2cc515bc8512e57
DIFF: https://github.com/llvm/llvm-project/commit/72e4da45bd73e6cd16dbb564b2cc515bc8512e57.diff
LOG: Correctly report modified status for AMDGPUUnifyDivergentExitNodes
Related to https://reviews.llvm.org/D80916
Differential Revision: https://reviews.llvm.org/D81271
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp b/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
index 223e36e99586..ab0d2169e390 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
@@ -216,6 +216,7 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
bool InsertExport = false;
+ bool Changed = false;
for (BasicBlock *BB : PDT.getRoots()) {
if (isa<ReturnInst>(BB->getTerminator())) {
if (!isUniformlyReached(DA, *BB))
@@ -281,6 +282,7 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
BB->getTerminator()->eraseFromParent();
BranchInst::Create(TransitionBB, DummyReturnBB, BoolTrue, BB);
}
+ Changed = true;
}
}
@@ -299,6 +301,7 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
BB->getTerminator()->eraseFromParent();
BranchInst::Create(UnreachableBlock, BB);
}
+ Changed = true;
}
if (!ReturningBlocks.empty()) {
@@ -322,15 +325,16 @@ bool AMDGPUUnifyDivergentExitNodes::runOnFunction(Function &F) {
// 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);
More information about the llvm-commits
mailing list