summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetMachine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Move the code that adds the DeadMachineInstructionElimPass fromDan Gohman2008-10-251-0/+5
| | | | | | | | | | | | target-independent code to target-specific code. This prevents it from running on targets that aren't using fast-isel. In addition to saving compile time, this addresses the problem that not all targets are prepared for it. In order to use this pass, all instructions must declare all their fixed uses and defs of physical registers. llvm-svn: 58144
* Teach DAGCombine to fold constant offsets into GlobalAddress nodes,Dan Gohman2008-10-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | and add a TargetLowering hook for it to use to determine when this is legal (i.e. not in PIC mode, etc.) This allows instruction selection to emit folded constant offsets in more cases, such as the included testcase, eliminating the need for explicit arithmetic instructions. This eliminates the need for the C++ code in X86ISelDAGToDAG.cpp that attempted to achieve the same effect, but wasn't as effective. Also, fix handling of offsets in GlobalAddressSDNodes in several places, including changing GlobalAddressSDNode's offset from int to int64_t. The Mips, Alpha, Sparc, and CellSPU targets appear to be unaware of GlobalAddress offsets currently, so set the hook to false on those targets. llvm-svn: 57748
* Fix command-line option printing to print two spaces where needed,Dan Gohman2008-10-141-2/+2
| | | | | | | | | instead of requiring all "short description" strings to begin with two spaces. This makes these strings less mysterious, and it fixes some cases where short description strings mistakenly did not begin with two spaces. llvm-svn: 57521
* Factor out the code for determining when symblic addressesDan Gohman2008-09-261-0/+9
| | | | | | | | | require RIP-relative addressing and use it to fix a bug in X86FastISel in x86-64 PIC mode, where it was trying to use base/index registers with RIP-relative addresses. This fixes a bunch of x86-64 testsuite failures. llvm-svn: 56676
* Reapply 56585:56589 with proper fix for some gcc versionsAnton Korobeynikov2008-09-251-1/+1
| | | | llvm-svn: 56621
* Temporarily backing out 56585:56589 to unbreak the build.Evan Cheng2008-09-251-1/+1
| | | | llvm-svn: 56607
* Use crazy template-based inheritance instead of virtual one.Anton Korobeynikov2008-09-241-1/+1
| | | | llvm-svn: 56585
* Use raw_ostream throughout the AsmPrinter.Owen Anderson2008-08-211-3/+4
| | | | llvm-svn: 55092
* Move X86 assembler printers into separate directory. This allows JIT-only ↵Anton Korobeynikov2008-08-171-5/+17
| | | | | | users not to link it in (use 'x86codegen' llvm-config arg for this) llvm-svn: 54886
* Make x86-64 JIT changes Darwin-specific.Dale Johannesen2008-08-121-5/+11
| | | | llvm-svn: 54700
* Some fixes for x86-64 JIT. Make it use small codeDale Johannesen2008-08-111-3/+5
| | | | | | | | | | | | model, except for external calls; this makes addressing modes PC-relative. Incomplete. The assertion at the top of Emitter::runOnMachineFunction was obviously bogus (always true) so I removed it. If someone knows what the correct test should be to cover all the various targets, please fix. llvm-svn: 54656
* Split X86TargetAsmInfo into 4 subtarget-specific classesAnton Korobeynikov2008-07-091-1/+16
| | | | llvm-svn: 53299
* Remove unnecessary #includes.Dan Gohman2008-06-221-1/+0
| | | | llvm-svn: 52613
* X86CodeEmitter should not set PIC style to None at initialization time. This ↵Evan Cheng2008-05-221-3/+1
| | | | | | will break codegen if relocation model is changed to PIC_ later. llvm-svn: 51455
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-7/+5
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Be over-conservative: scan for all used virtual registers and calculate ↵Anton Korobeynikov2008-04-231-0/+2
| | | | | | maximal stack alignment in assumption, that there will be spill of vector register. llvm-svn: 50167
* Add X86 Maximal Stack Alignment Calculator Pass before RAAnton Korobeynikov2008-04-231-0/+5
| | | | llvm-svn: 50166
* Provide a JIT selector on win64Anton Korobeynikov2008-03-231-1/+1
| | | | llvm-svn: 48704
* Hack out the PIC mode on Win64 targets. This needs to be investigated later.Anton Korobeynikov2008-03-231-1/+3
| | | | llvm-svn: 48703
* Use PassManagerBase instead of FunctionPassManager for functionsDan Gohman2008-03-111-5/+5
| | | | | | | | that merely add passes. This allows them to be used with either FunctionPassManager or PassManager, or even with a custom new kind of pass manager. llvm-svn: 48256
* Added option -align-loops=<true/false> to disable loop aligner pass.Evan Cheng2008-02-281-7/+0
| | | | llvm-svn: 47736
OpenPOWER on IntegriCloud