[PATCH] D140580: [SLP]Do not emit many extractelements, reuse the single one emitted.

Denis Antrushin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 23:30:20 PST 2023


dantrushin added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:9590
+          auto EEIt = It->second.find(Builder.GetInsertBlock());
+          if (EEIt != It->second.end()) {
+            auto *I = cast<Instruction>(EEIt->second);
----------------
ABataev wrote:
> anna wrote:
> > anna wrote:
> > > You need to check here that `EEIt->second` is an instruction.
> > > ```
> > > if (EEIt != It->second.end() && isa<Instruction>(EEIt->second))
> > > ```
> > > avoids the assertion failure.
> > Although all values passed into `ScalarToEEs` are indeed instructions. So, why do we end up with some empty value in the map..
> Need a reproducer to understand better the cause and provide the best fix.
Dowstream we have `EEIt->second`  being `<8 x i64> zeroinitializer` here (which is not an Instruction).



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140580



More information about the llvm-commits mailing list