summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lto/LTOCodeGenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Reduce indentation by early exiting.Bill Wendling2012-08-061-34/+34
| | | | llvm-svn: 161356
* Add a way to grab the target options from the LTO command line.Bill Wendling2012-08-061-2/+5
| | | | | | | | | 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> llvm-svn: 161353
* Reinstate -O3 for LTO.David Blaikie2012-05-301-3/+3
| | | | | | | | | | | | | | | | | 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) llvm-svn: 157705
* Remove lto_codegen_set_whole_program_optimization. It is a work in progress,Rafael Espindola2012-04-161-3/+5
| | | | | | | | | 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. llvm-svn: 154807
* Revert the 'EnableInitializing' flag. There is debate on whether we should ↵Bill Wendling2012-04-091-11/+0
| | | | | | run that pass by default in LTO. llvm-svn: 154356
* Apply the scope restrictions after parsing the command line options. There ↵Bill Wendling2012-04-091-3/+3
| | | | | | may be some which are used in that function. llvm-svn: 154348
* Add a hook to turn on the internalize pass through the LTO interface.Bill Wendling2012-04-091-2/+3
| | | | llvm-svn: 154306
* The internalize pass can be dangerous for LTO.Bill Wendling2012-04-051-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> llvm-svn: 154124
* Add an option to turn off the expensive GVN load PRE part of GVN.Bill Wendling2012-04-021-1/+5
| | | | llvm-svn: 153902
* Move trivial functions into the class definition.Bill Wendling2012-03-311-8/+0
| | | | llvm-svn: 153810
* Trim headers.Bill Wendling2012-03-311-7/+0
| | | | llvm-svn: 153809
* Indent according to LLVM's style guide.Bill Wendling2012-03-311-130/+121
| | | | llvm-svn: 153808
* Cleanup whitespace and trim some of the #includes.Bill Wendling2012-03-311-1/+1
| | | | llvm-svn: 153807
* These strings aren't 'const char *' but 'char *'.Bill Wendling2012-03-311-1/+1
| | | | llvm-svn: 153805
* Cleanup whitespace.Bill Wendling2012-03-311-17/+17
| | | | llvm-svn: 153804
* Free the codegen options when deleting LTO code generator object.Bill Wendling2012-03-311-26/+21
| | | | llvm-svn: 153803
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-4/+3
| | | | llvm-svn: 148578
* Move global variables in TargetMachine into new TargetOptions class. As an APINick Lewycky2011-12-021-1/+2
| | | | | | | | | | | | change, now you need a TargetOptions object to create a TargetMachine. Clang patch to follow. One small functionality change in PTX. PTX had commented out the machine verifier parts in their copy of printAndVerify. That now calls the version in LLVMTargetMachine. Users of PTX who need verification disabled should rely on not passing the command-line flag to enable it. llvm-svn: 145714
* Now that the linker supports lazily materialising globals, don'tPeter Collingbourne2011-11-051-4/+0
| | | | | | | | materialise them in LTO. I observed a ~0.5-1% speedup for an LTO link of opt. llvm-svn: 143784
* rename getHostTriple into getDefaultTargetTripleSebastian Pop2011-11-011-1/+1
| | | | llvm-svn: 143502
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-241-2/+2
| | | | | | These are strictly utilities for registering targets and components. llvm-svn: 138450
* Fixed compilation warning on Linux by fixing the type of a return value.John Criswell2011-08-181-1/+1
| | | | llvm-svn: 137913
* Move methods in PassManagerBuilder offline.Rafael Espindola2011-08-021-0/+2
| | | | llvm-svn: 136727
* move PassManagerBuilder.h to IPO. This is a non intuitive place to put it,Rafael Espindola2011-08-021-1/+1
| | | | | | | but it solves a layering violation since things in Support are not supposed to use things in Transforms. llvm-svn: 136726
* Fix typo.Nick Lewycky2011-07-251-1/+1
| | | | llvm-svn: 135971
* Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,Evan Cheng2011-07-221-4/+1
| | | | | | InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC. llvm-svn: 135812
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-201-2/+1
| | | | | | | There is still a bit more refactoring left to do in Targets. But we are now very close to fixing all the layering issues in MC. llvm-svn: 135611
* Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng2011-07-201-1/+1
| | | | | | | | TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! llvm-svn: 135569
* Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng2011-07-191-4/+7
| | | | | | | (including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. llvm-svn: 135468
* Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo downEvan Cheng2011-07-181-1/+4
| | | | | | | | | to MCRegisterInfo. Also initialize the mapping at construction time. This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step towards fixing the layering violation. llvm-svn: 135424
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-1/+1
| | | | llvm-svn: 135375
* Rename createAsmInfo to createMCAsmInfo and move registration code to ↵Evan Cheng2011-07-141-0/+1
| | | | | | MCTargetDesc to prepare for next round of changes. llvm-svn: 135219
* Fix LTO after the recent MC subtarget refactoring.Cameron Zwarich2011-07-111-0/+1
| | | | llvm-svn: 134930
* Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name toEvan Cheng2011-06-301-2/+2
| | | | | | | | | | be the first encoded as the first feature. It then uses the CPU name to look up features / scheduling itineray even though clients know full well the CPU name being used to query these properties. The fix is to just have the clients explictly pass the CPU name! llvm-svn: 134127
* Sink SubtargetFeature and TargetInstrItineraries (renamed ↵Evan Cheng2011-06-291-1/+1
| | | | | | MCInstrItineraries) into MC. llvm-svn: 134049
* switch bugpoint and liblto to PassManagerBuilder.Chris Lattner2011-05-221-8/+6
| | | | llvm-svn: 131821
* Add a lto_codegen_compile_to_file to avoid producing a file, reading it toRafael Espindola2011-03-221-43/+52
| | | | | | memory and writing it back to disk. llvm-svn: 128108
* We don't need a null terminator for the output file.Rafael Espindola2011-03-221-1/+4
| | | | llvm-svn: 128098
* Use lazy parsing in LTO. Unfortunately this is only a 3% time saving forRafael Espindola2011-03-181-0/+4
| | | | | | 'ar'. Have to figure out how to make libLTO even lazier. llvm-svn: 127901
* Add a special streamer to libLTO that just records symbols definitions andRafael Espindola2011-03-021-33/+75
| | | | | | | | | | | uses. The result produced by the streamer is used to give the linker more accurate information and to add to llvm.compiler.used. The second improvement removes the need for the user to add __attribute__((used)) to functions only used in inline asm. The first one lets us build firefox with LTO on Darwin :-) llvm-svn: 126830
* Switch LTO to use MC. This takes the linking of libxul.so from about 7m toRafael Espindola2011-02-241-119/+31
| | | | | | 6m30. llvm-svn: 126426
* Fix some memory leaks and avoid looking in the hash tables twice.Rafael Espindola2011-02-201-3/+4
| | | | | | libxul links in 7m0.403s. llvm-svn: 126085
* Preserve aliases if needed.Rafael Espindola2011-02-121-0/+8
| | | | llvm-svn: 125439
* Fix a silly bug I introduced when dropping std::string.Rafael Espindola2011-02-121-0/+2
| | | | llvm-svn: 125420
* Remove std::string version of getNameWithPrefix.Rafael Espindola2011-02-111-2/+5
| | | | llvm-svn: 125363
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-161-3/+3
| | | | | | via an out parm. llvm-svn: 121958
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-101-1/+1
| | | | llvm-svn: 121471
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-101-1/+1
| | | | llvm-svn: 121461
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-091-1/+1
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). llvm-svn: 121434
* More code not compiled by CMake. :(.Michael J. Spencer2010-12-091-2/+6
| | | | llvm-svn: 121387
OpenPOWER on IntegriCloud