summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Use SequenceToOffsetTable to create instruction name table. Saves space ↵Craig Topper2012-04-011-9/+16
| | | | | | particularly on X86 where AVX instructions just add a 'v' to the front of other instructions. llvm-svn: 153841
* CodeGen: Remove unused variableTobias Grosser2012-04-011-5/+5
| | | | llvm-svn: 153840
* Remove unneeded alias analysisTobias Grosser2012-04-011-1/+1
| | | | llvm-svn: 153839
* CodeGen: Allow function parameters to be rewritten in getNewValue()Tobias Grosser2012-04-013-11/+84
| | | | | | | | | | | | | When deriving new values for the statements of a SCoP, we assumed that parameter values are constant within the SCoP and consquently do not need to be rewritten. For OpenMP code generation this assumption is wrong, as such values are not available in the OpenMP subfunction and consequently also may need to be rewritten. Committed with some changes. Contributed-By: Johannes Doerfert <s9jodoer@stud.uni-saarland.de> llvm-svn: 153838
* Emit the LLVM<->DWARF register mapping as a sorted table and use binary ↵Benjamin Kramer2012-04-013-69/+198
| | | | | | | | | | | | | | | search to do the lookup. This also avoids emitting the information twice, which led to code bloat. On i386-linux-Release+Asserts with all targets built this change shaves a whopping 1.3 MB off clang. The number is probably exaggerated by recent inliner changes but the methods were already enormous with the old inline cost computation. The DWARF reg -> LLVM reg mapping doesn't seem to have holes in it, so it could be a simple lookup table. I didn't implement that optimization yet to avoid potentially changing functionality. There is still some duplication both in tablegen and the generated code that should be cleaned up eventually. llvm-svn: 153837
* Belatedly address some code review from Chris.Chandler Carruth2012-04-011-1/+1
| | | | | | | As a side note, I really dislike array_pod_sort... Do we really still care about any STL implementations that get this so wrong? Does libc++? llvm-svn: 153834
* Add some more testing to cover the remaining two cases whereChandler Carruth2012-04-011-0/+45
| | | | | | always-inlining is disabled: recursive functions and indirectbr. llvm-svn: 153833
* Fix a pretty scary bug I introduced into the always inliner withChandler Carruth2012-04-012-1/+39
| | | | | | | | | | a single missing character. Somehow, this had gone untested. I've added tests for returns-twice logic specifically with the always-inliner that would have caught this, and fixed the bug. Thanks to Matt for the careful review and spotting this!!! =D llvm-svn: 153832
* Replace four tiny tests with various uses of grep and not with a singleChandler Carruth2012-04-015-46/+42
| | | | | | test and FileCheck. llvm-svn: 153831
* misched: Add finalizeScheduler to complete the target interface.Andrew Trick2012-04-012-0/+5
| | | | llvm-svn: 153827
* Removing a file that's no longer being used after the recent refactoringsEli Bendersky2012-04-011-388/+0
| | | | llvm-svn: 153825
* Updating Xcode project version numbers for lldb-137 and debugserver-186Sean Callanan2012-04-015-24/+24
| | | | llvm-svn: 153823
* Updated LLVM to take a comprehensive fix to theSean Callanan2012-04-013-192/+841
| | | | | | | | JIT that enables paired relocations in the i386 Mach-O JIT. This eliminates crashes in the testsuite when running under i386. llvm-svn: 153822
* Split the LdStGeneral PPC itin. class into LdStLoad and LdStStore.Hal Finkel2012-04-019-107/+140
| | | | | | | | | | | Loads and stores can have different pipeline behavior, especially on embedded chips. This change allows those differences to be expressed. Except for the 440 scheduler, there are no functionality changes. On the 440, the latency adjustment is only by one cycle, and so this probably does not affect much. Nevertheless, it will make a larger difference in the future and this removes a FIXME from the 440 itin. llvm-svn: 153821
* Add a workaround for building with old versions of clang.Rafael Espindola2012-03-311-20/+28
| | | | llvm-svn: 153820
* Fixed MacroInfo definition range for function like macros with empty body.Abramo Bagnara2012-03-312-6/+6
| | | | llvm-svn: 153819
* Add a triple to the test.Rafael Espindola2012-03-311-1/+1
| | | | llvm-svn: 153818
* Teach CodeGen's version of computeMaskedBits to understand the range metadata.Rafael Espindola2012-03-3111-19/+54
| | | | | | | | This is the CodeGen equivalent of r153747. I tested that there is not noticeable performance difference with any combination of -O0/-O2 /-g when compiling gcc as a single compilation unit. llvm-svn: 153817
* Fix dynamic linking on PPC64.Hal Finkel2012-03-318-35/+126
| | | | | | | | | | | | | | | | | | Dynamic linking on PPC64 has had problems since we had to move the top-down hazard-detection logic post-ra. For dynamic linking to work there needs to be a nop placed after every call. It turns out that it is really hard to guarantee that nothing will be placed in between the call (bl) and the nop during post-ra scheduling. Previous attempts at fixing this by placing logic inside the hazard detector only partially worked. This is now fixed in a different way: call+nop codegen-only instructions. As far as CodeGen is concerned the pair is now a single instruction and cannot be split. This solution works much better than previous attempts. The scoreboard hazard detector is also renamed to be more generic, there is currently no cpu-specific logic in it. llvm-svn: 153816
* Fix a typo reported in IRC by someone reviewing this code.Chandler Carruth2012-03-311-1/+1
| | | | llvm-svn: 153815
* Give the always-inliner its own custom filter. It shouldn't have to payChandler Carruth2012-03-311-20/+63
| | | | | | | | | | | | the very high overhead of the complex inline cost analysis when all it wants to do is detect three patterns which must not be inlined. Comment the code, clean it up, and leave some hints about possible performance improvements if this ever shows up on a profile. Moving this off of the (now more expensive) inline cost analysis is particularly important because we have to run this inliner even at -O0. llvm-svn: 153814
* Remove a bunch of empty, dead, and no-op methods from all of theseChandler Carruth2012-03-316-57/+0
| | | | | | | | | | interfaces. These methods were used in the old inline cost system where there was a persistent cache that had to be updated, invalidated, and cleared. We're now doing more direct computations that don't require this intricate dance. Even if we resume some level of caching, it would almost certainly have a simpler and more narrow interface than this. llvm-svn: 153813
* Initial commit for the rewrite of the inline cost analysis to operateChandler Carruth2012-03-3113-798/+1189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on a per-callsite walk of the called function's instructions, in breadth-first order over the potentially reachable set of basic blocks. This is a major shift in how inline cost analysis works to improve the accuracy and rationality of inlining decisions. A brief outline of the algorithm this moves to: - Build a simplification mapping based on the callsite arguments to the function arguments. - Push the entry block onto a worklist of potentially-live basic blocks. - Pop the first block off of the *front* of the worklist (for breadth-first ordering) and walk its instructions using a custom InstVisitor. - For each instruction's operands, re-map them based on the simplification mappings available for the given callsite. - Compute any simplification possible of the instruction after re-mapping, and store that back int othe simplification mapping. - Compute any bonuses, costs, or other impacts of the instruction on the cost metric. - When the terminator is reached, replace any conditional value in the terminator with any simplifications from the mapping we have, and add any successors which are not proven to be dead from these simplifications to the worklist. - Pop the next block off of the front of the worklist, and repeat. - As soon as the cost of inlining exceeds the threshold for the callsite, stop analyzing the function in order to bound cost. The primary goal of this algorithm is to perfectly handle dead code paths. We do not want any code in trivially dead code paths to impact inlining decisions. The previous metric was *extremely* flawed here, and would always subtract the average cost of two successors of a conditional branch when it was proven to become an unconditional branch at the callsite. There was no handling of wildly different costs between the two successors, which would cause inlining when the path actually taken was too large, and no inlining when the path actually taken was trivially simple. There was also no handling of the code *path*, only the immediate successors. These problems vanish completely now. See the added regression tests for the shiny new features -- we skip recursive function calls, SROA-killing instructions, and high cost complex CFG structures when dead at the callsite being analyzed. Switching to this algorithm required refactoring the inline cost interface to accept the actual threshold rather than simply returning a single cost. The resulting interface is pretty bad, and I'm planning to do lots of interface cleanup after this patch. Several other refactorings fell out of this, but I've tried to minimize them for this patch. =/ There is still more cleanup that can be done here. Please point out anything that you see in review. I've worked really hard to try to mirror at least the spirit of all of the previous heuristics in the new model. It's not clear that they are all correct any more, but I wanted to minimize the change in this single patch, it's already a bit ridiculous. One heuristic that is *not* yet mirrored is to allow inlining of functions with a dynamic alloca *if* the caller has a dynamic alloca. I will add this back, but I think the most reasonable way requires changes to the inliner itself rather than just the cost metric, and so I've deferred this for a subsequent patch. The test case is XFAIL-ed until then. As mentioned in the review mail, this seems to make Clang run about 1% to 2% faster in -O0, but makes its binary size grow by just under 4%. I've looked into the 4% growth, and it can be fixed, but requires changes to other parts of the inliner. llvm-svn: 153812
* Add support to the InstVisitor for visiting a generic callsite. TheChandler Carruth2012-03-311-2/+23
| | | | | | | | | | visitor will now visit a CallInst and an InvokeInst with instruction-specific visitors, then visit a generic CallSite visitor, then delegate back to the Instruction visitor and the TerminatorInst visitors depending on whether a call or an invoke originally. This will be used in the soon-to-land inline cost rewrite. llvm-svn: 153811
* Move trivial functions into the class definition.Bill Wendling2012-03-312-10/+7
| | | | llvm-svn: 153810
* Trim headers.Bill Wendling2012-03-311-7/+0
| | | | llvm-svn: 153809
* Indent according to LLVM's style guide.Bill Wendling2012-03-311-130/+121
| | | | llvm-svn: 153808
* Cleanup whitespace and trim some of the #includes.Bill Wendling2012-03-314-60/+54
| | | | llvm-svn: 153807
* Internalize: Remove reference of @llvm.noinline, it was replaced with the ↵Benjamin Kramer2012-03-311-1/+0
| | | | | | noinline attribute a long time ago. llvm-svn: 153806
* These strings aren't 'const char *' but 'char *'.Bill Wendling2012-03-312-2/+2
| | | | llvm-svn: 153805
* Cleanup whitespace.Bill Wendling2012-03-311-17/+17
| | | | llvm-svn: 153804
* Free the codegen options when deleting LTO code generator object.Bill Wendling2012-03-311-26/+21
| | | | llvm-svn: 153803
* Cleanup whitespace and remove unneeded 'extern' keyword on function definitions.Bill Wendling2012-03-312-27/+27
| | | | llvm-svn: 153802
* Clean up the naming in this test. Someone pointed this out in review atChandler Carruth2012-03-311-3/+3
| | | | | | one point, and I forgot to go back and clean it up. Sorry about that. =/ llvm-svn: 153801
* Remove unused but set variable.Benjamin Kramer2012-03-311-3/+2
| | | | llvm-svn: 153800
* FileCheck-ize this test, and generally tidy it up prior to changingChandler Carruth2012-03-311-21/+26
| | | | | | things around. llvm-svn: 153799
* I noticed in passing that the Metadata getIfExists method was creating a newDuncan Sands2012-03-312-4/+11
| | | | | | node and returning it if one didn't exist. llvm-svn: 153798
* Correctly vectorize powi.Hal Finkel2012-03-312-11/+77
| | | | | | | | The powi intrinsic requires special handling because it always takes a single integer power regardless of the result type. As a result, we can vectorize only if the powers are equal. Fixes PR12364. llvm-svn: 153797
* comment typoAndrew Trick2012-03-311-1/+1
| | | | llvm-svn: 153796
* Select static relocation model if it is jitting.Akira Hatanaka2012-03-311-1/+3
| | | | llvm-svn: 153795
* Introduce Register Units: Give each leaf register a number.Andrew Trick2012-03-312-0/+60
| | | | | | | | First small step toward modeling multi-register multi-pressure. In the future, register units can also be used to model liveness and aliasing. llvm-svn: 153794
* [arcmt] When fixing the "unassigned init call" ARC error, make sureArgyrios Kyrtzidis2012-03-313-3/+11
| | | | | | | | to do a nil check for the result of the call. rdar://10950973 llvm-svn: 153793
* [libclang] Fix use-after-free bug when handling attributes indexing info.Argyrios Kyrtzidis2012-03-313-52/+68
| | | | | | | | | When indexing a property with a getter/setter with attributes, the allocated memory for AttrListInfo could get released before its destructor is run. Fixes rdar://11113442. llvm-svn: 153792
* Making sure the count on synthetic providers is always setup - This should ↵Enrico Granata2012-03-312-4/+8
| | | | | | prevent errors about count being undefined from showing up llvm-svn: 153791
* Patch from Viktor Kutuzov: delete the temporary process we created when ↵Greg Clayton2012-03-311-0/+1
| | | | | | "process connect" fails. llvm-svn: 153790
* Add a 2 byte safety margin in offset computations.Jakob Stoklund Olesen2012-03-311-2/+5
| | | | | | | | | | | | ARMConstantIslandPass still has bugs where jump table compression can cause constant pool entries to go out of range. Add a safety margin of 2 bytes when placing constant islands, but use the real max displacement for verification. <rdar://problem/11156595> llvm-svn: 153789
* Add more debugging output to ARMConstantIslandPass.Jakob Stoklund Olesen2012-03-311-2/+16
| | | | llvm-svn: 153788
* Added the ability to log when things get completed in DWARF. This can be ↵Greg Clayton2012-03-303-19/+33
| | | | | | | | | | enabled using: (lldb) log enable --verbose lldb completion This will print out backtraces for all type completion calls which will help us verify that we don't ever complete a type when we don't need to. llvm-svn: 153787
* Remove unused code.Greg Clayton2012-03-301-9/+1
| | | | llvm-svn: 153786
* Don't log to a temp file and delete it, just use the API that gives us a ↵Greg Clayton2012-03-301-19/+8
| | | | | | malloc'ed string array. llvm-svn: 153785
OpenPOWER on IntegriCloud