[llvm] [Uniformity] Fixed control-div early stop (PR #139667)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 27 23:36:37 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h -- llvm/include/llvm/ADT/GenericUniformityImpl.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/ADT/GenericUniformityImpl.h b/llvm/include/llvm/ADT/GenericUniformityImpl.h
index 03cace4e0..715df7ab9 100644
--- a/llvm/include/llvm/ADT/GenericUniformityImpl.h
+++ b/llvm/include/llvm/ADT/GenericUniformityImpl.h
@@ -618,17 +618,20 @@ public:
// Locate the largest ancestor cycle that is not reducible and does not
// contain a reducible ancestor. This is done with a lambda that is defined
// and invoked in the same statement.
- const CycleT *IrreducibleAncestor = [](const CycleT *C) -> const CycleT* {
- if (!C) return nullptr;
- if (C->isReducible()) return nullptr;
+ const CycleT *IrreducibleAncestor = [](const CycleT *C) -> const CycleT * {
+ if (!C)
+ return nullptr;
+ if (C->isReducible())
+ return nullptr;
while (const CycleT *P = C->getParentCycle()) {
- if (P->isReducible()) return C;
+ if (P->isReducible())
+ return C;
C = P;
}
assert(!C->getParentCycle());
assert(!C->isReducible());
return C;
- } (DivTermCycle);
+ }(DivTermCycle);
for (const auto *SuccBlock : successors(&DivTermBlock)) {
if (DivTermCycle && !DivTermCycle->contains(SuccBlock)) {
@@ -655,7 +658,8 @@ public:
const auto *Block = CyclePOT[BlockIdx];
// If no irreducible cycle, stop if freshLable.count() = 1 and Block
// is the IPD. If it is in any irreducible cycle, continue propagation.
- if (FreshLabels.count() == 1 && (!IrreducibleAncestor || !IrreducibleAncestor->contains(Block)))
+ if (FreshLabels.count() == 1 &&
+ (!IrreducibleAncestor || !IrreducibleAncestor->contains(Block)))
break;
LLVM_DEBUG(dbgs() << "Current labels:\n"; printDefs(dbgs()));
``````````
</details>
https://github.com/llvm/llvm-project/pull/139667
More information about the llvm-commits
mailing list