aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2016-08-12 05:45:49 +0000
committerGor Nishanov <GorNishanov@gmail.com>2016-08-12 05:45:49 +0000
commit0f303accded1e45fdb897cf8cd7cd687ab26fdb1 (patch)
tree69779413a46346225ef7a53cb48b983400313ef4 /llvm/lib/IR/Verifier.cpp
parent6be57b3fb1076138c85081fb49b1cf45c492bdd6 (diff)
downloadllvm-0f303accded1e45fdb897cf8cd7cd687ab26fdb1.zip
llvm-0f303accded1e45fdb897cf8cd7cd687ab26fdb1.tar.gz
llvm-0f303accded1e45fdb897cf8cd7cd687ab26fdb1.tar.bz2
[Coroutines]: Part6b: Add coro.id intrinsic.
Summary: 1. Make coroutine representation more robust against optimization that may duplicate instruction by introducing coro.id intrinsics that returns a token that will get fed into coro.alloc and coro.begin. Due to coro.id returning a token, it won't get duplicated and can be used as reliable indicator of coroutine identify when a particular coroutine call gets inlined. 2. Move last three arguments of coro.begin into coro.id as they will be shared if coro.begin will get duplicated. 3. doc + test + code updated to support the new intrinsic. Reviewers: mehdi_amini, majnemer Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23412 llvm-svn: 278481
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 4eb33ad..06de460 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3835,8 +3835,8 @@ void Verifier::visitIntrinsicCallSite(Intrinsic::ID ID, CallSite CS) {
switch (ID) {
default:
break;
- case Intrinsic::coro_begin: {
- auto *InfoArg = CS.getArgOperand(3)->stripPointerCasts();
+ case Intrinsic::coro_id: {
+ auto *InfoArg = CS.getArgOperand(2)->stripPointerCasts();
if (isa<ConstantPointerNull>(InfoArg))
break;
auto *GV = dyn_cast<GlobalVariable>(InfoArg);