[PATCH] D48369: [CodeGen] Make block removal order deterministic in CodeGenPrepare

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 21 08:41:43 PDT 2018


dexonsmith requested changes to this revision.
dexonsmith added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:483-484
     while (!WorkList.empty()) {
       BasicBlock *BB = *WorkList.begin();
-      WorkList.erase(BB);
+      WorkList.remove(BB);
       SmallVector<BasicBlock*, 2> Successors(succ_begin(BB), succ_end(BB));
----------------
This call to `remove` is linear.  Popping from the back would be amortized constant time:
```
BasicBlock *BB = WorkList.pop_back_val();
```



Repository:
  rL LLVM

https://reviews.llvm.org/D48369





More information about the llvm-commits mailing list