[LV] Do not rely on InductionDescriptor::getCastInsts. (NFC)

Now that CastDef is passed as VPValue, there is no need to access
ID.getCastInsts, as CastDef can instead be checked.
This commit is contained in:
Florian Hahn 2021-11-10 13:03:44 +00:00
parent 4fb0805c65
commit 93931d78cf
No known key found for this signature in database
GPG Key ID: EEF712BB5E80EBBA
1 changed files with 6 additions and 2 deletions

View File

@ -2391,9 +2391,13 @@ void InnerLoopVectorizer::recordVectorLoopValueForInductionCast(
if (isa<TruncInst>(EntryVal))
return;
const SmallVectorImpl<Instruction *> &Casts = ID.getCastInsts();
if (Casts.empty())
if (!CastDef) {
assert(ID.getCastInsts().empty() &&
"there are casts for ID, but no CastDef");
return;
}
assert(!ID.getCastInsts().empty() &&
"there is a CastDef, but no casts for ID");
// Only the first Cast instruction in the Casts vector is of interest.
// The rest of the Casts (if exist) have no uses outside the
// induction update chain itself.