From: Gabor Greif
We will call physical registers present in the LLVM bytecode before +
We will call physical registers present in the LLVM bitcode before register allocation pre-colored registers. Pre-colored registers are used in many different situations, for instance, to pass parameters of functions calls, and to store results of particular diff --git a/docs/CompilerDriver.html b/docs/CompilerDriver.html index c73723efd08..253f4719a63 100644 --- a/docs/CompilerDriver.html +++ b/docs/CompilerDriver.html @@ -199,7 +199,7 @@
This approach means that new compiler tools can be up and working very quickly. As a first cut, a tool can simply compile its source to raw -(unoptimized) bytecode or LLVM assembly and llvmc can be configured -to pick up the slack (translate LLVM assembly to bytecode, optimize the -bytecode, generate native assembly, link, etc.). In fact, the compiler tools +(unoptimized) bitcode or LLVM assembly and llvmc can be configured +to pick up the slack (translate LLVM assembly to bitcode, optimize the +bitcode, generate native assembly, link, etc.). In fact, the compiler tools need not use any LLVM libraries, and it could be written in any language (instead of C++). The configuration data will allow the full range of optimization, assembly, and linking capabilities that LLVM provides to be added @@ -309,7 +309,7 @@ to these kinds of tools. Enabling the rapid development of front-ends is one of the primary goals of llvmc.
As a compiler tool matures, it may utilize the LLVM libraries and tools -to more efficiently produce optimized bytecode directly in a single compilation +to more efficiently produce optimized bitcode directly in a single compilation and optimization program. In these cases, multiple tools would not be needed and the configuration data for the compiler would change.
@@ -532,10 +532,10 @@ optimization.WARNING: adding instructions changes the bytecode
+ WARNING: adding instructions changes the bitcode
format, and it will take some effort to maintain compatibility with
the previous version. Only add an instruction if it is absolutely
necessary.
WARNING: adding new types changes the bytecode
+ WARNING: adding new types changes the bitcode
format, and will break compatibility with currently-existing LLVM
installations. Only add new types if it is absolutely necessary. Also note: this specific sequence of commands won't work if you use a
function defined in the C++ runtime library (or any other C++ library). To
access an external C++ library, you must manually
-compile libstdc++ to LLVM bytecode, statically link it into your program, then
+compile libstdc++ to LLVM bitcode, statically link it into your program, then
use the commands above to convert the whole result into C code. Alternatively,
you can compile the libraries and your application into two different chunks
of C code and link them.
First, LLVM comes in two pieces. The first piece is the LLVM suite. This contains all of the tools, libraries, and header files needed to use the low -level virtual machine. It contains an assembler, disassembler, bytecode -analyzer and bytecode optimizer. It also contains a test suite that can be +level virtual machine. It contains an assembler, disassembler, bitcode +analyzer and bitcode optimizer. It also contains a test suite that can be used to test the LLVM tools and the GCC front end.
The second piece is the GCC front end. This component provides a version of -GCC that compiles C and C++ code into LLVM bytecode. Currently, the GCC front +GCC that compiles C and C++ code into LLVM bitcode. Currently, the GCC front end uses the GCC parser to convert code to LLVM. Once -compiled into LLVM bytecode, a program can be manipulated with the LLVM tools +compiled into LLVM bitcode, a program can be manipulated with the LLVM tools from the LLVM suite.
@@ -332,7 +332,7 @@ build requires considerably less space.
The LLVM suite may compile on other platforms, but it is not guaranteed to do so. If compilation is successful, the LLVM utilities should be -able to assemble, disassemble, analyze, and optimize LLVM bytecode. Code +able to assemble, disassemble, analyze, and optimize LLVM bitcode. Code generation should work as well, although the generated native code may not work on your platform.
@@ -629,11 +629,11 @@ In order to compile and use LLVM, you may need to set some environment variables.-This allows you to execute LLVM bytecode files directly. Thanks to Jack +This allows you to execute LLVM bitcode files directly. Thanks to Jack Cummings for pointing this out!
@@ -1225,8 +1225,8 @@ different tools.This directory contains libraries which are compiled into LLVM bytecode and +
This directory contains libraries which are compiled into LLVM bitcode and used when linking programs with the GCC front end. Most of these libraries are skeleton versions of real libraries; for example, libc is a stripped down version of glibc.
@@ -1342,22 +1342,22 @@ information is in the Command Guide. be configured to utilize both LLVM and non-LLVM compilation tools to enable pre-processing, translation, optimization, assembly, and linking of programs all from one command line. llvmc also takes care of processing the - dependent libraries found in bytecode. This reduces the need to get the + dependent libraries found in bitcode. This reduces the need to get the traditional -l<name> options right on the command line. Please note that this tool, while functional, is still experimental and not feature complete.Note: The gcc4 frontend's invocation is considerably different from the previous gcc3 frontend. In particular, the gcc4 frontend does not -create bytecode by default: gcc4 produces native code. As the example below illustrates, -the '--emit-llvm' flag is needed to produce LLVM bytecode output. For makefiles and -configure scripts, the CFLAGS variable needs '--emit-llvm' to produce bytecode +create bitcode by default: gcc4 produces native code. As the example below illustrates, +the '--emit-llvm' flag is needed to produce LLVM bitcode output. For makefiles and +configure scripts, the CFLAGS variable needs '--emit-llvm' to produce bitcode output.
Next, compile the C file into a LLVM bytecode file:
+Next, compile the C file into a LLVM bitcode file:
% llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc
The -emit-llvm option can be used with the -S or -c options to emit an LLVM ".ll" or ".bc" file (respectively) for the code. This allows you to use the standard LLVM tools on - the bytecode file.
+ the bitcode file.Unlike llvm-gcc3, llvm-gcc4 correctly responds to -O[0123] arguments.
To emphasize, there is no C/C++ front end currently available. llvm-gcc is based on GCC, which cannot be bootstrapped using VC++. Eventually there should be a llvm-gcc based on Cygwin or MinGW that - is usable. There is also the option of generating bytecode files on Unix and + is usable. There is also the option of generating bitcode files on Unix and copying them over to Windows. But be aware the odds of linking C++ code compiled with llvm-gcc with code compiled with VC++ is essentially zero.
@@ -257,11 +257,11 @@ All these paths are absolute: } -Next, compile the C file into a LLVM bytecode file:
+Next, compile the C file into a LLVM bitcode file:
% llvm-gcc -c hello.c -emit-llvm -o hello.bc
This will create the result file hello.bc which is the LLVM - bytecode that corresponds the the compiled program and the library + bitcode that corresponds the the compiled program and the library facilities that it required. You can execute this file directly using lli tool, compile it to native assembly with the llc, optimize or analyze it further with the opt tool, etc.
diff --git a/docs/HowToSubmitABug.html b/docs/HowToSubmitABug.html index 26cb58c0940..dca518426e4 100644 --- a/docs/HowToSubmitABug.html +++ b/docs/HowToSubmitABug.html @@ -242,7 +242,7 @@ JIT, or LLC) and optionally a series of LLVM passes to run. For example:bugpoint will try to narrow down your list of passes to the one pass -that causes an error, and simplify the bytecode file as much as it can to assist +that causes an error, and simplify the bitcode file as much as it can to assist you. It will print a message letting you know how to reproduce the resulting error.
@@ -268,7 +268,7 @@ Backend, and then link in the shared object it generates.-bugpoint -run-jit -output=[correct output file] [bytecode file] \ +bugpoint -run-jit -output=[correct output file] [bitcode file] \ --tool-args -- [arguments to pass to lli] \ --args -- [program arguments]@@ -278,7 +278,7 @@ bugpoint -run-jit -output=[correct output file] [bytecode file] \
-bugpoint -run-llc -output=[correct output file] [bytecode file] \ +bugpoint -run-llc -output=[correct output file] [bitcode file] \ --tool-args -- [arguments to pass to llc] \ --args -- [program arguments]@@ -297,7 +297,7 @@ make bugpoint-jit
At the end of a successful bugpoint run, you will be presented -with two bytecode files: a safe file which can be compiled with the C +with two bitcode files: a safe file which can be compiled with the C backend and the test file which either LLC or the JIT mis-codegenerates, and thus causes the error.
@@ -306,7 +306,7 @@ the following:Regenerate the shared object from the safe bytecode file:
+Regenerate the shared object from the safe bitcode file:
@@ -315,7 +315,7 @@ the following:
If debugging LLC, compile test bytecode native and link with the shared +
If debugging LLC, compile test bitcode native and link with the shared object:
If debugging the JIT, load the shared object and supply the test - bytecode:
+ bitcode:lli -load=safe.so test.bc [program options]
diff --git a/docs/LangRef.html b/docs/LangRef.html index 96d4fa10868..66dd9ca4b34 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -226,7 +226,7 @@ strategy.The LLVM code representation is designed to be used in three -different forms: as an in-memory compiler IR, as an on-disk bytecode +different forms: as an in-memory compiler IR, as an on-disk bitcode representation (suitable for fast loading by a Just-In-Time compiler), and as a human readable assembly language representation. This allows LLVM to provide a powerful intermediate representation for efficient @@ -268,7 +268,7 @@ following instruction is syntactically okay, but not well formed:
its uses. The LLVM infrastructure provides a verification pass that may be used to verify that an LLVM module is well formed. This pass is automatically run by the parser after parsing input assembly and by -the optimizer before it outputs bytecode. The violations pointed out +the optimizer before it outputs bitcode. The violations pointed out by the verifier pass indicate bugs in transformation passes or input to the parser.Intrinsic function names must all start with an "llvm." prefix. This prefix is reserved in LLVM for intrinsic names; thus, function names may not diff --git a/docs/LinkTimeOptimization.html b/docs/LinkTimeOptimization.html index 1084e352712..fdae78a2a1f 100644 --- a/docs/LinkTimeOptimization.html +++ b/docs/LinkTimeOptimization.html @@ -67,9 +67,9 @@ intermodular optimization, in the compiler tool chain. Its main goal is to let the developer take advantage of intermodular optimizations without making any significant changes to the developer's makefiles or build system. This is achieved through tight integration with the linker. In this model, the linker -treates LLVM bytecode files like native object files and allows mixing and +treates LLVM bitcode files like native object files and allows mixing and matching among them. The linker uses LLVMlto, a dynamically -loaded library, to handle LLVM bytecode files. This tight integration between +loaded library, to handle LLVM bitcode files. This tight integration between the linker and LLVM optimizer helps to do optimizations that are not possible in other models. The linker input allows the optimizer to avoid relying on conservative escape analysis. @@ -87,7 +87,7 @@ conservative escape analysis. supports LTO through the interface described in this document. Here, llvm-gcc4 transparently invokes system linker.
@@ -131,12 +131,12 @@ int main() { } --- command lines --- -$ llvm-gcc4 --emit-llvm -c a.c -o a.o # <-- a.o is LLVM bytecode file +$ llvm-gcc4 --emit-llvm -c a.c -o a.o # <-- a.o is LLVM bitcode file $ llvm-gcc4 -c main.c -o main.o # <-- main.o is native object file $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifications
In this example, the linker recognizes that foo2() is an - externally visible symbol defined in LLVM byte code file. This information + externally visible symbol defined in LLVM bitcode file. This information is collected using readLLVMObjectFile(). Based on this information, the linker completes its usual symbol resolution pass and finds that foo2() is not used anywhere. This information @@ -202,15 +202,15 @@ $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifi
The linker first reads all object files in natural order and collects - symbol information. This includes native object files as well as LLVM byte - code files. In this phase, the linker uses + symbol information. This includes native object files as well as LLVM bitcode + files. In this phase, the linker uses readLLVMObjectFile() to collect symbol - information from each LLVM bytecode files and updates its internal global + information from each LLVM bitcode files and updates its internal global symbol table accordingly. The intent of this interface is to avoid overhead in the non LLVM case, where all input object files are native object files, by putting this code in the error path of the linker. When the linker sees @@ -228,7 +228,7 @@ $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifi
In this stage, the linker resolves symbols using global symbol table information to report undefined symbol errors, read archive members, resolve weak symbols, etc. The linker is able to do this seamlessly even though it - does not know the exact content of input LLVM bytecode files because it uses + does not know the exact content of input LLVM bitcode files because it uses symbol information provided by readLLVMObjectFile(). If dead code stripping is enabled then the linker collects the list of live symbols. @@ -237,12 +237,12 @@ $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifi
After symbol resolution, the linker updates symbol information supplied - by LLVM bytecode files appropriately. For example, whether certain LLVM - bytecode supplied symbols are used or not. In the example above, the linker + by LLVM bitcode files appropriately. For example, whether certain LLVM + bitcode supplied symbols are used or not. In the example above, the linker reports that foo2() is not used anywhere in the program, including native .o files. This information is used by the LLVM interprocedural optimizer. The linker uses optimizeModules() @@ -260,12 +260,12 @@ $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifi
In this phase, the linker reads optimized a native object file and updates the internal global symbol table to reflect any changes. The linker also collects information about any changes in use of external symbols by - LLVM bytecode files. In the examle above, the linker notes that + LLVM bitcode files. In the examle above, the linker notes that foo4() is not used any more. If dead code stripping is enabled then the linker refreshes the live symbol information appropriately and performs dead code stripping.
After this phase, the linker continues linking as if it never saw LLVM - bytecode files.
+ bitcode files.The LLVMSymbol class is used to describe the externally visible - functions and global variables, defined in LLVM bytecode files, to the linker. + functions and global variables, defined in LLVM bitcode files, to the linker. This includes symbol visibility information. This information is used by the linker to do symbol resolution. For example: function foo2() is - defined inside an LLVM bytecode module and it is an externally visible symbol. + defined inside an LLVM bitcode module and it is an externally visible symbol. This helps the linker connect the use of foo2() in native object files with a future definition of the symbol foo2(). The linker will see the actual definition of foo2() when it receives the @@ -310,12 +310,12 @@ $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifi
The readLLVMObjectFile() function is used by the linker to read - LLVM bytecode files and collect LLVMSymbol information. This routine also - supplies a list of externally defined symbols that are used by LLVM bytecode + LLVM bitcode files and collect LLVMSymbol information. This routine also + supplies a list of externally defined symbols that are used by LLVM bitcode files. The linker uses this symbol information to do symbol resolution. - Internally, LLVMlto maintains LLVM bytecode modules in + Internally, LLVMlto maintains LLVM bitcode modules in memory. This function also provides a list of external references used by - bytecode files.
+ bitcode files.The linker invokes optimizeModules to optimize already read - LLVM bytecode files by applying LLVM intermodular optimization techniques. + LLVM bitcode files by applying LLVM intermodular optimization techniques. This function runs the LLVM intermodular optimizer and generates native object code as .o files at the name and location provided by the linker.
@@ -338,7 +338,7 @@ $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifiThe linker may use getTargetTriple() to query target architecture - while validating LLVM bytecode file.
+ while validating LLVM bitcode file.Internally, LLVMlto maintains LLVM bytecode modules in +
Internally, LLVMlto maintains LLVM bitcode modules in memory. The linker may use removeModule() method to remove desired modules from memory.
In some situations, it is desireable to build a single bytecode module from - a variety of sources, instead of an archive, shared library, or bytecode - library. Bytecode modules can be specified in addition to any of the other +
In some situations, it is desireable to build a single bitcode module from + a variety of sources, instead of an archive, shared library, or bitcode + library. Bitcode modules can be specified in addition to any of the other types of libraries by defining the MODULE_NAME variable. For example:
@@ -273,9 +273,9 @@ MODULE_NAME = mymod
will build a module named mymod.bc from the sources in the - directory. This module will be an aggregation of all the bytecode modules - derived from the sources. The example will also build a bytecode archive - containing a bytecode module for each compiled source file. The difference is + directory. This module will be an aggregation of all the bitcode modules + derived from the sources. The example will also build a bitcode archive + containing a bitcode module for each compiled source file. The difference is subtle, but important depending on how the module or library is to be linked.
The table below provides a quick summary of each pass and links to the more complete pass description later in the document.
Yet to be written.
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index 1f02fe699b5..ff18d1c9aa8 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -581,9 +581,9 @@ suite, it gives a report that looks like this:- 7646 bytecodewriter - Number of normal instructions - 725 bytecodewriter - Number of oversized instructions - 129996 bytecodewriter - Number of bytecode bytes written + 7646 bitcodewriter - Number of normal instructions + 725 bitcodewriter - Number of oversized instructions + 129996 bitcodewriter - Number of bitcode bytes written 2817 raise - Number of insts DCEd or constprop'd 3213 raise - Number of cast-of-self removed 5046 raise - Number of expression trees converted @@ -1935,7 +1935,7 @@ recursive types and late resolution of opaque types makes the situation very difficult to handle. Fortunately, for the most part, our implementation makes most clients able to be completely unaware of the nasty internal details. The primary case where clients are exposed to the inner workings of it are when -building a recursive type. In addition to this case, the LLVM bytecode reader, +building a recursive type. In addition to this case, the LLVM bitcode reader, assembly parser, and linker also have to be aware of the inner workings of this system. diff --git a/docs/TestingGuide.html b/docs/TestingGuide.html index f03adaaef64..222ccfb52a9 100644 --- a/docs/TestingGuide.html +++ b/docs/TestingGuide.html @@ -224,10 +224,10 @@ subtrees of the test suite directory tree are as follows:
To test it, follow the example at the end of the Getting Started Guide to compile "Hello World" to -LLVM. We can now run the bytecode file (hello.bc) for the program -through our transformation like this (or course, any bytecode file will +LLVM. We can now run the bitcode file (hello.bc) for the program +through our transformation like this (or course, any bitcode file will work):
@@ -372,7 +372,7 @@ interesting way, we just throw away the result of opt (sending it to $ opt -load ../../../Debug/lib/Hello.so --help OVERVIEW: llvm .bc -> .bc modular optimizer -USAGE: opt [options] <input bytecode> +USAGE: opt [options] <input bitcode> OPTIONS: Optimizations available: @@ -407,7 +407,7 @@ Hello: main Total Execution Time: 0.02 seconds (0.0479059 wall clock) ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Pass Name --- - 0.0100 (100.0%) 0.0000 ( 0.0%) 0.0100 ( 50.0%) 0.0402 ( 84.0%) Bytecode Writer + 0.0100 (100.0%) 0.0000 ( 0.0%) 0.0100 ( 50.0%) 0.0402 ( 84.0%) Bitcode Writer 0.0000 ( 0.0%) 0.0100 (100.0%) 0.0100 ( 50.0%) 0.0031 ( 6.4%) Dominator Set Construction 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0013 ( 2.7%) Module Verifier 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0033 ( 6.9%) Hello World Pass @@ -1413,8 +1413,8 @@ Module Pass Manager Module Verifier -- Dominator Set Construction -- Module Verifier - Bytecode Writer ---Bytecode Writer + Bitcode Writer +--Bitcode Writer
This output shows us when passes are constructed and when the analysis @@ -1454,8 +1454,8 @@ Module Pass Manager Module Verifier -- Dominator Set Construction -- Module Verifier - Bytecode Writer ---Bytecode Writer + Bitcode Writer +--Bitcode Writer Hello: __main Hello: puts Hello: main @@ -1494,8 +1494,8 @@ Module Pass Manager Module Verifier -- Dominator Set Construction -- Module Verifier - Bytecode Writer ---Bytecode Writer + Bitcode Writer +--Bitcode Writer Hello: __main Hello: puts Hello: main