summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change createPostRAScheduler so it can be turned off at llc -O1.Evan Cheng2009-10-161-1/+1
| | | | llvm-svn: 84273
* Add a target hook to add pre- post-regalloc scheduling passes.Evan Cheng2009-09-301-0/+4
| | | | llvm-svn: 83144
* Remove -post-RA-schedule flag and add a TargetSubtarget method to enable ↵David Goodwin2009-09-301-9/+1
| | | | | | post-register-allocation scheduling. By default it is off. For ARM, enable/disable with -mattr=+/-postrasched. Enable by default for cortex-a8. llvm-svn: 83122
* Flip -disable-post-RA-scheduler to -post-RA-scheduler.Evan Cheng2009-09-251-5/+7
| | | | llvm-svn: 82803
* Add a new pass for doing late hoisting of floating-point and vectorDan Gohman2009-09-161-1/+6
| | | | | | | | | | | constants out of loops. These aren't covered by the regular LICM pass, because in LLVM IR constants don't require separate instructions. They're not always covered by the MachineLICM pass either, because it doesn't know how to unfold folded constant-pool loads. This is somewhat experimental at this point, and off by default. llvm-svn: 82076
* -fast is now -O0. -fast-isel is no longer experimental.Dan Gohman2009-08-261-2/+2
| | | | llvm-svn: 80104
* remove std::ostream versions of printing stuff for MBB and MF,Chris Lattner2009-08-231-6/+6
| | | | | | upgrading a few things to use raw_ostream llvm-svn: 79811
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-3/+3
| | | | llvm-svn: 79763
* Move the sjlj exception handling conversions to a back-end pass where theyJim Grosbach2009-08-171-1/+4
| | | | | | | | | more properly belong. This allows removing the front-end conditionalized SJLJ code, and cleans up the generated IR considerably. All of the infrastructure code (calling _Unwind_SjLj_Register/Unregister, etc) is added by the SjLjEHPrepare pass. llvm-svn: 79250
* Allow double defs in the machine code verifier after the addPreRegAlloc passes.Jakob Stoklund Olesen2009-08-151-1/+1
| | | | llvm-svn: 79095
* TargetRegistry: Change AsmPrinter constructor to be typed as returning anDaniel Dunbar2009-08-131-0/+1
| | | | | | AsmPrinter instance (instead of just a FunctionPass) llvm-svn: 78962
* TargetRegistry: Reorganize AsmPrinter construction so that clients pass in theDaniel Dunbar2009-08-131-1/+2
| | | | | | | | | TargetAsmInfo. This eliminates a dependency on TargetMachine.h from TargetRegistry.h, which technically was a layering violation. - Clients probably can only sensibly pass in the same TargetAsmInfo as the TargetMachine has, but there are only limited clients of this API. llvm-svn: 78928
* Change TargetAsmInfo to be constructed via TargetRegistry from a Target+TripleChris Lattner2009-08-121-0/+9
| | | | | | | | 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
* Tidy #includes.Dan Gohman2009-08-111-1/+0
| | | | llvm-svn: 78677
* SjLj based exception handling unwinding support. This patch is nasty, brutishJim Grosbach2009-08-111-3/+10
| | | | | | | | | | | | | and short. Well, it's kinda short. Definitely nasty and brutish. The front-end generates the register/unregister calls into the SjLj runtime, call-site indices and landing pad dispatch. The back end fills in the LSDA with the call-site information provided by the front end. Catch blocks are not yet implemented. Built on Darwin and verified no llvm-core "make check" regressions. llvm-svn: 78625
* Disable stack coloring with register for now. It's not able to set kill markers.Evan Cheng2009-08-051-1/+3
| | | | llvm-svn: 78179
* Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsageDan Gohman2009-07-311-15/+4
| | | | | | | | shouldn't do AU.setPreservesCFG(), because even though CodeGen passes don't modify the LLVM IR CFG, they may modify the MachineFunction CFG, and passes like MachineLoop are registered with isCFGOnly set to true. llvm-svn: 77691
* Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and manyDaniel Dunbar2009-07-311-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | failures when building assorted projects with clang. --- Reverse-merging r77654 into '.': U include/llvm/CodeGen/Passes.h U include/llvm/CodeGen/MachineFunctionPass.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/LazyLiveness.h U include/llvm/CodeGen/SelectionDAGISel.h D include/llvm/CodeGen/MachineFunctionAnalysis.h U include/llvm/Function.h U lib/Target/CellSPU/SPUISelDAGToDAG.cpp U lib/Target/PowerPC/PPCISelDAGToDAG.cpp U lib/CodeGen/LLVMTargetMachine.cpp U lib/CodeGen/MachineVerifier.cpp U lib/CodeGen/MachineFunction.cpp U lib/CodeGen/PrologEpilogInserter.cpp U lib/CodeGen/MachineLoopInfo.cpp U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp D lib/CodeGen/MachineFunctionAnalysis.cpp D lib/CodeGen/MachineFunctionPass.cpp U lib/CodeGen/LiveVariables.cpp llvm-svn: 77661
* Manage MachineFunctions with an analysis Pass instead of the AnnotableDan Gohman2009-07-311-15/+4
| | | | | | | mechanism. To support this, make MachineFunctionPass a little more complete. llvm-svn: 77654
* We don't need to use llvm_report_error, this interface can deal with errorsDaniel Dunbar2009-07-151-2/+2
| | | | | | (although we don't get a very good error message). llvm-svn: 75864
* Add missing includes.Daniel Dunbar2009-07-151-0/+2
| | | | llvm-svn: 75862
* Lift addAssemblyEmitter into LLVMTargetMachine.Daniel Dunbar2009-07-151-0/+11
| | | | | | - No functionality change. llvm-svn: 75859
* Lift DumpAsm / -print-emitted-asm functionality into LLVMTargetMachine.Daniel Dunbar2009-07-151-5/+15
| | | | | | - No intended functionality change. llvm-svn: 75848
* Have asm printers use formatted_raw_ostream directly to avoid aDavid Greene2009-07-141-2/+2
| | | | | | dynamic_cast<>. llvm-svn: 75670
* Revert an accidental commit.Evan Cheng2009-07-131-1/+1
| | | | llvm-svn: 75553
* Add the Object Code Emitter class. Original patch by Aaron Gray, I did someBruno Cardoso Lopes2009-07-061-0/+17
| | | | | | cleanup, removed some #includes and moved Object Code Emitter out-of-line. llvm-svn: 74813
* Add a ARM specific pre-allocation pass that re-schedule loads / stores fromEvan Cheng2009-06-131-1/+1
| | | | | | | | | | | consecutive addresses togther. This makes it easier for the post-allocation pass to form ldm / stm. This is step 1. We are still missing a lot of ldm / stm opportunities because of register allocation are not done in the desired order. More enhancements coming. llvm-svn: 73291
* 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
* Add a new codegen pass that normalizes dwarf exception handlingDuncan Sands2009-05-221-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code in preparation for code generation. The main thing it does is handle the case when eh.exception calls (and, in a future patch, eh.selector calls) are far away from landing pads. Right now in practice you only find eh.exception calls close to landing pads: either in a landing pad (the common case) or in a landing pad successor, due to loop passes shifting them about. However future exception handling improvements will result in calls far from landing pads: (1) Inlining of rewinds. Consider the following case: In function @f: ... invoke @g to label %normal unwind label %unwinds ... unwinds: %ex = call i8* @llvm.eh.exception() ... In function @g: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... "rethrow exception" Now inline @g into @f. Currently this is turned into: In function @f: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... invoke "rethrow exception" to label %normal unwind label %unwinds unwinds: %ex = call i8* @llvm.eh.exception() ... However we would like to simplify invoke of "rethrow exception" into a branch to the %unwinds label. Then %unwinds is no longer a landing pad, and the eh.exception call there is then far away from any landing pads. (2) Using the unwind instruction for cleanups. It would be nice to have codegen handle the following case: invoke @something to label %continue unwind label %run_cleanups ... handler: ... perform cleanups ... unwind This requires turning "unwind" into a library call, which necessarily takes a pointer to the exception as an argument (this patch also does this unwind lowering). But that means you are using eh.exception again far from a landing pad. (3) Bugpoint simplifications. When bugpoint is simplifying exception handling code it often generates eh.exception calls far from a landing pad, which then causes codegen to assert. Bugpoint then latches on to this assertion and loses sight of the original problem. Note that it is currently rare for this pass to actually do anything. And in fact it normally shouldn't do anything at all given the code coming out of llvm-gcc! But it does fire a few times in the testsuite. As far as I can see this is almost always due to the LoopStrengthReduce codegen pass introducing pointless loop preheader blocks which are landing pads and only contain a branch to another block. This other block contains an eh.exception call. So probably by tweaking LoopStrengthReduce a bit this can be avoided. llvm-svn: 72276
* Pass to verify generated machine code.Jakob Stoklund Olesen2009-05-161-27/+26
| | | | | | | | | | | | | | | | | | | The following is checked: * Operand counts: All explicit operands must be present. * Register classes: All physical and virtual register operands must be compatible with the register class required by the instruction descriptor. * Register live intervals: Registers must be defined only once, and must be defined before use. The machine code verifier is enabled with the command-line option '-verify-machineinstrs', or by defining the environment variable LLVM_VERIFY_MACHINEINSTRS to the name of a file that will receive all the verifier errors. llvm-svn: 71918
* Fixed a stack slot coloring with reg bug: do not update implicit use / def ↵Evan Cheng2009-05-121-2/+1
| | | | | | when doing forward / backward propagation. llvm-svn: 71574
* Rename "loop aligner" pass to "code placement optimization" pass.Evan Cheng2009-05-071-1/+1
| | | | llvm-svn: 71150
* Just turn aggressive stack coloring off at -O3.Bill Wendling2009-05-071-1/+2
| | | | llvm-svn: 71140
* Temporarily revert r71010. It was causing massive failures during self-hosting.Bill Wendling2009-05-071-1/+1
| | | | llvm-svn: 71138
* Enable stack coloring with regs at -O3.Evan Cheng2009-05-051-1/+1
| | | | llvm-svn: 71010
* Instead of passing in an unsigned value for the optimization level, use an enum,Bill Wendling2009-04-291-14/+14
| | | | | | | which better identifies what the optimization is doing. And is more flexible for future uses. llvm-svn: 70440
* Second attempt:Bill Wendling2009-04-291-22/+23
| | | | | | | | | | | | 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-23/+22
| | | | llvm-svn: 70275
* Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want toBill Wendling2009-04-281-22/+23
| | | | | | | | | | | 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-1/+1
| | | | | | default to verbose. llvm-svn: 67668
* Re-enable machine sinking pass now that the coalescer bugs and the ↵Evan Cheng2009-02-091-8/+2
| | | | | | AnalyzeBrnach bug are fixed. llvm-svn: 64126
* Revert r63999. It was breaking self-hosting builds.Bill Wendling2009-02-081-2/+8
| | | | llvm-svn: 64062
* Enable machine sinking pass in non-fast mode.Evan Cheng2009-02-071-8/+2
| | | | llvm-svn: 63999
* Turn on machine LICM in non-fast mode.Evan Cheng2009-02-051-5/+1
| | | | llvm-svn: 63855
* Move post-RA scheduling before branch folding for now, because branchDan Gohman2008-12-181-7/+7
| | | | | | | folding's tail merging doesn't currently preserve liveness information which post-RA scheduling requires. llvm-svn: 61183
* Run post-RA scheduling after branch folding, as it tends toDan Gohman2008-11-241-4/+7
| | | | | | obscure tail-merging opportunities. llvm-svn: 59967
* Add another machine-code printing pass when post-pass scheduling is run.Dan Gohman2008-11-201-1/+5
| | | | llvm-svn: 59746
* Implement stack protectors as function attributes: "ssp" and "sspreq".Bill Wendling2008-11-131-15/+1
| | | | llvm-svn: 59202
* Update in response to feedback from Chris:Bill Wendling2008-11-041-4/+13
| | | | | | | | | | | | | | | | | - Use enums instead of magic numbers. - Rework algorithm to use the bytes size from the target to determine when to emit stack protectors. - Get rid of "propolice" in any comments. - Renamed an option to its expanded form. - Other miscellanenous changes. More changes will come after this. llvm-svn: 58723
* Initial checkin for stack protectors. Here's what it does:Bill Wendling2008-11-041-0/+7
| | | | | | | | | | | | | | | | * The prologue is modified to read the __stack_chk_guard global and insert it onto the stack. * The epilogue is modified to read the stored guard from the stack and compare it to the original __stack_chk_guard value. If they differ, then the __stack_chk_fail() function is called. * The stack protector needs to be first on the stack (after the parameters) to catch any stack-smashing activities. Front-end support will follow after a round of beta testing. llvm-svn: 58673
OpenPOWER on IntegriCloud