summaryrefslogtreecommitdiff
path: root/tools/lto
Commit message (Collapse)AuthorAge
...
* Step towards implementation of pass manager with doInitialization and ↵Owen Anderson2012-11-26
| | | | | | | | | doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model Patch by Pedro Artigas, with feedback from by Chandler Carruth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168635 91177308-0d34-0410-b5e6-96231b3b80d8
* libLTO: Add a utility method to initialize the disassemblers.Benjamin Kramer2012-11-24
| | | | | | | | | | | | Necessary to give disassembler users (like darwin's otool) a possibility to dlopen libLTO and still initialize the required LLVM bits. This used to go through libMCDisassembler but that's a gross layering violation, the MC layer can't pull in functions from the targets. Adding a function to libLTO is a bit of a hack but not worse than exposing other disassembler bits from libLTO. Fixes PR14362. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168545 91177308-0d34-0410-b5e6-96231b3b80d8
* Add doInitialization and doFinalization methods to ModulePass's, to allow ↵Owen Anderson2012-11-15
| | | | | | | | | them to be re-initialized and reused on multiple Module's. Patch by Pedro Artigas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168008 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for annotated disassembly output for X86 and arm.Kevin Enderby2012-10-22
| | | | | | | | | | | | Per the October 12, 2012 Proposal for annotated disassembly output sent out by Jim Grosbach this set of changes implements this for X86 and arm. The llvm-mc tool now has a -mdis option to produced the marked up disassembly and a couple of small example test cases have been added. rdar://11764962 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166445 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply the TargerTransformInfo changes, minus the changes to LSR and ↵Nadav Rotem2012-10-18
| | | | | | Lowerinvoke. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166248 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert the TargetTransform changes.Bob Wilson2012-10-18
| | | | | | | | | | | The TargetTransform changes are breaking LTO bootstraps of clang. I am working with Nadav to figure out the problem, but I am reverting it for now to get our buildbots working. This reverts svn commits: 165665 165669 165670 165786 165787 165997 and I have also reverted clang svn 165741 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166168 91177308-0d34-0410-b5e6-96231b3b80d8
* LTO also needs to initialize the TargetTransform infrastructure.Nadav Rotem2012-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165997 91177308-0d34-0410-b5e6-96231b3b80d8
* Set default CPU for Darwin targets with LTO. <rdar://problem/12457841>Bob Wilson2012-10-12
| | | | | | | | This is a temporary hack until Bill's project to record command line options in the LLVM IR is ready. Clang currently sets a default CPU but that isn't recorded anywhere and it doesn't get used in the final LTO compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165809 91177308-0d34-0410-b5e6-96231b3b80d8
* Place temporary LTO files into their own subdirectory.Bill Wendling2012-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165599 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Use a special path to place the .o files in."Bob Wilson2012-10-09
| | | | | | This reverts commit 165428 in an attempt to get our buildbots going. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165574 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a special path to place the .o files in.Bill Wendling2012-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165428 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetData to DataLayout.Micah Villmow2012-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165403 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an explicit -object_path_lto flag during linking with a uniquified temporaryBill Wendling2012-10-03
| | | | | | | file name if building Apple-style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165185 91177308-0d34-0410-b5e6-96231b3b80d8
* Explicitly erase the file from disk if something bad happened. ↵Bill Wendling2012-09-06
| | | | | | <rdar://problem/12184899> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163349 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop casting away const qualifier needlessly.Roman Divacky2012-09-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163258 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the --param ssp-buffer-size= driver option.Chad Rosier2012-08-21
| | | | | | PR9673 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162284 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the `linker_private_weak_def_auto' linkage to `linkonce_odr_auto_hide' toBill Wendling2012-08-17
| | | | | | | | | | | | | | | | | | | | | make it more consistent with its intended semantics. The `linker_private_weak_def_auto' linkage type was meant to automatically hide globals which never had their addresses taken. It has nothing to do with the `linker_private' linkage type, which outputs the symbols with a `l' (ell) prefix among other things. The intended semantic is more like the `linkonce_odr' linkage type. Change the name of the linkage type to `linkonce_odr_auto_hide'. And therefore changing the semantics so that it produces the correct output for the linker. Note: The old linkage name `linker_private_weak_def_auto' will still parse but is not a synonym for `linkonce_odr_auto_hide'. This should be removed in 4.0. <rdar://problem/11754934> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162114 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some coding violations. No functionality change.Bill Wendling2012-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161530 91177308-0d34-0410-b5e6-96231b3b80d8
* Cache a commonly used reference.Bill Wendling2012-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161529 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce indentation by early exiting.Bill Wendling2012-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161356 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a way to grab the target options from the LTO command line.Bill Wendling2012-08-06
| | | | | | | | | | When the command line target options were removed from the LLVM libraries, LTO lost its ability to specify things like `-disable-fp-elim'. Add this back by adding the command line variables to the `lto' project. <rdar://problem/12038729> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161353 91177308-0d34-0410-b5e6-96231b3b80d8
* Forgot this patch in r159023.Evan Cheng2012-06-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159028 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused private fields found by clang's new -Wunused-private-field.Benjamin Kramer2012-06-06
| | | | | | | | There are some that I didn't remove this round because they looked like obvious stubs. There are dead variables in gtest too, they should be fixed upstream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158090 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate -O3 for LTO.David Blaikie2012-05-30
| | | | | | | | | | | | | | | | | This broke in r144788 when the CodeGenOpt option was moved from everywhere else (specifically, from addPassesToEmitFile) to createTargetMachine. Since LTOCodeGenerator wasn't passing the 4th argument, when the 4th parameter became the 3rd, it silently continued to compile (int->bool conversion) but meant something completely different. This change preserves the existing (accidental) and previous (default) semantics of the addPassesToEmitFile and restores the previous/intended CodeGenOpt argument by passing it appropriately to createTargetMachine. (discovered by pending changes to -Wconversion to catch constant->bool conversions) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157705 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a use after free when the streamer is destroyed. Fixes pr12622.Rafael Espindola2012-05-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156606 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove lto_codegen_set_whole_program_optimization. It is a work in progress,Rafael Espindola2012-04-16
| | | | | | | | | so we don't want it to show up in the stable 3.1 interface. While at it, add a comment about why LTOCodeGenerator manually creates the internalize pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154807 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the 'EnableInitializing' flag. There is debate on whether we should ↵Bill Wendling2012-04-09
| | | | | | run that pass by default in LTO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154356 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply the scope restrictions after parsing the command line options. There ↵Bill Wendling2012-04-09
| | | | | | may be some which are used in that function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154348 91177308-0d34-0410-b5e6-96231b3b80d8
* s/lto_codegen_whole_program_optimization/lto_codegen_set_whole_program_optim ↵Bill Wendling2012-04-09
| | | | | | ization/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154312 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a hook to turn on the internalize pass through the LTO interface.Bill Wendling2012-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154306 91177308-0d34-0410-b5e6-96231b3b80d8
* The internalize pass can be dangerous for LTO.Bill Wendling2012-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the following program: $ cat main.c void foo(void) { } int main(int argc, char *argv[]) { foo(); return 0; } $ cat bundle.c extern void foo(void); void bar(void) { foo(); } $ clang -o main main.c $ clang -o bundle.so bundle.c -bundle -bundle_loader ./main $ nm -m bundle.so 0000000000000f40 (__TEXT,__text) external _bar (undefined) external _foo (from executable) (undefined) external dyld_stub_binder (from libSystem) $ clang -o main main.c -O4 $ clang -o bundle.so bundle.c -bundle -bundle_loader ./main Undefined symbols for architecture x86_64: "_foo", referenced from: _bar in bundle-elQN6d.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) The linker was told that the 'foo' in 'main' was 'internal' and had no uses, so it was dead stripped. Another situation is something like: define void @foo() { ret void } define void @bar() { call asm volatile "call _foo" ... ret void } The only use of 'foo' is inside of an inline ASM call. Since we don't look inside those for uses of functions, we don't specify this as a "use." Get around this by not invoking the 'internalize' pass by default. This is an admitted hack for LTO correctness. <rdar://problem/11185386> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154124 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformatting. No functionality change.Bill Wendling2012-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153928 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option to turn off the expensive GVN load PRE part of GVN.Bill Wendling2012-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153902 91177308-0d34-0410-b5e6-96231b3b80d8
* Hack the hack. If we have a situation where an ASM object is defined but isn'tBill Wendling2012-04-02
| | | | | | | | | | | reflected in the LLVM IR (as a declare or something), then treat it like a data object. N.B. This isn't 100% correct. The ASM parser should supply more information so that we know what type of object it is, and what attributes it should have. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153870 91177308-0d34-0410-b5e6-96231b3b80d8
* It could come about that we parse the inline ASM before we get a potentialBill Wendling2012-04-02
| | | | | | | | definition for it. In that case, we want to wait for the potential definition before we create a symbol for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153859 91177308-0d34-0410-b5e6-96231b3b80d8
* Move trivial functions into the class definition.Bill Wendling2012-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153810 91177308-0d34-0410-b5e6-96231b3b80d8
* Trim headers.Bill Wendling2012-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153809 91177308-0d34-0410-b5e6-96231b3b80d8
* Indent according to LLVM's style guide.Bill Wendling2012-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153808 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup whitespace and trim some of the #includes.Bill Wendling2012-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153807 91177308-0d34-0410-b5e6-96231b3b80d8
* These strings aren't 'const char *' but 'char *'.Bill Wendling2012-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153805 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup whitespace.Bill Wendling2012-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153804 91177308-0d34-0410-b5e6-96231b3b80d8
* Free the codegen options when deleting LTO code generator object.Bill Wendling2012-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153803 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup whitespace and remove unneeded 'extern' keyword on function definitions.Bill Wendling2012-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153802 91177308-0d34-0410-b5e6-96231b3b80d8
* * Set the scope attributes for the ASM symbol we added to be the value passedBill Wendling2012-03-30
| | | | | | | | into the function. * Reorder some header files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153783 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup whitespace. Doxygenize comments. And indent to llvm coding standards.Bill Wendling2012-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153740 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some headway towards compiling all of LLVM.Bill Wendling2012-03-29
| | | | | | | | | | | | | | | | | | Module-level ASM may contain definitions of functions and globals. However, we were not telling the linker that these globals had definitions. As far as it was concerned, they were just declarations. Attempt to resolve this by inserting module-level ASM functions and globals into the '_symbol' set so that the linker will know that they have values. This gets us further towards our goal of compiling LLVM, but it still has problems when linking libLTO.dylib because of the `-dead_strip' flag that's passed to the linker. <rdar://problem/11124216> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153638 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup whitespace.Bill Wendling2012-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153634 91177308-0d34-0410-b5e6-96231b3b80d8
* Cache the end() iterator.Bill Wendling2012-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153632 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup some whitespaces.Bill Wendling2012-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153612 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline function into its one caller.Bill Wendling2012-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153598 91177308-0d34-0410-b5e6-96231b3b80d8