aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
| * The MDString class stored a StringRef to the string which was already in aBill Wendling2012-04-102-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | StringMap. This was redundant and unnecessarily bloated the MDString class. Because the MDString class is a "Value" and will never have a "name", and because the Name field in the Value class is a pointer to a StringMap entry, we repurpose the Name field for an MDString. It stores the StringMap entry in the Name field, and uses the normal methods to get the string (name) back. PR12474 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154429 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use the correct section types on Solaris for unwind data on both x86 and x86-64.David Chisnall2012-04-101-0/+1
| | | | | | | | | | | | | | | | Patch by Dmitri Shubin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154391 91177308-0d34-0410-b5e6-96231b3b80d8
| * Express the number of ULPs in fpaccuracy metadata as a real rather than aDuncan Sands2012-04-101-0/+1
| | | | | | | | | | | | | | rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154387 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix 12513: Loop unrolling breaks with indirect branches.Andrew Trick2012-04-101-0/+3
| | | | | | | | | | | | | | | | Take this opportunity to generalize the indirectbr bailout logic for loop transformations. CFG transformations will never get indirectbr right, and there's no point trying. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154386 91177308-0d34-0410-b5e6-96231b3b80d8
| * Added a TargetRegisterInfo interface for accessing register pressure sets.Andrew Trick2012-04-101-0/+18
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154375 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add a constructor for DataRefImpl and remove excess initialization.Danil Malyshev2012-04-102-25/+8
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154371 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix a long standing tail call optimization bug. When a libcall is emittedEvan Cheng2012-04-102-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | legalizer always use the DAG entry node. This is wrong when the libcall is emitted as a tail call since it effectively folds the return node. If the return node's input chain is not the entry (i.e. call, load, or store) use that as the tail call input chain. PR12419 rdar://9770785 rdar://11195178 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154370 91177308-0d34-0410-b5e6-96231b3b80d8
| * Typo.Eric Christopher2012-04-091-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154329 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix accidentally constant conditions found by uncommitted improvements to ↵David Blaikie2012-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | -Wconstant-conversion. A couple of cases where we were accidentally creating constant conditions by something like "x == a || b" instead of "x == a || x == b". In one case a conditional & then unreachable was used - I transformed this into a direct assert instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154324 91177308-0d34-0410-b5e6-96231b3b80d8
| * s/lto_codegen_whole_program_optimization/lto_codegen_set_whole_program_optim ↵Bill Wendling2012-04-091-1/+1
| | | | | | | | | | | | ization/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154312 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add a hook to turn on the internalize pass through the LTO interface.Bill Wendling2012-04-091-2/+6
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154306 91177308-0d34-0410-b5e6-96231b3b80d8
| * Teach LLVM about a PIE option which, when enabled on top of PIC, makesChandler Carruth2012-04-081-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimizations which are valid for position independent code being linked into a single executable, but not for such code being linked into a shared library. I discussed the design of this with Eric Christopher, and the decision was to support an optional bit rather than a completely separate relocation model. Fundamentally, this is still PIC relocation, its just that certain optimizations are only valid under a PIC relocation model when the resulting code won't be in a shared library. The simplest path to here is to expose a single bit option in the TargetOptions. If folks have different/better designs, I'm all ears. =] I've included the first optimization based upon this: changing TLS models to the *Exec models when PIE is enabled. This is the LLVM component of PR12380 and is all of the hard work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154294 91177308-0d34-0410-b5e6-96231b3b80d8
| * Move the TLSModel information into the TargetMachine rather than hidingChandler Carruth2012-04-083-11/+15
| | | | | | | | | | | | | | | | in TargetLowering. There was already a FIXME about this location being odd. The interface is simplified as a consequence. This will also make it easier to change TLS models when compiling with PIE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154292 91177308-0d34-0410-b5e6-96231b3b80d8
| * Allow subclasses of the ValueHandleBase to store information as part of theBill Wendling2012-04-081-17/+26
| | | | | | | | | | | | | | | | value pointer by making the value pointer into a pointer-int pair with 2 bits available for flags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154279 91177308-0d34-0410-b5e6-96231b3b80d8
| * Perform partial SROA on the helper hashing structure. I really wish theChandler Carruth2012-04-071-42/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimizers could do this for us, but expecting partial SROA of classes with template methods through cloning is probably expecting too much heroics. With this change, the begin/end pointer pairs which indicate the status of each loop iteration are actually passed directly into each layer of the combine_data calls, and the inliner has a chance to see when most of the combine_data function could be deleted by inlining. Similarly for 'length'. We have to be careful to limit the places where in/out reference parameters are used as those will also defeat the inliner / optimizers from properly propagating constants. With this change, LLVM is able to fully inline and unroll the hash computation of small sets of values, such as two or three pointers. These now decompose into essentially straight-line code with no loops or function calls. There is still one code quality problem to be solved with the hashing -- LLVM is failing to nuke the alloca. It removes all loads from the alloca, leaving only lifetime intrinsics and dead(!!) stores to the alloca. =/ Very unfortunate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154264 91177308-0d34-0410-b5e6-96231b3b80d8
| * Refactor: Use positive field names in VectorizeConfig.Hongbin Zheng2012-04-071-12/+12
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154249 91177308-0d34-0410-b5e6-96231b3b80d8
| * Output UTF-8-encoded characters as identifier characters into assemblySean Hunt2012-04-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | by default. This is a behaviour configurable in the MCAsmInfo. I've decided to turn it on by default in (possibly optimistic) hopes that most assemblers are reasonably sane. If this proves a problem, switching to default seems reasonable. I'm not sure if this is the opportune place to test, but it seemed good to make sure it was tested somewhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154235 91177308-0d34-0410-b5e6-96231b3b80d8
| * Reintroduce InlineCostAnalyzer::getInlineCost() variant with explicit calleeDavid Chisnall2012-04-061-0/+9
| | | | | | | | | | | | | | | | | | | | parameter until we have a more sensible API for doing the same thing. Reviewed by Chandler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154180 91177308-0d34-0410-b5e6-96231b3b80d8
| * DenseMap: Perform the pod-like object optimization when the value type is ↵Benjamin Kramer2012-04-064-30/+26
| | | | | | | | | | | | | | | | POD-like, not the DenseMapInfo for it. Purge now unused template arguments. This has been broken since r91421. Patch by Lubos Lunak! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154170 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix the build breakage introduced by r154131.Kaelyn Uhrain2012-04-051-19/+3
| | | | | | | | | | | | | | | | | | The empty 1-argument operator delete is for the benefit of the destructor. A couple of spot checks of running yaml-bench under valgrind against a few of the files under test/YAMLParser did not reveal any leaks introduced by this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154137 91177308-0d34-0410-b5e6-96231b3b80d8
| * Really fix -Wnon-virtual-dtor warnings; gcc needs the dtors to beKaelyn Uhrain2012-04-051-7/+7
| | | | | | | | | | | | explicitly marked as virtual. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154131 91177308-0d34-0410-b5e6-96231b3b80d8
| * Introduce the VectorizeConfig class, with which we can control the behaviorHongbin Zheng2012-04-051-2/+66
| | | | | | | | | | | | | | | | | | of the BBVectorizePass without using command line option. As pointed out by Hal, we can ask the TargetLoweringInfo for the architecture specific VectorizeConfig to perform vectorizing with architecture specific information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154096 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add the function "vectorizeBasicBlock" which allow users vectorize aHongbin Zheng2012-04-051-1/+13
| | | | | | | | | | | | | | BasicBlock in other passes, e.g. we can call vectorizeBasicBlock in the loop unroll pass right after the loop is unrolled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154089 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix -Wnon-virtual-dtor warnings.Michael J. Spencer2012-04-041-0/+20
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154063 91177308-0d34-0410-b5e6-96231b3b80d8
| * Always compute all the bits in ComputeMaskedBits.Rafael Espindola2012-04-043-8/+5
| | | | | | | | | | | | | | | | This allows us to keep passing reduced masks to SimplifyDemandedBits, but know about all the bits if SimplifyDemandedBits fails. This allows instcombine to simplify cases like the one in the included testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154011 91177308-0d34-0410-b5e6-96231b3b80d8
| * Move yaml::Stream's dtor out of line so it can see Scanner's dtor.Benjamin Kramer2012-04-041-0/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154004 91177308-0d34-0410-b5e6-96231b3b80d8
| * Implement DwarfLLVMRegPair::operator< without violating asymmetry.Benjamin Kramer2012-04-041-4/+5
| | | | | | | | | | | | MSVC8 verifies this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154002 91177308-0d34-0410-b5e6-96231b3b80d8
| * Sorry about that. MSVC seems to accept just about any random string you give ↵Michael J. Spencer2012-04-031-20/+0
| | | | | | | | | | | | it ;/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153979 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add YAML parser to Support.Michael J. Spencer2012-04-031-0/+564
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153977 91177308-0d34-0410-b5e6-96231b3b80d8
| * Matrix simplification in PBQP may push infinite costs onto register options.Lang Hames2012-04-031-0/+6
| | | | | | | | | | | | | | | | | | The colorability heuristic should count these as denied registers. No test case - this exposed a bug on an out-of-tree target. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153958 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add a line number for the scope of the function (starting at the firstEric Christopher2012-04-032-0/+8
| | | | | | | | | | | | | | | | | | | | brace) so that we get more accurate line number information about the declaration of a given function and the line where the function first starts. Part of rdar://11026482 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153916 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fixes to r153903. Added missing explanation of behaviour when the ↵Pete Cooper2012-04-031-0/+5
| | | | | | | | | | | | VirtRegMap is NULL. Also changed it in this case to just avoid updating the map, but live ranges or intervals will still get updated and created git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153914 91177308-0d34-0410-b5e6-96231b3b80d8
| * Moved LiveRangeEdit.h so that it can be called from other parts of the ↵Pete Cooper2012-04-021-0/+202
| | | | | | | | | | | | backend, not just libCodeGen git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153906 91177308-0d34-0410-b5e6-96231b3b80d8
| * Make dominatedBySlowTreeWalk private and assert cases handled by the caller.Rafael Espindola2012-04-021-21/+12
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153905 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add an option to turn off the expensive GVN load PRE part of GVN.Bill Wendling2012-04-021-1/+3
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153902 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add predicates for checking whether targets have free FNEG and FABS ↵Owen Anderson2012-04-021-0/+12
| | | | | | | | | | | | operations, and prevent the DAGCombiner from turning them into bitwise operations if they do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153901 91177308-0d34-0410-b5e6-96231b3b80d8
| * Initial 64 bit direct object support.Akira Hatanaka2012-04-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | This patch allows llvm to recognize that a 64 bit object file is being produced and that the subsequently generated ELF header has the correct information. The test case checks for both big and little endian flavors. Patch by Jack Carter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153889 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add triple support for the IBM BG/P and BG/Q supercomputers.Hal Finkel2012-04-021-2/+5
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153882 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add missing 'd'.Rafael Espindola2012-04-021-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153872 91177308-0d34-0410-b5e6-96231b3b80d8
| * Move getOpcodeName from the various target InstPrinters into the superclass ↵Benjamin Kramer2012-04-021-1/+1
| | | | | | | | | | | | | | | | MCInstPrinter. All implementations used the same code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153866 91177308-0d34-0410-b5e6-96231b3b80d8
| * Make MCInstrInfo available to the MCInstPrinter. This will be used to remove ↵Craig Topper2012-04-022-3/+8
| | | | | | | | | | | | getInstructionName and the static data it contains since the same tables are already in MCInstrInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153860 91177308-0d34-0410-b5e6-96231b3b80d8
| * Start cleaning up the InlineCost class. This switches to sentinel valuesChandler Carruth2012-04-011-25/+20
| | | | | | | | | | | | | | | | | | | | | | rather than a bitfield, a great suggestion by Chris during code review. There is still quite a bit of cruft in the interface, but that requires sorting out some awkward uses of the cost inside the actual inliner. No functionality changed intended here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153853 91177308-0d34-0410-b5e6-96231b3b80d8
| * Emit the LLVM<->DWARF register mapping as a sorted table and use binary ↵Benjamin Kramer2012-04-011-26/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153837 91177308-0d34-0410-b5e6-96231b3b80d8
| * misched: Add finalizeScheduler to complete the target interface.Andrew Trick2012-04-011-0/+4
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153827 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add a workaround for building with old versions of clang.Rafael Espindola2012-03-311-20/+28
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153820 91177308-0d34-0410-b5e6-96231b3b80d8
| * Teach CodeGen's version of computeMaskedBits to understand the range metadata.Rafael Espindola2012-03-315-6/+19
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153817 91177308-0d34-0410-b5e6-96231b3b80d8
| * Remove a bunch of empty, dead, and no-op methods from all of theseChandler Carruth2012-03-312-21/+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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153813 91177308-0d34-0410-b5e6-96231b3b80d8
| * Initial commit for the rewrite of the inline cost analysis to operateChandler Carruth2012-03-313-122/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153812 91177308-0d34-0410-b5e6-96231b3b80d8
| * 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153811 91177308-0d34-0410-b5e6-96231b3b80d8
| * Cleanup whitespace and remove unneeded 'extern' keyword on function definitions.Bill Wendling2012-03-311-16/+17
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153802 91177308-0d34-0410-b5e6-96231b3b80d8