[PATCH] D31799: [coroutines] Insert spills of PHI instructions correctly

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 18:22:30 PDT 2017


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: lib/Transforms/Coroutines/CoroFrame.cpp:441
+          InsertPt =
+              &*cast<Instruction>(E.def())->getParent()->getFirstInsertionPt();
         } else {
----------------
This will be a problem if this phi is in a catchswitch block created for MSVC EH. Is that something you worry about yet? You can make such a phi like this:
```
int x = 0;
try {
  may_throw();
  ++x;
  may_throw();
} catch (...) {
  use_int(x);
}
```
I'm not sure what you need to do to make this a coroutine as well, but maybe you can make a test case that way.

Anyway, this is totally something that doesn't need to be addressed in this change.


https://reviews.llvm.org/D31799





More information about the llvm-commits mailing list