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

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 04:41:17 PDT 2022


Ayal accepted this revision.
Ayal added a comment.
This revision is now accepted and ready to land.

This is fine, thanks!

Couple of minor nits, plus Summary can be updated:
"use ILV::LoopMiddleBlock directly to set VPTransformState::CFG::LastBB" >>
"use successor of VectorHeaderBB (LoopMiddleBlock) directly to set VPTransformState::CFG::ExitBB"



================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:908
+  State->CFG.PrevVPBB = nullptr;
+  BasicBlock *VectorHeaderBB = State->CFG.PrevBB;
+  State->CFG.ExitBB = VectorHeaderBB->getSingleSuccessor();
----------------
nit: simpler and clearer to set

```
BasicBlock *VectorHeaderBB = State->CFG.VectorPreHeader->getSingleSuccessor();
State->CFG.PrevBB = VectorHeaderBB;
```


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

```
  State->CurrentVectorLoop = State->LI->getLoopFor(VectorHeaderBB);
```



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