xazax.hun added inline comments.

================
Comment at: clang/lib/Analysis/LiveVariables.cpp:522
 
-  // FIXME: we should enqueue using post order.
-  for (const CFGBlock *B : cfg->nodes()) {
+  for (const CFGBlock *B : *AC.getAnalysis<PostOrderCFGView>()) {
     worklist.enqueueBlock(B);
----------------
With `BackwardDataflowWorklist`, each  `enqueueBlock` will insert the block 
into a `llvm::PriorityQueue`. So regardless of the insertion order, `dequeue` 
will return the nodes in the reverse post order. 

Inserting elements in the right order into the heap might be beneficial is we 
need to to less work to "heapify". But on the other hand, we did more work to 
insert them in the right order, in the first place. All in all, I am not sure 
whether the comment is still valid and whether this patch would provide any 
benefit over the original code. 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87519/new/

https://reviews.llvm.org/D87519

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to