[PATCH] D125533: Revert "[LoopVectorize] Simplify scalar cost calculation in getInstructionCost."

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 03:40:58 PDT 2022


fhahn created this revision.
fhahn added reviewers: sdesmalen, david-arm, Ayal, gilr.
Herald added a subscriber: hiraditya.
Herald added a project: All.
fhahn requested review of this revision.
Herald added a project: LLVM.

This reverts 6998f8ae2d14e096aff33968f226587b5c1a193a <https://reviews.llvm.org/rG6998f8ae2d14e096aff33968f226587b5c1a193a>.

Unfortunately another issue surfaced where the underlying assumption for
the patch does not hold and we hit the assertion for an Add instruction.

In pr55096-scalarize-add.ll, there's an add that will get scalarized (as
it is an induction update that has scalarized users) and there will be
multiple copies after vectorization.

The way we currently compute the costs for instructions involved in
induction updates is not really accurate, but I don't think there's an
easy way to ensure scalarized instructions will have  single copy after
vectorization.

Fixes #55096.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125533

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/no_vector_instructions.ll
  llvm/test/Transforms/LoopVectorize/X86/pr55096-scalarize-add.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125533.429187.patch
Type: text/x-patch
Size: 9150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220513/f91719a5/attachment.bin>


More information about the llvm-commits mailing list