[Examples] Add IRTransformations directory to examples.
authorFlorian Hahn <flo@fhahn.com>
Tue, 12 Nov 2019 14:06:12 +0000 (14:06 +0000)
committerFlorian Hahn <flo@fhahn.com>
Tue, 12 Nov 2019 14:14:48 +0000 (14:14 +0000)
commit7d0b1d77b3d4d47df477519fd1bf099b3df6f899
treeca900ee5b656d7e131ddcb29a2b763ec9fe4dac4
parenta6c40f56aed1556a80867209b6846f7eedc4dc78
[Examples] Add IRTransformations directory to examples.

This patch adds a new IRTransformations directory to llvm/examples/. This is
intended to serve as a new home for example transformations/analysis
code used by various tutorials.

If LLVM_BUILD_EXAMPLES is enabled, the ExamplesIRTransforms library is
linked into the opt binary and the example passes become available.

To start off with, it contains the CFG simplifications used in the IR
part of the 'Getting Started With LLVM: Basics' tutorial at the US LLVM
Developers Meeting 2019.

Reviewers: paquette, jfb, meikeb, lhames, kbarton

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D69416
16 files changed:
llvm/CMakeLists.txt
llvm/examples/CMakeLists.txt
llvm/examples/IRTransforms/CMakeLists.txt [new file with mode: 0644]
llvm/examples/IRTransforms/InitializePasses.cpp [new file with mode: 0644]
llvm/examples/IRTransforms/InitializePasses.h [new file with mode: 0644]
llvm/examples/IRTransforms/SimplifyCFG.cpp [new file with mode: 0644]
llvm/examples/IRTransforms/SimplifyCFG.h [new file with mode: 0644]
llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg-blockaddress.ll [new file with mode: 0644]
llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg1.ll [new file with mode: 0644]
llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg2-dead-block-order.ll [new file with mode: 0644]
llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg3-phis.ll [new file with mode: 0644]
llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg4-multiple-duplicate-cfg-updates.ll [new file with mode: 0644]
llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg5-del-phis-for-dead-block.ll [new file with mode: 0644]
llvm/test/Examples/IRTransforms/SimplifyCFG/tut-simplify-cfg6-dead-self-loop.ll [new file with mode: 0644]
llvm/tools/opt/CMakeLists.txt
llvm/tools/opt/opt.cpp