summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Use the pointer type size.Bill Wendling2011-07-291-1/+1
| | | | | | With this, we can now compile a simple EH program. llvm-svn: 136446
* And now something that compiles...Bill Wendling2011-07-291-1/+1
| | | | llvm-svn: 136445
* Make sure to sext or trunc the result from the register.Bill Wendling2011-07-291-2/+2
| | | | llvm-svn: 136444
* Rewrite the CMake build to use explicit dependencies between libraries,Chandler Carruth2011-07-293-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified in the same file that the library itself is created. This is more idiomatic for CMake builds, and also allows us to correctly specify dependencies that are missed due to bugs in the GenLibDeps perl script, or change from compiler to compiler. On Linux, this returns CMake to a place where it can relably rebuild several targets of LLVM. I have tried not to change the dependencies from the ones in the current auto-generated file. The only places I've really diverged are in places where I was seeing link failures, and added a dependency. The goal of this patch is not to start changing the dependencies, merely to move them into the correct location, and an explicit form that we can control and change when necessary. This also removes a serialization point in the build because we don't have to scan all the libraries before we begin building various tools. We no longer have a step of the build that regenerates a file inside the source tree. A few other associated cleanups fall out of this. This isn't really finished yet though. After talking to dgregor he urged switching to a single CMake macro to construct libraries with both sources and dependencies in the arguments. Migrating from the two macros to that style will be a follow-up patch. Also, llvm-config is still generated with GenLibDeps.pl, which means it still has slightly buggy dependencies. The internal CMake 'llvm-config-like' macro uses the correct explicitly specified dependencies however. A future patch will switch llvm-config generation (when using CMake) to be based on these deps as well. This may well break Windows. I'm getting a machine set up now to dig into any failures there. If anyone can chime in with problems they see or ideas of how to solve them for Windows, much appreciated. llvm-svn: 136433
* Visit the landingpad instruction.Bill Wendling2011-07-281-1/+35
| | | | | | | | | This generates the correct SDNodes for the landingpad instruction. It makes an assumption that the result of the landingpad instruction has at least two values. And that the first value is a pointer to the exception object and the second value is the "selector." llvm-svn: 136430
* Add the AddLandingPadInfo function.Bill Wendling2011-07-281-0/+34
| | | | | | | AddLandingPadInfo takes a landingpad instruction and grabs all of the information from it that it needs for EH table generation. llvm-svn: 136429
* LangRef and basic memory-representation/reading/writing for 'cmpxchg' andEli Friedman2011-07-282-0/+8
| | | | | | | | | | | | | | | | | | | | | 'atomicrmw' instructions, which allow representing all the current atomic rmw intrinsics. The allowed operands for these instructions are heavily restricted at the moment; we can probably loosen it a bit, but supporting general first-class types (where it makes sense) might get a bit complicated, given how SelectionDAG works. As an initial cut, these operations do not support specifying an alignment, but it would be possible to add if we think it's useful. Specifying an alignment lower than the natural alignment would be essentially impossible to support on anything other than x86, but specifying a greater alignment would be possible. I can't think of any useful optimizations which would use that information, but maybe someone else has ideas. Optimizer/codegen support coming soon. llvm-svn: 136404
* Handle REG_SEQUENCE with implicitly defined operands.Jakob Stoklund Olesen2011-07-281-0/+6
| | | | | | | | | | | | | Code like that would only be produced by bugpoint, but we should still handle it correctly. When a register is defined by a REG_SEQUENCE of undefs, the register itself is undef. Previously, we would create a register with uses but no defs. Fixes part of PR10520. llvm-svn: 136401
* Use ArrayRef instead of requiring an std::vector.Bill Wendling2011-07-281-4/+6
| | | | llvm-svn: 136396
* The personality function should be a Function* and not just a Value*.Bill Wendling2011-07-281-4/+6
| | | | llvm-svn: 136392
* Reverse order of RS_Split live ranges under -compact-regions.Jakob Stoklund Olesen2011-07-281-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two conflicting strategies in play: - Under high register pressure, we want to assign large live ranges first. Smaller live ranges are easier to place afterwards. - Live range splitting is guided by interference, so splitting should be deferred until interference is as realistic as possible. With the recent changes to the live range stages, and with compact regions enabled, it is less traumatic to split a live range too early. If some of the split products were too big, they can often be split again. By reversing the RS_Split order, we get this queue order: 1. Normal live ranges, large to small. 2. RS_Split live ranges, large to small. The large-to-small order improves RAGreedy's puzzle solving skills under high register pressure. It may cause a bit more iterated splitting, but we handle that better now. With this change, -compact-regions is mostly an improvement on SPEC. llvm-svn: 136388
* Initial code to convert ResumeInsts into calls to _Unwind_Resume.Bill Wendling2011-07-281-1/+57
| | | | | | This should be the only code necessary for DWARF EH prepare. llvm-svn: 136387
* CR fix: The ANY_EXTEND can be removed because the input and putput type must beNadav Rotem2011-07-281-2/+1
| | | | | | identical. llvm-svn: 136355
* Code generation for 'fence' instruction.Eli Friedman2011-07-273-1/+9
| | | | llvm-svn: 136283
* Use BlockFrequency instead of uint32_t in BlockFrequencyInfo.Jakub Staszak2011-07-271-1/+1
| | | | llvm-svn: 136278
* Remove outdated FIXME comment.Devang Patel2011-07-271-1/+0
| | | | llvm-svn: 136275
* Merge the contents from exception-handling-rewrite to the mainline.Bill Wendling2011-07-273-2/+14
| | | | | | This adds the new instructions 'landingpad' and 'resume'. llvm-svn: 136253
* Explicitly cast narrowing conversions inside {}s that will become errors inJeffrey Yasskin2011-07-271-1/+2
| | | | | | C++0x. llvm-svn: 136211
* Revert r136156, which broke several buildbots.Dan Gohman2011-07-271-1/+14
| | | | llvm-svn: 136206
* It is quiet possible that inlined function body is split into multiple ↵Devang Patel2011-07-271-16/+41
| | | | | | chunks of consequtive instructions. But, there is not any way to describe this in .debug_inline accelerator table used by gdb. However, describe non contiguous ranges of inlined function body appropriately using AT_range of DW_TAG_inlined_subroutine debug info entry. llvm-svn: 136196
* Add support for multi-way live range splitting.Jakob Stoklund Olesen2011-07-261-64/+165
| | | | | | | | | | | | | | | | | | | | | When splitting global live ranges, it is now possible to split for multiple destination intervals at once. Previously, we only had the main and stack intervals. Each edge bundle is assigned to a split candidate, and splitAroundRegion will insert copies between the candidate intervals and the stack interval as needed. The multi-way splitting is used to split around compact regions when enabled with -compact-regions. The best candidate register still gets all the bundles it wants, but everything outside the main interval is first split around compact regions before we create single-block intervals. Compact region splitting still causes some regressions, so it is not enabled by default. llvm-svn: 136186
* Print out the MBB live-in registers.Jakob Stoklund Olesen2011-07-261-0/+4
| | | | llvm-svn: 136178
* Eliminate copies of undefined values during coalescing.Jakob Stoklund Olesen2011-07-262-0/+53
| | | | | | | | | | These copies would coalesce easily, but the resulting value would be defined by a deleted instruction. Now we also remove the undefined value number from the destination register. This fixes PR10503. llvm-svn: 136174
* Delete unnecessarily cautious LastCALLSEQ code.Dan Gohman2011-07-261-14/+1
| | | | llvm-svn: 136156
* Add obvious missing case to switch. PR10497.Eli Friedman2011-07-261-2/+1
| | | | llvm-svn: 136130
* While extracting lexical scopes from machine instruction stream, work on one ↵Devang Patel2011-07-261-9/+9
| | | | | | machine basic block at a time. llvm-svn: 136106
* SrcDef is only written and never read. Remove it.Duncan Sands2011-07-261-8/+7
| | | | llvm-svn: 136080
* Revert to RA_Assign when a virtreg separates into components.Jakob Stoklund Olesen2011-07-261-1/+3
| | | | | | | | | | | | | When dead code elimination deletes a PHI value, the virtual register may split into multiple connected components. In that case, revert each component to the RS_Assign stage. The new components are guaranteed to be smaller (the original value numbers are distributed among the components), so this will always be making progress. The components are now allowed to evict other live ranges or be split again. llvm-svn: 136034
* Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to ↵Evan Cheng2011-07-261-12/+12
| | | | | | createMCObjectStreamer. llvm-svn: 136031
* Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to ↵Evan Cheng2011-07-261-2/+3
| | | | | | MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser. llvm-svn: 136027
* Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to ↵Evan Cheng2011-07-251-9/+9
| | | | | | createMCAsmBackend. llvm-svn: 136010
* Initial implementation of 'fence' instruction, the new C++0x-style ↵Eli Friedman2011-07-252-0/+5
| | | | | | | | replacement for llvm.memory.barrier. This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon. llvm-svn: 136009
* Make sure this DAGCombine actually returns an UNDEF of the correct type; ↵Eli Friedman2011-07-251-1/+1
| | | | | | PR10476. llvm-svn: 135993
* Rename BlockFrequency to BlockFrequencyInfo and MachineBlockFrequency toJakub Staszak2011-07-253-12/+13
| | | | | | MachineBlockFrequencyInfo. llvm-svn: 135937
* Add an RS_Split2 stage used for loop prevention.Jakob Stoklund Olesen2011-07-251-15/+24
| | | | | | | | | | | | | | | | This mechanism already exists, but the RS_Split2 stage makes it clearer. When live range splitting creates ranges that may not be making progress, they are marked RS_Split2 instead of RS_New. These ranges may be split again, but only in a way that can be proven to make progress. For local ranges, that means they must be split into ranges used by strictly fewer instructions. For global ranges, region splitting is bypassed and the RS_Split2 ranges go straight to per-block splitting. llvm-svn: 135912
* Rename live range stages to better reflect how they are used.Jakob Stoklund Olesen2011-07-251-32/+40
| | | | | | | | | | | | The stage is used to control where a live range is going, not where it is coming from. Live ranges created by splitting will usually be marked RS_New, but some are marked RS_Spill to avoid wasting time trying to split them again. The old RS_Global and RS_Local stages are merged - they are really the same thing for local and global live ranges. llvm-svn: 135911
* Convert GetElementPtrInst to use ArrayRef.Jay Foad2011-07-251-14/+9
| | | | llvm-svn: 135904
* Never extend live ranges for <undef> uses.Jakob Stoklund Olesen2011-07-241-1/+1
| | | | llvm-svn: 135886
* Correctly handle <undef> tied uses when rewriting after a split.Jakob Stoklund Olesen2011-07-241-8/+4
| | | | | | | | | | | This fixes PR10463. A two-address instruction with an <undef> use operand was incorrectly rewritten so the def and use no longer used the same register, violating the tie constraint. Fix this by always rewriting <undef> operands with the register a def operand would use. llvm-svn: 135885
* Add RAGreedy::calcCompactRegion.Jakob Stoklund Olesen2011-07-231-0/+46
| | | | | | | | | | | | | | | | This method computes the edge bundles that should be live when splitting around a compact region. This is independent of interference. The function returns false if the live range was already a compact region, or the compact region doesn't have any live bundles - it would be the same as splitting around basic blocks. Compact regions are computed using the normal spill placement code. We pretend there is interference in all live-through blocks that don't use the live range. This removes all edges from the Hopfield network used for spill placement, so it converges instantly. llvm-svn: 135847
* Fix bug in SplitEditor::splitLiveThroughBlock when switching registers.Jakob Stoklund Olesen2011-07-231-5/+14
| | | | | | | | | | | If there is no interference and no last split point, we cannot enterIntvBefore(Stop) - that function needs a real instruction. Use enterIntvAtEnd instead for that very easy case. This code doesn't currently run, it is needed by multi-way splitting. llvm-svn: 135846
* Prepare RAGreedy::growRegion for compact regions.Jakob Stoklund Olesen2011-07-231-1/+8
| | | | | | | | | | | | | | | A split candidate can have a null PhysReg which means that it doesn't map to a real interference pattern. Instead, pretend that all through blocks have interference. This makes it possible to generate compact regions where the live range doesn't go through blocks that don't use it. The live range will still be live between directly connected blocks with uses. Splitting around a compact region tends to produce a live range with a high spill weight, so it may evict a less dense live range. llvm-svn: 135845
* Add a simple method for marking blocks with interference in and out.Jakob Stoklund Olesen2011-07-232-0/+18
| | | | | | | | | | This method matches addLinks - All the listed blocks are considered to have interference, so they add a negative bias to their bundles. This could also be done by addConstraints, but that requires building a separate BlockConstraint array. llvm-svn: 135844
* Allow null interference cursors to be queried.Jakob Stoklund Olesen2011-07-232-2/+6
| | | | | | They always report 'no interference'. llvm-svn: 135843
* Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng2011-07-231-1/+1
| | | | | | they belong. llvm-svn: 135833
* Fix more MSVC warnings caused by a cases I missed when convertingJay Foad2011-07-221-1/+1
| | | | | | ConstantExpr::getGetElementPtr to use ArrayRef. llvm-svn: 135762
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-221-2/+2
| | | | | | ArrayRef. llvm-svn: 135761
* Allow getBlockFreq to return 0.Jakub Staszak2011-07-221-4/+4
| | | | llvm-svn: 135742
* Revert patch which broke some IfConversion tests.Jakub Staszak2011-07-221-10/+29
| | | | llvm-svn: 135738
* Fix typo in #include which revealed in the case-sensitive filesystem.Jakub Staszak2011-07-221-1/+1
| | | | llvm-svn: 135734
OpenPOWER on IntegriCloud