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 @@ -1634,7 +1634,7 @@ // // Note: If we change the strategy dealing with alignment, we need to refine // this casting. - if (GEP->getResultElementType() != Orig->getType()) + if (GEP->getType() != Orig->getType()) return Builder.CreateBitCast(GEP, Orig->getType(), Orig->getName() + Twine(".cast")); }