[PATCH] D121623: [LV] Remove unneeded createHeaderBranch.(NFCI)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 03:16:00 PDT 2022


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:908
+  State->CFG.PrevVPBB = nullptr;
+  BasicBlock *VectorHeaderBB = State->CFG.PrevBB;
+  State->CFG.ExitBB = VectorHeaderBB->getSingleSuccessor();
----------------
Ayal wrote:
> nit: simpler and clearer to set
> 
> ```
> BasicBlock *VectorHeaderBB = State->CFG.VectorPreHeader->getSingleSuccessor();
> State->CFG.PrevBB = VectorHeaderBB;
> ```
Simplified as suggested, thanks!


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:911
   Loop *L = State->LI->getLoopFor(VectorHeaderBB);
   State->CurrentVectorLoop = L;
 
----------------
Ayal wrote:
> nit: (irrespective of this patch) can fold as L is used only here
> 
> ```
>   State->CurrentVectorLoop = State->LI->getLoopFor(VectorHeaderBB);
> ```
> 
Done separately in 2c494f094123


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121623



More information about the llvm-commits mailing list