Index: llvm/lib/Analysis/StackLifetime.cpp =================================================================== --- llvm/lib/Analysis/StackLifetime.cpp +++ llvm/lib/Analysis/StackLifetime.cpp @@ -85,8 +85,8 @@ while (!WorkList.empty()) { const Instruction *I = WorkList.pop_back_val(); for (const User *U : I->users()) { - if (auto *BI = dyn_cast(U)) { - WorkList.push_back(BI); + if (U->stripPointerCasts() == AI) { + WorkList.push_back(cast(U)); continue; } auto *UI = dyn_cast(U);