[PATCH] D152022: [CodeGen] Add support for reductions in ComplexDeinterleaving pass

Igor Kirillov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 09:51:00 PDT 2023


igor.kirillov marked an inline comment as done.
igor.kirillov added inline comments.


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:1734-1787
+  // If Operation is ReductionPHI, a new empty PHINode is created.
+  // It is filled later when the ReductionOperation is processed.
+  if (Node->Operation == ComplexDeinterleavingOperation::ReductionPHI) {
+    auto *VTy = cast<VectorType>(Node->Real->getType());
+    auto *NewVTy = VectorType::getDoubleElementsVectorType(VTy);
+    auto *NewPHI = PHINode::Create(NewVTy, 0, "", BackEdge->getFirstNonPHI());
+    OldToNewPHI[dyn_cast<PHINode>(Node->Real)] = NewPHI;
----------------
NickGuy wrote:
> This function is getting big. Solely in terms of readability, I'd suggest moving the code for each condition to separate functions, leaving the `if`s here (at least the `ReductionOperation` branch, `ReductionPHI` is small enough on its own)
What do you think about this version?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152022



More information about the llvm-commits mailing list