[PATCH] D87596: [Coroutines] Reuse storage for local variables with non-overlapping lifetimes

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 10:05:04 PDT 2020


lxfind added inline comments.


================
Comment at: llvm/include/llvm/Transforms/Coroutines/CoroSplit.h:28-32
+  CoroSplitPass(PassBuilder::OptimizationLevel Level) {
+    /// If not both Speed level and Size level are zero,
+    /// the OptLevel should not be zero.
+    OptLevel = std::max(Level.getSpeedupLevel(), Level.getSizeLevel());
+  }
----------------
lxfind wrote:
> ChuanqiXu wrote:
> > lxfind wrote:
> > > This isn't needed anymore
> > If CoroSplitPass don't accept PassBuilder::OptimizationLevel as a construct argument, we may need to transfer PassBuilder::OptimizationLevel to unsigned in `PassBuilder.cpp`.
> Yes just call `getSpeedupLevel()` on `Level` when passing it. This optimization is independent to the size optimization flags, just speed.
Well, I guess it's reasonable to run it when size optimization is turned on. Feel free to just move the call to std::max to the callsite.


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

https://reviews.llvm.org/D87596



More information about the llvm-commits mailing list