summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Use StringRef::startswith to do some string comparisons.Eric Christopher2011-11-071-5/+2
| | | | llvm-svn: 143982
* Avoid the use of a local temporary for comment twines.Eric Christopher2011-11-071-6/+3
| | | | llvm-svn: 143974
* Allow for the case where the name of the subprogram is "".Eric Christopher2011-11-071-0/+1
| | | | | | Fixes a self-host error. llvm-svn: 143970
* Don't introduce custom nodes after legalization in TargetLowering::BuildSDIV()Richard Osborne2011-11-072-10/+16
| | | | | | and TargetLowering::BuildUDIV(). Fixes PR11283 llvm-svn: 143964
* Remove unnecessary addition to API. Replace with something much simpler.Eric Christopher2011-11-073-13/+1
| | | | llvm-svn: 143925
* Add new files to cmake.Eric Christopher2011-11-071-0/+1
| | | | llvm-svn: 143924
* Add the support code to enable the dwarf accelerator tables. Upcoming patchesEric Christopher2011-11-075-6/+224
| | | | | | | | to fix the types section (all types, not just global types), and testcases. The code to do the final emission is disabled by default. llvm-svn: 143923
* Add a new dwarf accelerator table prototype with the goal of replacingEric Christopher2011-11-072-0/+504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the pubnames and pubtypes tables. LLDB can currently use this format and a full spec is forthcoming and submission for standardization is planned. A basic summary: The dwarf accelerator tables are an indirect hash table optimized for null lookup rather than access to known data. They are output into an on-disk format that looks like this: .-------------. | HEADER | |-------------| | BUCKETS | |-------------| | HASHES | |-------------| | OFFSETS | |-------------| | DATA | `-------------' where the header contains a magic number, version, type of hash function, the number of buckets, total number of hashes, and room for a special struct of data and the length of that struct. The buckets contain an index (e.g. 6) into the hashes array. The hashes section contains all of the 32-bit hash values in contiguous memory, and the offsets contain the offset into the data area for the particular hash. For a lookup example, we could hash a function name and take it modulo the number of buckets giving us our bucket. From there we take the bucket value as an index into the hashes table and look at each successive hash as long as the hash value is still the same modulo result (bucket value) as earlier. If we have a match we look at that same entry in the offsets table and grab the offset in the data for our final match. llvm-svn: 143921
* Expose a way to get the beginning of the dwarf string section.Eric Christopher2011-11-072-12/+23
| | | | llvm-svn: 143920
* Fix up comment.Eric Christopher2011-11-071-1/+1
| | | | llvm-svn: 143919
* Typo.Eric Christopher2011-11-071-1/+1
| | | | llvm-svn: 143918
* Add an option to pad an uleb128 to MCObjectWriter and remove the uleb128 ↵Benjamin Kramer2011-11-051-35/+2
| | | | | | | | encoding from the DWARF asm printer. As a side effect we now print dwarf ulebs with .ascii directives. llvm-svn: 143809
* Add more PRI.64 macros for MSVC and use them throughout the codebase.Benjamin Kramer2011-11-052-3/+4
| | | | llvm-svn: 143799
* Added missing &. Fixes <rdar://problem/10393723>Pete Cooper2011-11-041-1/+1
| | | | llvm-svn: 143753
* Emit declarations before definitions if they are available. This causes ↵Rafael Espindola2011-11-041-6/+18
| | | | | | | | DW_AT_specification to point back in the file in the included testcase. Fixes PR11300. llvm-svn: 143726
* Reapply r143206, with fixes. Disallow physical register lifetimesDan Gohman2011-11-034-518/+454
| | | | | | | across calls, and only check for nested dependences on the special call-sequence-resource register. llvm-svn: 143660
* Reverted r143600 - selector reference changePete Cooper2011-11-031-15/+0
| | | | llvm-svn: 143646
* build: Add initial cut at LLVMBuild.txt files.Daniel Dunbar2011-11-033-0/+69
| | | | llvm-svn: 143634
* Treat objc selector reference globals as invariant so that MachineLICM can ↵Pete Cooper2011-11-031-0/+15
| | | | | | hoist them out of loops. Fixes <rdar://problem/6027699> llvm-svn: 143600
* An array of chars of length 8 will also cause the stack protector to be insertedBill Wendling2011-11-021-1/+1
| | | | | | | | into the function. Reflect that here so that the array will be placed next to the SP. <rdar://problem/10128329> llvm-svn: 143590
* Don't emit a directory entry for the value in DW_AT_comp_dir, that is alwaysNick Lewycky2011-11-022-4/+12
| | | | | | implied by directory index zero. llvm-svn: 143570
* Begin collecting some of the statistics for block placement discussed onChandler Carruth2011-11-023-0/+92
| | | | | | | | | | | | | the mailing list. Suggestions for other statistics to collect would be awesome. =] Currently these are implemented as a separate pass guarded by a separate flag. I'm not thrilled by that, but I wanted to be able to collect the statistics for the old code placement as well as the new in order to have a point of comparison. I'm planning on folding them into the single pass if / when there is only one pass of interest. llvm-svn: 143537
* Update split candidate correctly when interference cache is full.Jakob Stoklund Olesen2011-11-011-0/+2
| | | | | | No test case, spotted by inspection. llvm-svn: 143407
* Cleanup. Document. Make sure that this build_vector optimization only runs ↵Nadav Rotem2011-10-311-16/+29
| | | | | | before the op legalizer and that the used type is legal. llvm-svn: 143358
* Silence compiler warning.Benjamin Kramer2011-10-301-4/+4
| | | | llvm-svn: 143308
* Add a new DAGCombine optimization for BUILD_VECTOR.Nadav Rotem2011-10-291-0/+83
| | | | | | | If all of the inputs are zero/any_extended, create a new simple BV which can be further optimized by other BV optimizations. llvm-svn: 143297
* Revert r143206, as there are still some failing tests.Dan Gohman2011-10-294-436/+518
| | | | llvm-svn: 143262
* Reapply r143177 and r143179 (reverting r143188), with schedulerDan Gohman2011-10-284-518/+436
| | | | | | | | | fixes: Use a separate register, instead of SP, as the calling-convention resource, to avoid spurious conflicts with actual uses of SP. Also, fix unscheduling of calling sequences, which can be triggered by pseudo-two-address dependencies. llvm-svn: 143206
* Dwarf: [PR11022] Fix emitting DW_AT_const_value(>i64), to be ↵NAKAMURA Takumi2011-10-281-7/+9
| | | | | | | | | | | host-endian-neutral. Don't assume APInt::getRawData() would hold target-aware endianness nor host-compliant endianness. rawdata[0] holds most lower i64, even on big endian host. FIXME: Add a testcase for big endian target. FIXME: Ditto on CompileUnit::addConstantFPValue() ? llvm-svn: 143194
* Use BranchProbability compare operators.Benjamin Kramer2011-10-281-8/+3
| | | | llvm-svn: 143190
* Speculatively disable Dan's commits 143177 and 143179 to see ifDuncan Sands2011-10-284-407/+516
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it fixes the dragonegg self-host (it looks like gcc is miscompiled). Original commit messages: Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUW on every node as it legalizes them. This makes it easier to use hasOneUse() heuristics, since unneeded nodes can be removed from the DAG earlier. Make LegalizeOps visit the DAG in an operands-last order. It previously used operands-first, because LegalizeTypes has to go operands-first, and LegalizeTypes used to be part of LegalizeOps, but they're now split. The operands-last order is more natural for several legalization tasks. For example, it allows lowering code for nodes with floating-point or vector constants to see those constants directly instead of seeing the lowered form (often constant-pool loads). This makes some things somewhat more complicated today, though it ought to allow things to be simpler in the future. It also fixes some bugs exposed by Legalizing using RAUW aggressively. Remove the part of LegalizeOps that attempted to patch up invalid chain operands on libcalls generated by LegalizeTypes, since it doesn't work with the new LegalizeOps traversal order. Instead, define what LegalizeTypes is doing to be correct, and transfer the responsibility of keeping calls from having overlapping calling sequences into the scheduler. Teach the scheduler to model callseq_begin/end pairs as having a physical register definition/use to prevent calls from having overlapping calling sequences. This is also somewhat complicated, though there are ways it might be simplified in the future. This addresses rdar://9816668, rdar://10043614, rdar://8434668, and others. Please direct high-level questions about this patch to management. Delete #if 0 code accidentally left in. llvm-svn: 143188
* Always use the string pool, even when it makes the .o larger. This may helpNick Lewycky2011-10-283-60/+11
| | | | | | | tools that read the debug info in the .o files by making the DIE sizes more consistent. llvm-svn: 143186
* Delete #if 0 code accidentally left in.Dan Gohman2011-10-281-17/+0
| | | | llvm-svn: 143179
* Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUWDan Gohman2011-10-284-515/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on every node as it legalizes them. This makes it easier to use hasOneUse() heuristics, since unneeded nodes can be removed from the DAG earlier. Make LegalizeOps visit the DAG in an operands-last order. It previously used operands-first, because LegalizeTypes has to go operands-first, and LegalizeTypes used to be part of LegalizeOps, but they're now split. The operands-last order is more natural for several legalization tasks. For example, it allows lowering code for nodes with floating-point or vector constants to see those constants directly instead of seeing the lowered form (often constant-pool loads). This makes some things somewhat more complicated today, though it ought to allow things to be simpler in the future. It also fixes some bugs exposed by Legalizing using RAUW aggressively. Remove the part of LegalizeOps that attempted to patch up invalid chain operands on libcalls generated by LegalizeTypes, since it doesn't work with the new LegalizeOps traversal order. Instead, define what LegalizeTypes is doing to be correct, and transfer the responsibility of keeping calls from having overlapping calling sequences into the scheduler. Teach the scheduler to model callseq_begin/end pairs as having a physical register definition/use to prevent calls from having overlapping calling sequences. This is also somewhat complicated, though there are ways it might be simplified in the future. This addresses rdar://9816668, rdar://10043614, rdar://8434668, and others. Please direct high-level questions about this patch to management. llvm-svn: 143177
* Teach our Dwarf emission to use the string pool.Nick Lewycky2011-10-276-39/+56
| | | | llvm-svn: 143097
* Don't crash on 128-bit sdiv by constant. Found by inspection.Eli Friedman2011-10-271-9/+6
| | | | llvm-svn: 143095
* Rename NonScalarIntSafe to something more appropriate.Lang Hames2011-10-261-4/+4
| | | | llvm-svn: 143080
* Reflow lines, fix comments for doxygen style, fix whitespace. No functionalityNick Lewycky2011-10-262-34/+27
| | | | | | change. llvm-svn: 143074
* Simplify SplitVecRes_UnaryOp by removing all the code that isDuncan Sands2011-10-261-43/+5
| | | | | | | | | | | | | | | | | | | | trying to legalize the operand types when only the result type is required to be legalized - the type legalization machinery will get round to the operands later if they need legalizing. There can be a point to legalizing operands in parallel with the result: when this saves compile time or results in better code. There was only one case in which this was true: when the operand is also split, so keep the logic for that bit. As a result of this change, additional operand legalization methods may need to be introduced to handle nodes where the result and operand types can differ, like SIGN_EXTEND, but the testsuite doesn't contain any tests where this is the case. In any case, it seems better to require such methods (and die with an assert if they doesn't exist) than to quietly produce wrong code if we forgot to special case the node in SplitVecRes_UnaryOp. llvm-svn: 143026
* Don't use floating point to do an integer's job.Jakob Stoklund Olesen2011-10-261-4/+7
| | | | | | | | | | | This code makes different decisions when compiled into x87 instructions because of different rounding behavior. That caused phase 2/3 miscompares on 32-bit Linux when the phase 1 compiler was built with gcc (using x87), and the phase 2 compiler was built with clang (using SSE). This fixes PR11200. llvm-svn: 143006
* Disable LICM speculation in high register pressure situation again now that ↵Evan Cheng2011-10-261-1/+1
| | | | | | Devang has fixed other issues. llvm-svn: 143003
* Reapply r142920 with fix:Bill Wendling2011-10-261-0/+3
| | | | | | | | | | | | An MBB which branches to an EH landing pad shouldn't be considered for tail merging. In SjLj EH, the jump to the landing pad is not done explicitly through a branch statement. The EH landing pad is added as a successor to the throwing BB. Because of that however, the branch folding pass could mistakenly think that it could merge the throwing BB with another BB. This isn't safe to do. <rdar://problem/10334833> llvm-svn: 143001
* Remove a couple redundant checks.Eli Friedman2011-10-251-2/+0
| | | | llvm-svn: 142959
* Make assert() message more informative.Jim Grosbach2011-10-251-1/+2
| | | | | | PR11217. llvm-svn: 142956
* Revert commit 142891. Takumi bisected the tablegen miscompilesDuncan Sands2011-10-251-2/+1
| | | | | | | | | | | | | | down to this commit. Original commit message: An MBB which branches to an EH landing pad shouldn't be considered for tail merging. In SjLj EH, the jump to the landing pad is not done explicitly through a branch statement. The EH landing pad is added as a successor to the throwing BB. Because of that however, the branch folding pass could mistakenly think that it could merge the throwing BB with another BB. This isn't safe to do. <rdar://problem/10334833> llvm-svn: 142920
* Remove dead enum value. There is no DIESectionOffset.Nick Lewycky2011-10-251-1/+0
| | | | llvm-svn: 142912
* Remove unused forward decl.Eric Christopher2011-10-251-1/+0
| | | | llvm-svn: 142892
* An MBB which branches to an EH landing pad shouldn't be considered for tail ↵Bill Wendling2011-10-251-1/+2
| | | | | | | | | | | | merging. In SjLj EH, the jump to the landing pad is not done explicitly through a branch statement. The EH landing pad is added as a successor to the throwing BB. Because of that however, the branch folding pass could mistakenly think that it could merge the throwing BB with another BB. This isn't safe to do. <rdar://problem/10334833> llvm-svn: 142891
* Check the visibility of the global variable before placing it into the stubsBill Wendling2011-10-241-2/+6
| | | | | | | table. A hidden variable could potentially end up in both lists. <rdar://problem/10336715> llvm-svn: 142869
* Really unbreak CMake buildDouglas Gregor2011-10-241-3/+1
| | | | llvm-svn: 142822
OpenPOWER on IntegriCloud