[llvm] [VPlan] Introduce VPSingleDefRecipe. (PR #77023)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 7 10:58:29 PST 2024
================
@@ -412,16 +412,16 @@ void VPlanTransforms::removeRedundantInductionCasts(VPlan &Plan) {
auto &Casts = IV->getInductionDescriptor().getCastInsts();
VPValue *FindMyCast = IV;
for (Instruction *IRCast : reverse(Casts)) {
- VPRecipeBase *FoundUserCast = nullptr;
+ VPSingleDefRecipe *FoundUserCast = nullptr;
for (auto *U : FindMyCast->users()) {
- auto *UserCast = cast<VPRecipeBase>(U);
- if (UserCast->getNumDefinedValues() == 1 &&
- UserCast->getVPSingleValue()->getUnderlyingValue() == IRCast) {
+ auto *UserCast = dyn_cast<VPSingleDefRecipe>(U);
+ if (UserCast && UserCast->getNumDefinedValues() == 1 &&
----------------
ayalz wrote:
```suggestion
if (UserCast &&
```
https://github.com/llvm/llvm-project/pull/77023
More information about the llvm-commits
mailing list