diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp --- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp @@ -2832,7 +2832,7 @@ while (auto *Inst = dyn_cast_or_null(Storage)) { if (auto *LdInst = dyn_cast(Inst)) { - Storage = LdInst->getOperand(0); + Storage = LdInst->getPointerOperand(); // FIXME: This is a heuristic that works around the fact that // LLVM IR debug intrinsics cannot yet distinguish between // memory and value locations: Because a dbg.declare(alloca) is @@ -2842,7 +2842,7 @@ if (!SkipOutermostLoad) Expr = DIExpression::prepend(Expr, DIExpression::DerefBefore); } else if (auto *StInst = dyn_cast(Inst)) { - Storage = StInst->getOperand(0); + Storage = StInst->getValueOperand(); } else { SmallVector Ops; SmallVector AdditionalValues;