[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
Thu Apr 6 16:09:27 PDT 2017


wdng added inline comments.


================
Comment at: lib/Target/AMDGPU/SIFixSGPRCopies.cpp:333
+                                 const TargetRegisterInfo *TRI) {
+  std::queue<MachineBasicBlock*> cur, next;
+  cur.push(MBB);
----------------
rampitec wrote:
> wdng wrote:
> > rampitec wrote:
> > > You do not need two queues. In fact it is usually done with a SmallVector.
> > BFS can be implemented in different ways, either using one queue or two. Are there any benefits to use SmallVector? Thanks!
> You definitely do not need two. Then llvm preferrs to use its own containers over std.
I agree to use LLVM's own container, but implementing BFS using vectors is not a good data structure choice although it's doable.


Repository:
  rL LLVM

https://reviews.llvm.org/D31350





More information about the llvm-commits mailing list