[PATCH] D74495: [VectorCombine] try to form vector binop to eliminate an extract element

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 13:01:58 PST 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:103
+  // TODO: Relax the one-use constraints by adjusting the cost calc.
+  if (Ext0 != Ext1 && (!Ext0->hasOneUse() || !Ext1->hasOneUse()))
+    return false;
----------------
lebedev.ri wrote:
> But even if it's the same extract, do we not care whether it will go away or not,
> unlike the case with two different extracts?
> I.e. for now i'd expect
> ```
>   if (!(Ext0 == Ext1 && Ext0->hasNUses(2)) &&
>       !(Ext0->hasOneUse() && Ext1->hasOneUse()))
>     return false;
> ```
(it might be better to handle extract cost from the getgo?)


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

https://reviews.llvm.org/D74495





More information about the llvm-commits mailing list