diff --git a/lib/Target/AArch64/SVEIntrinsicOpts.cpp b/lib/Target/AArch64/SVEIntrinsicOpts.cpp index 67fc4ee0a29..8e8b12c07bb 100644 --- a/lib/Target/AArch64/SVEIntrinsicOpts.cpp +++ b/lib/Target/AArch64/SVEIntrinsicOpts.cpp @@ -248,10 +248,8 @@ bool SVEIntrinsicOpts::runOnModule(Module &M) { case Intrinsic::aarch64_sve_ptest_any: case Intrinsic::aarch64_sve_ptest_first: case Intrinsic::aarch64_sve_ptest_last: - for (auto I = F.user_begin(), E = F.user_end(); I != E;) { - auto *Inst = dyn_cast(*I++); - Functions.insert(Inst->getFunction()); - } + for (User *U : F.users()) + Functions.insert(cast(U)->getFunction()); break; default: break;