X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FExtendingLLVM.rst;h=2552c075c9c7625a33f479c064aaaefd235e1edd;hb=07aa3556c450258ddab1d9442322e1e8fc3ae7c7;hp=e41cfd996e5215f615d1ba711d4c6726b8991bcf;hpb=bef3ef99752ba2753decefc5d7f9e80c3e5d47b6;p=oota-llvm.git diff --git a/docs/ExtendingLLVM.rst b/docs/ExtendingLLVM.rst index e41cfd996e5..2552c075c9c 100644 --- a/docs/ExtendingLLVM.rst +++ b/docs/ExtendingLLVM.rst @@ -1,5 +1,3 @@ -.. _extending_llvm: - ============================================================ Extending LLVM: Adding instructions, intrinsics, types, etc. ============================================================ @@ -47,7 +45,7 @@ function and then be turned into an instruction if warranted. what the restrictions are. Talk to other people about it so that you are sure it's a good idea. -#. ``llvm/include/llvm/Intrinsics*.td``: +#. ``llvm/include/llvm/IR/Intrinsics*.td``: Add an entry for your intrinsic. Describe its memory access characteristics for optimization (this controls whether it will be DCE'd, CSE'd, etc). Note @@ -60,7 +58,7 @@ function and then be turned into an instruction if warranted. If it is possible to constant fold your intrinsic, add support to it in the ``canConstantFoldCallTo`` and ``ConstantFoldCall`` functions. -#. ``llvm/test/Regression/*``: +#. ``llvm/test/*``: Add test cases for your test cases to the test suite @@ -166,10 +164,10 @@ complicated behavior in a single node (rotate). #. TODO: document complex patterns. -#. ``llvm/test/Regression/CodeGen/*``: +#. ``llvm/test/CodeGen/*``: Add test cases for your new node to the test suite. - ``llvm/test/Regression/CodeGen/X86/bswap.ll`` is a good example. + ``llvm/test/CodeGen/X86/bswap.ll`` is a good example. Adding a new instruction ======================== @@ -219,7 +217,7 @@ Adding a new instruction add support for your instruction to code generators, or add a lowering pass. -#. ``llvm/test/Regression/*``: +#. ``llvm/test/*``: add your test cases to the test suite. @@ -270,7 +268,7 @@ Adding a derived type add support for derived type to: - .. code:: c++ + .. code-block:: c++ std::string getTypeDescription(const Type &Ty, std::vector &TypeStack) @@ -283,12 +281,12 @@ Adding a derived type add ability to parse in the type from text assembly -#. ``llvm/lib/BitCode/Writer/Writer.cpp``: +#. ``llvm/lib/Bitcode/Writer/Writer.cpp``: modify ``void BitcodeWriter::outputType(const Type *T)`` to serialize your type -#. ``llvm/lib/BitCode/Reader/Reader.cpp``: +#. ``llvm/lib/Bitcode/Reader/Reader.cpp``: modify ``const Type *BitcodeReader::ParseType()`` to read your data type @@ -296,7 +294,7 @@ Adding a derived type modify - .. code:: c++ + .. code-block:: c++ void calcTypeName(const Type *Ty, std::vector &TypeStack,