summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetMachine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Pass StringRef by value.Daniel Dunbar2009-11-061-2/+1
| | | | llvm-svn: 86251
* llvm-mc/X86: Implement single instruction encoding interface for MC.Daniel Dunbar2009-08-271-0/+4
| | | | | | | | | | | | - Note, this is a gigantic hack, with the sole purpose of unblocking further work on the assembler (its also possible to test the mathcer more completely now). - Despite being a hack, its actually good enough to work over all of 403.gcc (although some encodings are probably incorrect). This is a testament to the beauty of X86's MachineInstr, no doubt! ;) llvm-svn: 80234
* rename COFFMCAsmInfo -> MCAsmInfoCOFF, likewise for darwin.Chris Lattner2009-08-221-2/+2
| | | | llvm-svn: 79773
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-8/+8
| | | | llvm-svn: 79763
* Change TargetAsmInfo to be constructed via TargetRegistry from a Target+TripleChris Lattner2009-08-121-14/+21
| | | | | | | | pair instead of from a virtual method on TargetMachine. This cuts the final ties of TargetAsmInfo to TargetMachine, meaning that MC can now use TargetAsmInfo. llvm-svn: 78802
* pass the TargetTriple down from each target ctor to theChris Lattner2009-08-111-1/+1
| | | | | | LLVMTargetMachine ctor. It is currently unused. llvm-svn: 78711
* remove a random reference to subtarget. Even without this, weChris Lattner2009-08-041-2/+0
| | | | | | | still get "intel syntax" instructions from llc with -x86-asm-syntax=intel llvm-svn: 78103
* Unbreak Win64 CC. Step one: honour register save area, fix some alignment ↵Anton Korobeynikov2009-08-031-1/+3
| | | | | | and provide a different set of call-clobberred registers. llvm-svn: 77962
* Move most targets TargetMachine constructor to only taking a target triple.Daniel Dunbar2009-08-021-7/+6
| | | | | | - The C, C++, MSIL, and Mips backends still need the module. llvm-svn: 77927
* Normalize Subtarget constructors to take a target triple string instead ofDaniel Dunbar2009-08-021-1/+1
| | | | | | | | | | Module*. Also, dropped uses of TargetMachine where unnecessary. The only target which still takes a TargetMachine& is Mips, I would appreciate it if someone would normalize this to match other targets. llvm-svn: 77918
* Rip all of the global variable lowering logic out of TargetAsmInfo. SinceChris Lattner2009-07-281-14/+12
| | | | | | | | | | | | | | | | | | | | it is highly specific to the object file that will be generated in the end, this introduces a new TargetLoweringObjectFile interface that is implemented for each of ELF/MachO/COFF/Alpha/PIC16 and XCore. Though still is still a brutal and ugly refactoring, this is a major step towards goodness. This patch also: 1. fixes a bunch of dangling pointer problems in the PIC16 backend. 2. disables the TargetLowering copy ctor which PIC16 was accidentally using. 3. gets us closer to xcore having its own crazy target section flags and pic16 not having to shadow sections with its own objects. 4. fixes wierdness where ELF targets would set CStringSection but not CStringSection_. Factor the code better. 5. fixes some bugs in string lowering on ELF targets. llvm-svn: 77294
* Add new helpers for registering targets.Daniel Dunbar2009-07-251-10/+4
| | | | | | - Less boilerplate == good. llvm-svn: 77052
* Put Target definitions inside Target specific header, and llvm namespace.Daniel Dunbar2009-07-181-2/+0
| | | | llvm-svn: 76344
* Kill off <TARGET>MachineModule variables, and <TARGETASMPRINTER>ForceLinkDaniel Dunbar2009-07-161-7/+0
| | | | | | | variables. - Module initialization functions supplanted the need for these. llvm-svn: 75886
* Lift addAssemblyEmitter into LLVMTargetMachine.Daniel Dunbar2009-07-151-11/+0
| | | | | | - No functionality change. llvm-svn: 75859
* Lift DumpAsm / -print-emitted-asm functionality into LLVMTargetMachine.Daniel Dunbar2009-07-151-22/+0
| | | | | | - No intended functionality change. llvm-svn: 75848
* Remove old style hacks to register AsmPrinter into TargetMachine.Daniel Dunbar2009-07-151-6/+4
| | | | | | - No intended functionality change. llvm-svn: 75843
* Reapply TargetRegistry refactoring commits.Daniel Dunbar2009-07-151-68/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --- Reverse-merging r75799 into '.': U test/Analysis/PointerTracking U include/llvm/Target/TargetMachineRegistry.h U include/llvm/Target/TargetMachine.h U include/llvm/Target/TargetRegistry.h U include/llvm/Target/TargetSelect.h U tools/lto/LTOCodeGenerator.cpp U tools/lto/LTOModule.cpp U tools/llc/llc.cpp U lib/Target/PowerPC/PPCTargetMachine.h U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp U lib/Target/PowerPC/PPCTargetMachine.cpp U lib/Target/PowerPC/PPC.h U lib/Target/ARM/ARMTargetMachine.cpp U lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp U lib/Target/ARM/ARMTargetMachine.h U lib/Target/ARM/ARM.h U lib/Target/XCore/XCoreTargetMachine.cpp U lib/Target/XCore/XCoreTargetMachine.h U lib/Target/PIC16/PIC16TargetMachine.cpp U lib/Target/PIC16/PIC16TargetMachine.h U lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp U lib/Target/Alpha/AlphaTargetMachine.cpp U lib/Target/Alpha/AlphaTargetMachine.h U lib/Target/X86/X86TargetMachine.h U lib/Target/X86/X86.h U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h U lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h U lib/Target/X86/X86TargetMachine.cpp U lib/Target/MSP430/MSP430TargetMachine.cpp U lib/Target/MSP430/MSP430TargetMachine.h U lib/Target/CppBackend/CPPTargetMachine.h U lib/Target/CppBackend/CPPBackend.cpp U lib/Target/CBackend/CTargetMachine.h U lib/Target/CBackend/CBackend.cpp U lib/Target/TargetMachine.cpp U lib/Target/IA64/IA64TargetMachine.cpp U lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp U lib/Target/IA64/IA64TargetMachine.h U lib/Target/IA64/IA64.h U lib/Target/MSIL/MSILWriter.cpp U lib/Target/CellSPU/SPUTargetMachine.h U lib/Target/CellSPU/SPU.h U lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp U lib/Target/CellSPU/SPUTargetMachine.cpp U lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp U lib/Target/Mips/MipsTargetMachine.cpp U lib/Target/Mips/MipsTargetMachine.h U lib/Target/Mips/Mips.h U lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp U lib/Target/Sparc/SparcTargetMachine.cpp U lib/Target/Sparc/SparcTargetMachine.h U lib/ExecutionEngine/JIT/TargetSelect.cpp U lib/Support/TargetRegistry.cpp llvm-svn: 75820
* Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to ↵Stuart Hastings2009-07-151-18/+68
| | | | | | | | repair broken LLVM-GCC build. Will revert 75770 in the llvm-gcc trunk. llvm-svn: 75799
* Replace large swaths of copy-n-paste code with obvious helper function...Daniel Dunbar2009-07-151-30/+12
| | | | | | | | | | | | | | | | | | | | | | | - Which was already present in the module! - I skipped this xform for Alpha, since it runs an extra pass during assembly emission, but not when emitting assembly via the DumpAsm flag. - No functionality change. -- ddunbar@giles:llvm$ svn diff | grep '^- ' | sort | uniq -c 18 - PM.add(AsmPrinterCtor(ferrs(), *this, true)); 18 - assert(AsmPrinterCtor && "AsmPrinter was not linked in"); 18 - if (AsmPrinterCtor) 18 - if (DumpAsm) { 18 - } ddunbar@giles:llvm$ svn diff | grep '^+ ' | sort | uniq -c 18 + addAssemblyEmitter(PM, OptLevel, true, ferrs()); 18 + if (DumpAsm) -- llvm-svn: 75782
* Kill off old (TargetMachine level, not Target level) match quality functions.Daniel Dunbar2009-07-151-58/+0
| | | | llvm-svn: 75780
* Provide TargetMachine implementations with reference to Target they were createdDaniel Dunbar2009-07-151-7/+10
| | | | | | | | from. - This commit is almost entirely propogating the reference through the TargetMachine subclasses' constructor calls. llvm-svn: 75778
* Register Target's TargetMachine and AsmPrinter in the new registry.Daniel Dunbar2009-07-151-3/+8
| | | | | | | - This abuses TargetMachineRegistry's constructor for now, this will get cleaned up in time. llvm-svn: 75762
* Have asm printers use formatted_raw_ostream directly to avoid aDavid Greene2009-07-141-8/+8
| | | | | | dynamic_cast<>. llvm-svn: 75670
* make PIC vs DynamicNoPIC be explicit in PICStyles.Chris Lattner2009-07-101-2/+6
| | | | llvm-svn: 75275
* isPICStyleRIPRel() and friends are never true in -static mode.Chris Lattner2009-07-091-5/+8
| | | | | | Simplify code based on this. llvm-svn: 75099
* .o file writing shouldn't mess around with pic/relo models like the JIT does.Chris Lattner2009-07-091-18/+0
| | | | llvm-svn: 75096
* move a hack out of the asm-printer specific path to the main target ↵Chris Lattner2009-07-091-12/+17
| | | | | | selection path. llvm-svn: 75095
* many more cleanups, for example if in the "none" pic-style,Chris Lattner2009-07-091-26/+26
| | | | | | | make sure we're set to static codegen. Simplify the decision tree of target->picstyle/picmode settings. llvm-svn: 75094
* When in -static mode, force the PIC style to none. Doing this requires fixingChris Lattner2009-07-091-3/+11
| | | | | | | code which conflated RIPRel PIC with x86-64. Fix these to just check for X86-64 directly. llvm-svn: 75092
* Add the Object Code Emitter class. Original patch by Aaron Gray, I did someBruno Cardoso Lopes2009-07-061-0/+43
| | | | | | cleanup, removed some #includes and moved Object Code Emitter out-of-line. llvm-svn: 74813
* Remove unused AsmPrinter OptLevel argument, and propogate.Daniel Dunbar2009-07-011-5/+5
| | | | | | | - This more or less amounts to a revert of r65379. I'm curious to know what happened that caused this variable to become unused. llvm-svn: 74579
* simplify some code and eliminate the symbolicAddressesAreRIPRel() predicate.Chris Lattner2009-06-271-8/+0
| | | | llvm-svn: 74377
* Reimplement rip-relative addressing in the X86-64 backend. The newChris Lattner2009-06-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implementation primarily differs from the former in that the asmprinter doesn't make a zillion decisions about whether or not something will be RIP relative or not. Instead, those decisions are made by isel lowering and propagated through to the asm printer. To achieve this, we: 1. Represent RIP relative addresses by setting the base of the X86 addr mode to X86::RIP. 2. When ISel Lowering decides that it is safe to use RIP, it lowers to X86ISD::WrapperRIP. When it is unsafe to use RIP, it lowers to X86ISD::Wrapper as before. 3. This removes isRIPRel from X86ISelAddressMode, representing it with a basereg of RIP instead. 4. The addressing mode matching logic in isel is greatly simplified. 5. The asmprinter is greatly simplified, notably the "NotRIPRel" predicate passed through various printoperand routines is gone now. 6. The various symbol printing routines in asmprinter now no longer infer when to emit (%rip), they just print the symbol. I think this is a big improvement over the previous situation. It does have two small caveats though: 1. I implemented a horrible "no-rip" modifier for the inline asm "P" constraint modifier. This is a short term hack, there is a much better, but more involved, solution. 2. I had to xfail an -aggressive-remat testcase because it isn't handling the use of RIP in the constant-pool reading instruction. This specific test is easy to fix without -aggressive-remat, which I intend to do next. llvm-svn: 74372
* Provide InitializeAllTargets and InitializeNativeTarget functions in theBob Wilson2009-06-231-4/+2
| | | | | | | | C bindings. Change all the backend "Initialize" functions to have C linkage. Change the "llvm/Config/Targets.def" header to use C-style comments to avoid compile warnings. llvm-svn: 74026
* Introduce new headers whose inclusion forces linking andDouglas Gregor2009-06-161-0/+5
| | | | | | | | | initialization of all targets (InitializeAllTargets.h) or assembler printers (InitializeAllAsmPrinters.h). This is a step toward the elimination of relinked object files, so that we can build normal archives. llvm-svn: 73543
* Support for ELF VisibilityBruno Cardoso Lopes2009-06-111-2/+1
| | | | | | | | Emission for globals, using the correct data sections Function alignment can be computed for each target using TargetELFWriterInfo Some small fixes llvm-svn: 73201
* x86_64 now uses the correct ELF e_machine typeBruno Cardoso Lopes2009-06-061-1/+2
| | | | llvm-svn: 72986
* For Darwin / x86_64, override -relocation-model=static to pic if the output ↵Evan Cheng2009-06-031-0/+7
| | | | | | | | is assembly since Darwin assembler does not really support -static codeine. I view this as a temporary workaround until the assembler / linker changes. llvm-svn: 72806
* Fix new CodeEmitter stuff to follow LLVM codying style. Patch by Aaron GrayBruno Cardoso Lopes2009-06-011-3/+5
| | | | llvm-svn: 72697
* First patch in the direction of splitting MachineCodeEmitter in two subclasses:Bruno Cardoso Lopes2009-05-301-0/+43
| | | | | | JITCodeEmitter and ObjectCodeEmitter. No functional changes yet. Patch by Aaron Gray llvm-svn: 72631
* Instead of passing in an unsigned value for the optimization level, use an enum,Bill Wendling2009-04-291-6/+11
| | | | | | | which better identifies what the optimization is doing. And is more flexible for future uses. llvm-svn: 70440
* Second attempt:Bill Wendling2009-04-291-12/+15
| | | | | | | | | | | | Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to use the old behavior, the flag is -O0. This change allows for finer-grained control over which optimizations are run at different -O levels. Most of this work was pretty mechanical. The majority of the fixes came from verifying that a "fast" variable wasn't used anymore. The JIT still uses a "Fast" flag. I'll change the JIT with a follow-up patch. llvm-svn: 70343
* r70270 isn't ready yet. Back this out. Sorry for the noise.Bill Wendling2009-04-281-15/+12
| | | | llvm-svn: 70275
* Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want toBill Wendling2009-04-281-12/+15
| | | | | | | | | | | use the old behavior, the flag is -O0. This change allows for finer-grained control over which optimizations are run at different -O levels. Most of this work was pretty mechanical. The majority of the fixes came from verifying that a "fast" variable wasn't used anymore. The JIT still uses a "Fast" flag. I'm not 100% sure if it's necessary to change it there... llvm-svn: 70270
* CodeGen still defaults to non-verbose asm, but llc now overrides it and ↵Evan Cheng2009-03-251-4/+4
| | | | | | default to verbose. llvm-svn: 67668
* Overhaul my earlier submission due to feedback. It's a large patch, but most ofBill Wendling2009-02-241-3/+3
| | | | | | | | | | | | them are generic changes. - Use the "fast" flag that's already being passed into the asm printers instead of shoving it into the DwarfWriter. - Instead of calling "MI->getParent()->getParent()" for every MI, set the machine function when calling "runOnMachineFunction" in the asm printers. llvm-svn: 65379
* Make a comment a doxygen comment.Dan Gohman2009-02-071-4/+4
| | | | llvm-svn: 63988
* Fix build with gcc-4.4: it doesn't like PICStyleDuncan Sands2008-11-281-5/+5
| | | | | | being both a namespace and a variable name. llvm-svn: 60208
* Move the code that inserts X87 FP_REG_KILL instructions from aDan Gohman2008-11-121-0/+3
| | | | | | | | special-purpose hook to a new pass. Also, add check to see if any x87 virtual registers are used, to avoid doing any work in the common case that no x87 code is needed. llvm-svn: 59190
OpenPOWER on IntegriCloud