[PATCH] D105199: [LoopVectorize] Fix scalable vector crash in VPReplicateRecipe::execute

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 7 09:39:48 PDT 2021


kmclaughlin added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3078
+                                               VPTransformState &State) {
+  assert(!Instr->getType()->isAggregateType() && "Can't handle vectors");
+
----------------
I'm a bit confused by the message for this assert, as I thought vectors are not considered to be aggregate types?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3132
+    switch (Instr->getOpcode()) {
+    case Instruction::GetElementPtr: {
+      auto *GEP = cast<GetElementPtrInst>(Instr);
----------------
This switch statement currently only has one case, was this added so that we can support more instructions in the future? If so, would it be better to instead just try a `dyn_cast<GetElementPtrInst>` here and then add the switch again later when we need to cover other instruction types?


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

https://reviews.llvm.org/D105199



More information about the llvm-commits mailing list