[PATCH] [PATCH] SymbolRewriter: introduce the SymbolRewriter pass

Saleem Abdulrasool abdulras at fb.com
Mon Mar 24 12:45:12 PDT 2014


To provide some additional context around this change.  We (Facebook) have been using this for some internal testing and believe that this pass is generally useful and others may benefit from it.  It provides a clean, flexible mechanism for symbol inter-positioning which is very useful in scenarios related to profiling.  Furthermore, this pass may be directly useful in LLVM itself for the santizers which perform symbol inter-positioning for code analysis purposes.  As such, we would like to merge this pass into the public LLVM repository.

---

This introduces the symbol rewriter.  This is an IR->IR transformation that is
implemented as a CodeGenPrepare pass.  This allows for the transparent
adjustment of the symbols during compilation.

It provides a clean, simple, elegant solution for symbol inter-positioning.  This
technique is often used, such as in the various sanitizers and performance
analysis.

The control of this is via a custom YAML syntax map file that indicates source
to destination mapping, so as to avoid having the compiler to know the exact
details of the source to destination transformations.


http://llvm-reviews.chandlerc.com/D3161

Files:
  include/llvm/InitializePasses.h
  lib/CodeGen/CodeGenPrepare.cpp
  lib/CodeGen/LLVMBuild.txt
  lib/Transforms/CMakeLists.txt
  lib/Transforms/LLVMBuild.txt
  lib/Transforms/Makefile
  lib/Transforms/SymbolRewriter/CMakeLists.txt
  lib/Transforms/SymbolRewriter/LLVMBuild.txt
  lib/Transforms/SymbolRewriter/Makefile
  lib/Transforms/SymbolRewriter/SymbolRewriter.cpp
  test/SymbolRewriter/rewrite.ll
  test/SymbolRewriter/rewrite.map
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3161.1.patch
Type: text/x-patch
Size: 32451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140324/1e24df2f/attachment.bin>


More information about the llvm-commits mailing list