[PATCH] D31350: AMDGPU : Fix common dominator of two incoming blocks terminates with uniform branch issue.

Wei Ding via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 16:46:05 PDT 2017


wdng marked 3 inline comments as done.
wdng added inline comments.


================
Comment at: lib/Target/AMDGPU/SIFixSGPRCopies.cpp:333
+                               const TargetRegisterInfo *TRI) {
+  DenseSet<MachineBasicBlock*> Visited;
+  SmallVector<MachineBasicBlock*, 4> Worklist(MBB->pred_begin(), 
----------------
arsenm wrote:
> wdng wrote:
> > arsenm wrote:
> > > You could maybe make this a map and cache the result so that every single block that needs to be visited doesn't need to walk all the way up each time
> > Visited is used to check whether the visiting node has been visited before, once is has been visited before it's predecessors won't be processed again. For example:
> > 
> > ```
> >     D
> >   /   \
> >  A     C
> >  |  \  |
> >  B     E 
> >   \   /
> >     F
> > ```
> > Assume starting from node F,  trace down F->B->A->D, when visiting from F to E, A and D won't be processed again. So I don't think there is a need to save results like A and D.
> If you consider the entire function, the same predecessors will be visited for phis in other blocks
A separate patch will be created for optimized search divergent terminators.


Repository:
  rL LLVM

https://reviews.llvm.org/D31350





More information about the llvm-commits mailing list