[PATCH] D115112: [LV] Remove dead IV casts using VPlan (NFC).
Ayal Zaks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 10 01:15:56 PST 2021
Ayal added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:307
+ auto &Casts = IV->getDescriptor().getCastInsts();
+ if (Casts.empty() || IV->getTruncInst())
+ continue;
----------------
fhahn wrote:
> Ayal wrote:
> > If IV has a TruncInst all of its Casts are to be retained?
> For now, the TruncInst handling is completely separate tat the moment; If the Trunc has not been removed as dead, we will create a new (optimized) VPWidenIntOrFpInductionRecipe for the TruncInst, so there is nothing to remove here.
It seems a bit more logical then to have "if (!IV || IV->getTruncInst()) continue", thereby indicating which recipes are (ir)relevant for this transformation.
If an IV with a TruncInst can have Casts, are their recipes removed/not-generated elsewhere? Otherwise, can we assert that there's no TruncInst after we checked that there are Casts?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115112/new/
https://reviews.llvm.org/D115112
More information about the llvm-commits
mailing list