[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
Tue Apr 11 23:47:58 PDT 2017


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:
> 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.


Repository:
  rL LLVM

https://reviews.llvm.org/D31350





More information about the llvm-commits mailing list