[PATCH] D110171: [VectorCombine] Switch to using a worklist.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 21 06:57:09 PDT 2021


fhahn created this revision.
fhahn added reviewers: spatel, RKSimon, lebedev.ri.
Herald added a subscriber: hiraditya.
fhahn requested review of this revision.
Herald added a project: LLVM.

This patch updates VectorCombine to use a worklist to allow iterative
simplifications where a combine enables other combines.

Suggested in D100302 <https://reviews.llvm.org/D100302>.

The main use case at the moment is foldSingleElementStore and
scalarizeLoadExtract working together to improve scalarization.

At the moment, this directly uses the instcombine worklist, which
provides the required infrastructure. Some functions related to the
worklist still include "IC" in the debug output. I can adjust that, if
we decide to re-use the worklist.

Note that we now also do not run SimplifyInstructionsInBlock on the
whole function if there have been changes. This means we fail to
remove/simplify instructions not related to any of the vector combines.
IMO this is fine, as simplifying the whole function seems more like a
workaround for not tracking the changed instructions.

Compile-time wise this has a small but in some cases noticeable impact:
NewPM-O3: +0.08%
NewPM-ReleaseThinLTO: +0.04%
NewPM-ReleaseLTO-g: +0.05%

http://llvm-compile-time-tracker.com/compare.php?from=53720f74e4e32fe11a1688282f7d09dc1828b83a&to=953312b5e6f726fca037952aaeb7e38255c041a4&stat=instructions


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110171

Files:
  llvm/lib/Transforms/Vectorize/VectorCombine.cpp
  llvm/test/Transforms/PhaseOrdering/AArch64/matrix-extract-insert.ll
  llvm/test/Transforms/VectorCombine/AArch64/load-extract-insert-store-scalarization.ll
  llvm/test/Transforms/VectorCombine/X86/extract-binop-inseltpoison.ll
  llvm/test/Transforms/VectorCombine/X86/extract-binop.ll
  llvm/test/Transforms/VectorCombine/load-insert-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110171.373907.patch
Type: text/x-patch
Size: 12742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210921/c714ba20/attachment.bin>


More information about the llvm-commits mailing list