[PATCH] D135279: [SLP]Improve/fix CSE analysis of the blocks/instructions.

Valeriy Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 13:07:47 PDT 2022


vdmitrie added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8715
         }
+        if (auto *ExI = dyn_cast<Instruction>(Ex))
+          GatherShuffleExtractSeq.insert(ExI);
----------------
ABataev wrote:
> vdmitrie wrote:
> > At this point Ex is guaranteed to be an instruction. So why  dyn_cast?
> Just want to be safe, remember some conflicts with possible ConstExprs as operands. I can change it to cast
I don't think such "safety" measure has good justification. If for some reason the cast fires an assertion it will be easy to understand what happened. Otherwise you would allow the issue to go further which sometimes might result in hard to trace performance issues.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135279



More information about the llvm-commits mailing list