[PATCH] D124802: Custom IR printer for SLP that prints the cost after each vectorized instruction

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 13:30:25 PDT 2022


vporpo created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
vporpo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

NOTE: This is WIP and not ready for reaview.

If we use a custom printer we could annotate the instructions with their cost.
This could prove useful for keeping track of cost model changes.
We could use that in existing lit tests and get something like:

  %6 = add <4 x i32> %shuffle, %4            Cost: -3
  %7 = bitcast i32* %idxS0 to <4 x i32>*
  store <4 x i32> %6, <4 x i32>* %7, align 8 Cost: -3
  ret void

There are some issues though:

- The cost of inserts/extracts is not currently being mapped well to the generated instructions, so this needs more work
- The dump contains dead instructions that are not being removed by SLP.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124802

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/SLPVectorizer/X86/broadcast.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124802.426510.patch
Type: text/x-patch
Size: 10312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220502/bbea1d44/attachment.bin>


More information about the llvm-commits mailing list