summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Split tail duplication into a separate pass. This is needed to avoidBob Wilson2009-11-261-0/+8
| | | | | | | | | running tail duplication when doing branch folding for if-conversion, and we also want to be able to run tail duplication earlier to fix some reg alloc problems. Move the CanFallThrough function from BranchFolding to MachineBasicBlock so that it can be shared by TailDuplication. llvm-svn: 89904
* Remove DebugLabelFolder pass. It is not used by dwarf writer anymore.Devang Patel2009-11-241-4/+0
| | | | llvm-svn: 89790
* Add an experimental option to run gep-splitting and no-load GVNDan Gohman2009-11-201-0/+11
| | | | | | just before codegen. llvm-svn: 89439
* Now that code placement optimization pass is run for JIT, make sure it's ↵Evan Cheng2009-11-051-3/+3
| | | | | | before pre-emit passes. llvm-svn: 86092
* Add some options to disable various code gen optimizations.Eric Christopher2009-11-041-8/+26
| | | | llvm-svn: 86044
* Factor out more code into addCommonCodeGenPasses. The JIT wasn'tDan Gohman2009-10-311-32/+30
| | | | | | | | previously running CodePlacementOpt. Also print headers before each dump in -print-machineinstrs mode, so that it's clear which dump is which. llvm-svn: 85681
* Remove CodeGenLICM. It's largely obsoleted by MachineLICM's new abilityDan Gohman2009-10-311-6/+1
| | | | | | to unfold loop-invariant loads. llvm-svn: 85657
* Don't put in these EH changes.Bill Wendling2009-10-291-2/+2
| | | | llvm-svn: 85460
* Reverting r85338 for now. It's causing a bootstrap failure on PPC darwin9.Bill Wendling2009-10-291-2/+2
| | | | | | | | --- Reverse-merging r85338 into '.': U lib/CodeGen/SimpleRegisterCoalescing.cpp U lib/CodeGen/SimpleRegisterCoalescing.h llvm-svn: 85454
* Revert r85346 change to control tail merging by CodeGenOpt::Level.Bob Wilson2009-10-281-1/+1
| | | | | | I'm going to redo this using the OptimizeForSize function attribute. llvm-svn: 85426
* Record CodeGen optimization level in the BranchFolding pass so that we canBob Wilson2009-10-271-1/+1
| | | | | | | | | | | | | | | | use it to control tail merging when there is a tradeoff between performance and code size. When there is only 1 instruction in the common tail, we have been merging. That can be good for code size but is a definite loss for performance. Now we will avoid tail merging in that case when the optimization level is "Aggressive", i.e., "-O3". Radar 7338114. Since the IfConversion pass invokes BranchFolding, it too needs to know the optimization level. Note that I removed the RegisterPass instantiation for IfConversion because it required a default constructor. If someone wants to keep that for some reason, we can add a default constructor with a hard-wired optimization level. llvm-svn: 85346
* 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
OpenPOWER on IntegriCloud