[PATCH] D68814: [LV] Allow assume calls in predicated blocks.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 4 10:14:51 PST 2020


fhahn updated this revision to Diff 236189.
fhahn added a comment.

In D68814#1797963 <https://reviews.llvm.org/D68814#1797963>, @Ayal wrote:

> [snip]
>  Hence the vote to simply include all ConditionalAssumes in DeadInstructions instead.
>
> Having a VPInstruction-based VPlan-to-VPlan transformation would be fine, of course, which drops assumes in if-converted blocks and keeps those under (retained, if any) uniform branches. For buildVPlanWithVPRecipes, however, it would be better to make progress on refactoring Recipes into VPInstructions, wrt assume intrinsics in this case, than to start befriending Recipes and examine their ingredients. As for the VPInstruction-based transformation, should VPInstruction provide an adequate interface (isAssume(), or perhaps an Assume Opcode?) rather than befriending it and examining its UnderlyingInstr(?).


Agreed! Let's keep things simple in this patch.

I went ahead and updated the patch to collect the assume instructions in Legal and then add them to the dead instructions just before creating the recipies. Alternatively we could record and remove the assume instructions, but it seems using DeadInstructions is slightly more straight forward.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68814

Files:
  llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
  llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/predicate-assume.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68814.236189.patch
Type: text/x-patch
Size: 11313 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200104/a253ef3e/attachment.bin>


More information about the llvm-commits mailing list