[PATCH] D86859: [Coroutine] Make dealing with alloca spills more robust

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 08:59:08 PDT 2020


lxfind added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:674
+
+  void visitLoadInst(LoadInst &) {}
 
----------------
hoy wrote:
> Does a load from an alloca need to be rewritten?
No because it would already have the right value.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:679
   // alloca and therefore we need to copy.
-  void visitStoreInst(StoreInst &SI) { PI.setAborted(&SI); }
+  void visitStoreInst(StoreInst &SI) { PI.setEscaped(&SI); }
 
----------------
hoy wrote:
> If the use is the pointer, should the store be rewritten if it is dominated by coro.begin?
We only visit instructions before coro.begin, so it won't be dominated by coro.begin.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:694
+
+  void visitGetElementPtrInst(GetElementPtrInst &GEPI) {
+    // The base visitor will adjust Offset accordingly.
----------------
hoy wrote:
> Is a normal function call needed to be handled?
It's already handled in the base class, where it assumes escape.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86859



More information about the llvm-commits mailing list