[PATCH] D50840: [InstCombine] Extend collectShuffleElements to support extract/zext/insert patterns

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 07:02:40 PDT 2018


lebedev.ri added a comment.

1. Why is this limited to extensions? Why can't this also be done for `trunc`? Or more generally, why don't we want to do this if the same operation is applied for all the elements?
2. Do the vectorizer passes handle this? (Especially in light of the last question of `1.`)



================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:477
+    if(ExtOpc)
+      if (CastInst *ZI = dyn_cast<CastInst>(ScalarOp))
+        if (ZI->getOpcode() == *ExtOpc)
----------------
Why `ZI`?
Is this limited to `zext`?
`CI` perhaps?


================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:801
+  Optional<Instruction::CastOps> ExtOpc = None;
+  if (CastInst *ZI = dyn_cast<CastInst>(ScalarOp)) {
+    if (ZI->getOpcode() == Instruction::ZExt ||
----------------
Same


Repository:
  rL LLVM

https://reviews.llvm.org/D50840





More information about the llvm-commits mailing list