diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp --- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -2656,8 +2656,8 @@ if (I.getType()->isTokenTy() && I.isUsedOutsideOfBlock(BB)) return false; - if (auto CS = CallSite(&I)) - if (CS.isConvergent() || CS.cannotDuplicate()) + if (auto *CB = dyn_cast(&I)) + if (CB->isConvergent() || CB->cannotDuplicate()) return false; Cost += TTI.getUserCost(&I);