[PATCH] D112549: Adding patch and unittest to generalize ignorable induction casts in the LoopVectorizationLegality analysis.

Avery Laird via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 18:12:03 PDT 2021


avery-laird planned changes to this revision.
avery-laird added a comment.

- determine whether getCastInsts() can be modified to have the desired behaviour directly (and implement if so)
- remove redundant type check
- if necessary, update comment in LoopVectorizationLegality.h to reflect changes



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp:524
     InductionCastsToIgnore.insert(*Casts.begin());
+  for (Value *O : cast<User>(Phi)->users())
+    if (auto *I = dyn_cast<Instruction>(O))
----------------
bmahjour wrote:
> Isn't the subject cast available in the list returned by getCastInsts()?
right now it is not, and that is the main issue. Ideally, getCastInsts() would return these types of casts. I'm currently looking into this further to see if there is a way to instead modify getCastInsts(). One issue with this, as you identified, is that getCastInsts() has stricter guarantees than required by the cost model.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112549/new/

https://reviews.llvm.org/D112549



More information about the llvm-commits mailing list