[PATCH] D109537: [InstCombine] move extend after insertelement if both operands are extended
Anton Afanasyev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 13 08:48:25 PDT 2021
anton-afanasyev added a comment.
> If this looks ok, then instcombine can handle the relatively simple tests in the other patch.
> So we might want to make those a bit longer to show the power of the more general approach in -aggressive-instcombine.
No one of tests touched by D109236 <https://reviews.llvm.org/D109236> isn't processed by this patch, since they are not matched by `inselt (ext X), (ext Y), Index` pattern.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:1430
+ // TODO: We could ease the clause to "if at least one op has one use".
+ if (X->getType()->getScalarType() != Y->getType() || !Vec->hasOneUse())
+ return nullptr;
----------------
Move `hasOneUse()` check above, before matching? Or should be here in light of TODO?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109537/new/
https://reviews.llvm.org/D109537
More information about the llvm-commits
mailing list