[PATCH] D143323: [ConstraintElim] Add reproducer remarks.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 4 09:10:20 PST 2023


fhahn created this revision.
fhahn added reviewers: paquette, spatel, nikic, zjaffal.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
fhahn requested review of this revision.
Herald added a project: LLVM.

This patch adds an optimization remark for each performed optimization
containing a module that can be used to reproduce the transformation.

The reproducer function contains a series of @llvm.assume calls, one for
each condition currently in scope. For each condition, the operand
instruction are cloned until we reach operands that have an entry in the
constraint system. Those will then be added as function arguments.

The reproducer functions are minimal, that is, they only contain the
conditions required for a given simplification. The resulting IR is very
compact and can be used to verify each transformation individually.

It also provides a python script to extract the IR from the remarks and
create LLVM IR files from it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143323

Files:
  llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
  llvm/test/Transforms/ConstraintElimination/analysis-invalidation.ll
  llvm/test/Transforms/ConstraintElimination/reproducer-remarks.ll
  llvm/tools/opt-viewer/extract-reproducers.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143323.494838.patch
Type: text/x-patch
Size: 19713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230204/9ff2ac6c/attachment.bin>


More information about the llvm-commits mailing list