[PATCH] D156850: [NFC][Coroutines] Use a reverse post-order to guide the computation about cross suspend infomation to reach a fixed point faster.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 14:05:39 PDT 2023


MatzeB added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:227-228
 
-template <bool Initialize> bool SuspendCrossingInfo::computeBlockData() {
-  const size_t N = Mapping.size();
+template <bool Initialize, class BBRangeTy>
+bool SuspendCrossingInfo::computeBlockData(const BBRangeTy &BBRange) {
   bool Changed = false;
----------------
Just put `ReversePostOrderTraversal<Function *>&` here. Adding a template parameter that only ever gets the same type just adds needless complexity.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:283-284
     if constexpr (!Initialize) {
       B.Changed = (B.Kills != SavedKills) || (B.Consumes != SavedConsumes);
       Changed |= B.Changed;
     }
----------------
Do we actually need `B.Changed`? Seems to me we only write and immediately read form it here, so a local variable would do instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156850



More information about the llvm-commits mailing list