LLVM backend for 6502
Go to file
Michael Gottesman 7bef073622 [ObjCARC Annotations] Implemented ARC annotation metadata to expose the ARC data flow analysis state in the IR via metadata.
Previously the inner works of the data flow analysis in ObjCARCOpts was hard to
get out of the optimizer for analysis of bugs or testing. All of the current ARC
unit tests are based off of testing the effect of the data flow
analysis (i.e. what statements are removed or moved, etc.). This creates
weakness in the current unit testing regimem since we are not actually testing
what effects various instructions have on the modeled pointer state.
Additionally in order to analyze a bug in the optimizer, one would need to track
by hand what the optimizer was actually doing either through use of DEBUG
statements or through the usage of a debugger, both yielding large loses in
developer productivity.

This patch deals with these two issues by providing ARC annotation
metadata that annotates instructions with the state changes that they cause in
various pointers as well as provides metadata to annotate provenance sources.

Specifically, we introduce the following metadata types:

1. llvm.arc.annotation.bottomup.
2. llvm.arc.annotation.topdown.
3. llvm.arc.annotation.provenancesource.

llvm.arc.annotation.{bottomup,topdown}: These annotations describes a state
change in a pointer when we are visiting instructions bottomup/topdown
respectively. The output format for both is the same:

  !1 = metadata !{metadata !"(test,%x)", metadata !"S_Release", metadata !"S_Use"}

The first element is a string tuple with the following format:

  (function,variable name)

The second two elements of the metadata show the previous state of the
pointer (in this case S_Release) and the new state of the pointer (S_Use). We
write the metadata in such a manner to ensure that it is easy for outside tools
to parse. This is important since I am currently working on a tool for taking
this information and pretty printing it besides the IR and that can be used for
LIT style testing via the generation of an index.

llvm.arc.annotation.provenancesource: This metadata is used to annotate
instructions which act as provenance sources, i.e. ones that introduce a
new (from the optimizer's perspective) non-argument pointer to track. This
enables cross-referencing in between provenance sources and the state changes
that occur to them.

This is still a work in progress. Additionally I plan on committing
later today additions to the annotations that annotate at the top/bottom
of basic blocks the state of the various pointers being tracked.

*NOTE* The metadata support is conditionally compiled into libObjCARCOpts only
when we are producing a debug build of llvm/clang and even so are
disabled by default. To enable the annotation metadata, pass in
-enable-objc-arc-annotations to opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177951 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 00:42:04 +00:00
autoconf Refine fenv.h handling: check if the desired macros exist, before using 2013-03-25 13:13:33 +00:00
bindings [python] Add markup option to disassembler 2012-12-01 21:57:30 +00:00
cmake Introduce a tiny CMake project to gather Subversion revision information and place it into a header. 2013-03-25 23:14:19 +00:00
docs Added documentation to LangRef for the intrinsic llvm.ptr.annotation.* which for some reason was never written. 2013-03-26 00:34:27 +00:00
examples Update links to "Itanium C++ ABI: Exception Handling" document 2013-01-13 15:53:09 +00:00
include [ELF] dont compute symbolname size in every loop 2013-03-25 20:26:47 +00:00
lib [ObjCARC Annotations] Implemented ARC annotation metadata to expose the ARC data flow analysis state in the IR via metadata. 2013-03-26 00:42:04 +00:00
projects Print a warning message if compiler-rt can't be built because of old CMake version to make this requirement more visible to users 2013-03-05 14:43:07 +00:00
runtime Remove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and 2013-03-07 02:03:08 +00:00
test Revise alignment checking/calculation on 256-bit unaligned memory access 2013-03-25 23:50:10 +00:00
tools [tools][llvm-readobj] print the name of the section when iterating the symbol table / dynamic symbol table 2013-03-25 16:06:51 +00:00
unittests Test case for graceful handling of long file names on Windows. Patch thanks to Paul Robinson! 2013-03-16 15:00:51 +00:00
utils x86 -- add the XTEST instruction 2013-03-25 18:59:43 +00:00
.arcconfig Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool. 2012-12-01 12:07:58 +00:00
.gitignore Add extra vim swap file pattern 2012-10-09 23:48:34 +00:00
CMakeLists.txt Revert CMake version bump since we don't actually need 2.8.6 any more. 2013-02-18 11:53:37 +00:00
CODE_OWNERS.TXT Update 2013-03-18 17:47:33 +00:00
configure Refine fenv.h handling: check if the desired macros exist, before using 2013-03-25 13:13:33 +00:00
CREDITS.TXT Update 2013-03-18 17:47:33 +00:00
LICENSE.TXT Add LICENSE.TXT covering contributions made by ARM. 2013-01-07 10:04:49 +00:00
llvm.spec.in Tidy up. s/Low Level Virtual Machine/LLVM/. 2012-01-25 22:00:23 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Improved svn repo searching for 'make update' 2013-01-28 03:19:57 +00:00
Makefile.common Makefile.common: Update a description, s/Source/SOURCES/ , according to MakefileGuide.html#control-variables . 2012-12-07 01:43:23 +00:00
Makefile.config.in Turn anonymous type in anonymous union warning back on after cleaning up 2013-03-15 00:43:00 +00:00
Makefile.rules Turn anonymous type in anonymous union warning back on after cleaning up 2013-03-15 00:43:00 +00:00
README.txt Revert "Test commit" 2013-02-22 19:19:41 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.