@@ -284,21 +284,6 @@ class G4_BB
284284 // if the block is under simd flow control
285285 bool inSimdFlow;
286286
287- // [HW WA]
288- // If the block does not post-dominate the entry, it is considered
289- // as divergent BB. Within a divergent BB, a further divergence is
290- // considered as nested divergent.
291- //
292- // [Formal def] define root_1_divergentBB (level 1 divergent root)
293- // to be BBs that
294- // 1. not pdom(BB, entry); and
295- // 2. There exists P, so that idom(P, BB) && pdom(P, entry)
296- // A BB is in a nested divergent branch if there is a root_1_divergentBB,
297- // say B1, such that dom(B1, BB) && not pdom(BB, B1).
298- //
299- // This is set in processGoto().
300- bool inNestedDivergentBranch;
301-
302287 // the physical pred/succ for this block (i.e., the pred/succ for this block in the BB list)
303288 // Note that some transformations may rearrange BB layout, so for safety it's best to recompute
304289 // this
@@ -384,8 +369,7 @@ class G4_BB
384369 traversal (0 ), idom(NULL ), beforeCall(NULL ),
385370 afterCall (NULL ), calleeInfo(NULL ), BBType(G4_BB_NONE_TYPE),
386371 inNaturalLoop (false ), hasSendInBB(false ), loopNestLevel(0 ), scopeID(0 ),
387- inSimdFlow (false ), inNestedDivergentBranch(false ),
388- physicalPred (NULL ), physicalSucc(NULL ), parent(fg),
372+ inSimdFlow (false ), physicalPred(NULL ), physicalSucc(NULL ), parent(fg),
389373 instList (alloc)
390374 {
391375 }
@@ -430,10 +414,6 @@ class G4_BB
430414
431415 void setSendInBB (bool val) { hasSendInBB = val; }
432416 bool isSendInBB () { return hasSendInBB; }
433-
434- void setInNestedDivergentBranch (bool val) { inNestedDivergentBranch = val; }
435- bool isInNestedDivergentBranch () const { return inNestedDivergentBranch; }
436-
437417 void setNestLevel () {loopNestLevel ++;}
438418 unsigned char getNestLevel () {return loopNestLevel;}
439419 void resetNestLevel () { loopNestLevel = 0 ; }
@@ -706,6 +686,21 @@ class FlowGraph
706686 // ToDo: We should use FuncInfo instead, but at the time it was needed FuncInfo was not constructed yet..
707687 std::unordered_map<G4_Label*, std::vector<G4_BB*>> subroutines;
708688
689+ // [HW WA]
690+ // If the block does not post-dominate the entry, it is considered
691+ // as divergent BB. Within a divergent BB, a further divergence is
692+ // considered as nested divergent.
693+ //
694+ // [Formal def] define root_1_divergentBB (level 1 divergent root)
695+ // to be BBs that
696+ // 1. not pdom(BB, entry); and
697+ // 2. There exists P, so that idom(P, BB) && pdom(P, entry)
698+ // A BB is in a nested divergent branch if there is a root_1_divergentBB,
699+ // say B1, such that dom(B1, BB) && not pdom(BB, B1).
700+ //
701+ // This is set in processGoto().
702+ std::unordered_map<G4_BB*, int > nestedDivergentBBs;
703+
709704public:
710705 typedef std::pair<G4_BB*, G4_BB*> Edge;
711706 typedef std::set<G4_BB*> Blocks;
@@ -922,6 +917,15 @@ class FlowGraph
922917 return false ;
923918 }
924919
920+ void setInNestedDivergentBranch (G4_BB* B)
921+ {
922+ nestedDivergentBBs[B] = 1 ;
923+ }
924+ bool isInNestedDivergentBranch (G4_BB* B) const
925+ {
926+ return nestedDivergentBBs.count (B) > 0 ;
927+ }
928+
925929 //
926930 // Merge multiple returns into one, prepare for spill code insertion
927931 //
0 commit comments