File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed
test/Analysis/UniformityAnalysis/AMDGPU Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,9 @@ template <typename ContextT> class DivergencePropagator {
630630 auto IsInIrreducibleCycle = [this ](const BlockT *B) {
631631 for (const auto *Cycle = CI.getCycle (B); Cycle;
632632 Cycle = Cycle->getParentCycle ()) {
633+ // If everything is inside a reducible cycle, then look no further
634+ if (Cycle->isReducible () && Cycle->contains (&DivTermBlock))
635+ return false ;
633636 if (!Cycle->isReducible ())
634637 return true ;
635638 }
@@ -638,12 +641,9 @@ template <typename ContextT> class DivergencePropagator {
638641
639642 // Technically propagation can continue until it reaches the last node.
640643 //
641- // For efficiency, propagation can just stop at the IPD (immediate
642- // post-dominator) of successors(DivTemBlock) for any reducible graph.
643- // If FreshLabels.count()=1, the block in FreshLabels should be the IPD.
644- //
645- // For irreducible cycle, propagation continues until it reaches out of
646- // any irreducible cycles first, then stop when FreshLabels.count()=1.
644+ // For efficiency, propagation can stop if FreshLabels.count()==1. But
645+ // For irreducible cycles, let propagation continue until it reaches
646+ // out of irreducible cycles (see code for details.)
647647 while (true ) {
648648 auto BlockIdx = FreshLabels.find_last ();
649649 if (BlockIdx == -1 )
Original file line number Diff line number Diff line change 1- ;
21; RUN: opt -mtriple amdgcn-- -passes='print<uniformity>' -disable-output %s 2>&1 | FileCheck %s
32;
43; This is to test an if-then-else case with some unmerged basic blocks
7372}
7473
7574
76- declare i32 @llvm.amdgcn.workitem.id.x () #0
77-
78- attributes #0 = {nounwind readnone }
75+ declare i32 @llvm.amdgcn.workitem.id.x ()
Original file line number Diff line number Diff line change 1- ;
21; RUN: opt -mtriple amdgcn-- -passes='print<uniformity>' -disable-output %s 2>&1 | FileCheck %s
32;
43; This is to test a divergent phi involving loops
7776 ret void
7877}
7978
80- declare i32 @llvm.amdgcn.workitem.id.x () #0
81-
82- attributes #0 = {nounwind readnone }
79+ declare i32 @llvm.amdgcn.workitem.id.x ()
You can’t perform that action at this time.
0 commit comments