aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR2434. When scanning for exising binary operator to reuse don't Wojciech Matyjewicz2008-06-151-15/+15
| | | | | | | | | | | | take into account the instrucion pointed by InsertPt. Thanks to it, returning the new value of InsertPt to the InsertBinop() caller can be avoided. The bug was, actually, in visitAddRecExpr() method which wasn't correctly handling changes of InsertPt. There shouldn't be any performance regression, as -gvn pass (run after -indvars) removes any redundant binops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52291 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a missing semicolon.Wojciech Matyjewicz2008-06-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52290 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the sys::Path::getSuffix() implementation.Argiris Kirtzidis2008-06-153-5/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52288 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the environment block that is passed to the CreateProcess function.Argiris Kirtzidis2008-06-151-1/+28
| | | | | | This bug made llvm-ld unable to function with "-native" option, since the process that was used to call 'gcc' was crashing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52284 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a redundant AfterLegalize check. TurnDuncan Sands2008-06-141-4/+5
| | | | | | | | | on some code when !AfterLegalize - but since this whole code section is turned off by an "if (0)" it's not really turning anything on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52276 91177308-0d34-0410-b5e6-96231b3b80d8
* Change 'while' loop to 'do' loop.Wojciech Matyjewicz2008-06-141-4/+11
| | | | | | | | | | Add a safety measure. It isn't safe to assume in ScalarEvolutionExpander that all loops are in canonical form (but it should be safe for loops that have AddRecs). xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52275 91177308-0d34-0410-b5e6-96231b3b80d8
* add missing atomic intrinsic from gccAndrew Lenharth2008-06-147-28/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52270 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a case where tailcallelim wouldn't set the changed bit when it made a ↵Chris Lattner2008-06-141-1/+3
| | | | | | change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52267 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the spiller to commute instructions in order to fold a reload. This ↵Evan Cheng2008-06-131-18/+125
| | | | | | hits 410 times on 444.namd and 122 times on 252.eon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52266 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't skip over instructions other than loads that might read memory Eli Friedman2008-06-131-5/+6
| | | | | | | | when trying to sink stores. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52259 91177308-0d34-0410-b5e6-96231b3b80d8
* Protect ChangeCompareStride from situations in which it is possibleDan Gohman2008-06-131-3/+12
| | | | | | | for it to generate use-before-def IR, such as in this testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52258 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure SimplifyStoreAtEndOfBlock doesn't mess with loops; the Eli Friedman2008-06-131-2/+6
| | | | | | | | | structure checks are incorrect if the blocks aren't distinct. Fixes PR2435. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52257 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable some DAG combiner optimizations that may beDuncan Sands2008-06-133-59/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wrong for volatile loads and stores. In fact this is almost all of them! There are three types of problems: (1) it is wrong to change the width of a volatile memory access. These may be used to do memory mapped i/o, in which case a load can have an effect even if the result is not used. Consider loading an i32 but only using the lower 8 bits. It is wrong to change this into a load of an i8, because you are no longer tickling the other three bytes. It is also unwise to make a load/store wider. For example, changing an i16 load into an i32 load is wrong no matter how aligned things are, since the fact of loading an additional 2 bytes can have i/o side-effects. (2) it is wrong to change the number of volatile load/stores: they may be counted by the hardware. (3) it is wrong to change a volatile load/store that requires one memory access into one that requires several. For example on x86-32, you can store a double in one processor operation, but to store an i64 requires two (two i32 stores). In a multi-threaded program you may want to bitcast an i64 to a double and store as a double because that will occur atomically, and be indivisible to other threads. So it would be wrong to convert the store-of-double into a store of an i64, because this will become two i32 stores - no longer atomic. My policy here is to say that the number of processor operations for an illegal operation is undefined. So it is alright to change a store of an i64 (requires at least two stores; but could be validly lowered to memcpy for example) into a store of double (one processor op). In short, if the new store is legal and has the same size then I say that the transform is ok. It would also be possible to say that transforms are always ok if before they were illegal, whether after they are illegal or not, but that's more awkward to do and I doubt it buys us anything much. However this exposed an interesting thing - on x86-32 a store of i64 is considered legal! That is because operations are marked legal by default, regardless of whether the type is legal or not. In some ways this is clever: before type legalization this means that operations on illegal types are considered legal; after type legalization there are no illegal types so now operations are only legal if they really are. But I consider this to be too cunning for mere mortals. Better to do things explicitly by testing AfterLegalize. So I have changed things so that operations with illegal types are considered illegal - indeed they can never map to a machine operation. However this means that the DAG combiner is more conservative because before it was "accidentally" performing transforms where the type was illegal because the operation was nonetheless marked legal. So in a few such places I added a check on AfterLegalize, which I suppose was actually just forgotten before. This causes the DAG combiner to do slightly more than it used to, which resulted in the X86 backend blowing up because it got a slightly surprising node it wasn't expecting, so I tweaked it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52254 91177308-0d34-0410-b5e6-96231b3b80d8
* Use recently added getTruncateOrZeroExtend method to make the code shorter.Wojciech Matyjewicz2008-06-131-5/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52251 91177308-0d34-0410-b5e6-96231b3b80d8
* Crash less. The i64 restriction in BinomialCoefficient caused some problemsNick Lewycky2008-06-131-24/+30
| | | | | | | | | with code that was expecting different bit widths for different values. Make getTruncateOrZeroExtend a method on ScalarEvolution, and use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52248 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a minor deviation from the original in my previous commitGabor Greif2008-06-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52247 91177308-0d34-0410-b5e6-96231b3b80d8
* op_iterator-ify some loops, low hanging fruit only, there is moreGabor Greif2008-06-121-19/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52246 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not speculatively execute an instruction by hoisting it to its ↵Evan Cheng2008-06-122-2/+27
| | | | | | predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52244 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 52223.Evan Cheng2008-06-121-18/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52243 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch GVN to use ScopedHashTable.Owen Anderson2008-06-121-134/+64
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52242 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix redirection of stderr in sys::Program::ExecuteAndWait. There was logicMatthijs Kooijman2008-06-122-9/+19
| | | | | | | | | | | | | | error that caused it to redirect stderr to stdout too often. This fix is applied identically to the win32 code as well, but that is untested. --Thi line, and those below, will be ignored-- M System/Unix/Program.inc M System/Win32/Program.inc git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52233 91177308-0d34-0410-b5e6-96231b3b80d8
* Make I/O redirection handling in sys::Program a bit more consistent. NoMatthijs Kooijman2008-06-122-24/+18
| | | | | | | | | | | | | | functional changes. Win32 code is untested, but should work fine. In the unix variant, rename RedirectFD to RedirectIO and let that function handle empty and null paths instead of doing that in the caller 3 times. This is the same as win32 already does it. In the win32 variant, use Path::isEmpty() instead of checking the resulting c_str() manually. This is the same as unix already does it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52230 91177308-0d34-0410-b5e6-96231b3b80d8
* op_iterator-ify some loops, fix 80col violationsGabor Greif2008-06-111-9/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52226 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly lower DYNAMIC_STACKALLOC - bracket all black magic withAnton Korobeynikov2008-06-111-4/+12
| | | | | | | CALLSEQ_BEGIN & CALLSEQ_END. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52225 91177308-0d34-0410-b5e6-96231b3b80d8
* For now, avoid generating FP select instructions in order to speculatively ↵Evan Cheng2008-06-111-4/+9
| | | | | | | | | execute integer arithmetic instructions. FP selects are more likely to be expensive (even compared to branch on fcmp). This is not a wonderful solution but I rather err on the side of conservative. This fixes the heapsort performance regressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52224 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid duplicating loop header which leads to unnatural loops (and just seem ↵Evan Cheng2008-06-111-0/+18
| | | | | | | | | like general badness to me, likely to cause code explosion). Patch by Florian Brandner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52223 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach instruction combining about the extractvalue. It can succesfully foldMatthijs Kooijman2008-06-111-0/+157
| | | | | | | | | useless insert-extract chains, similar to how it folds them for vectors. Add a testcase for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52217 91177308-0d34-0410-b5e6-96231b3b80d8
* Sometimes (rarely) nodes held in LegalizeTypesDuncan Sands2008-06-114-68/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | maps can be deleted. This happens when RAUW replaces a node N with another equivalent node E, deleting the first node. Solve this by adding (N, E) to ReplacedNodes, which is already used to remap nodes to replacements. This means that deleted nodes are being allowed in maps, which can be delicate: the memory may be reused for a new node which might get confused with the old deleted node pointer hanging around in the maps, so detect this and flush out maps if it occurs (ExpungeNode). The expunging operation is expensive, however it never occurs during a llvm-gcc bootstrap or anywhere in the nightly testsuite. It occurs three times in "make check": Alpha/illegal-element-type.ll, PowerPC/illegal-element-type.ll and X86/mmx-shift.ll. If expunging proves to be too expensive then there are other more complicated ways of solving the problem. In the normal case this patch adds the overhead of a few more map lookups, which is hopefully negligable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52214 91177308-0d34-0410-b5e6-96231b3b80d8
* Better test for availability of __gnu_cxx::stdio_filebuf.Gordon Henriksen2008-06-111-1/+7
| | | | | | | If this doesn't work, I'll write a configure test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52213 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify a comment.Matthijs Kooijman2008-06-111-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52212 91177308-0d34-0410-b5e6-96231b3b80d8
* op_iterator-ify loopsGabor Greif2008-06-101-13/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52191 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach isGAPlusOffset to respect a GlobalAddressSDNode's offsetDan Gohman2008-06-091-1/+3
| | | | | | | value, which is something that apparently isn't used much. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52158 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply 52002, allowing the verifier to accept non-MRV struct returnDan Gohman2008-06-091-4/+15
| | | | | | | | | types on functions, with adjustments so that it accepts both new-style aggregate returns and old-style MRV returns, including those with only a single member. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52157 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen support for aggregate-value function arguments.Dan Gohman2008-06-091-112/+139
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52156 91177308-0d34-0410-b5e6-96231b3b80d8
* Various tweaks related to apint codegen. No functionalityDuncan Sands2008-06-093-4/+4
| | | | | | | change for non-funky-sized integers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52151 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle empty aggregate values.Dan Gohman2008-06-091-21/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52150 91177308-0d34-0410-b5e6-96231b3b80d8
* AsmParser support for immediate constant aggregate values.Dan Gohman2008-06-094-777/+1046
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52149 91177308-0d34-0410-b5e6-96231b3b80d8
* CPPBackend support for extractvalue and insertvalue.Dan Gohman2008-06-091-0/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52147 91177308-0d34-0410-b5e6-96231b3b80d8
* Abort on an unrecognized opcode.Dan Gohman2008-06-091-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52146 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the CPP backend for the ConstantFP::get API change.Dan Gohman2008-06-091-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52144 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some DAG combiner assumptions about sizesDuncan Sands2008-06-091-28/+21
| | | | | | | | | | | | of integer types. Fix the isMask APInt method to actually work (hopefully) rather than crashing because it adds apints of different bitwidths. It looks like isShiftedMask is also broken, but I'm leaving that one to the APInt people (it is not used anywhere). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52142 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for PIC on linux x86-64Rafael Espindola2008-06-091-12/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52139 91177308-0d34-0410-b5e6-96231b3b80d8
* lower calls to abs to inline code, PR2337Chris Lattner2008-06-091-1/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52138 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2411, where ip constant prop would propagate theChris Lattner2008-06-091-0/+5
| | | | | | | result of a weak function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52137 91177308-0d34-0410-b5e6-96231b3b80d8
* use 'continue' to make the function linker simpler. When linking a strongChris Lattner2008-06-091-21/+37
| | | | | | | | function into a weak function, zap the weak function body so that the strong one overrides it. This fixes PR2410 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52135 91177308-0d34-0410-b5e6-96231b3b80d8
* minor changes to short circuit the 'no linkage' case earlier forChris Lattner2008-06-091-27/+40
| | | | | | | | function bodies. We now don't try to unify types or handling type mismatches if when linking an internal foo to an external foo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52134 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify function visibility handling.Chris Lattner2008-06-091-7/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52133 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove comparison methods for MVT. The main causeDuncan Sands2008-06-0815-104/+91
| | | | | | | | | | | | of apint codegen failure is the DAG combiner doing the wrong thing because it was comparing MVT's using < rather than comparing the number of bits. Removing the < method makes this mistake impossible to commit. Instead, add helper methods for comparing bits and use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52098 91177308-0d34-0410-b5e6-96231b3b80d8
* Limit the icmp+phi merging optimization to the cases where it is profitable:Chris Lattner2008-06-081-4/+12
| | | | | | | don't make i1 phis when it won't be possible to eliminate them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52097 91177308-0d34-0410-b5e6-96231b3b80d8
* Added FP instruction formats.Bruno Cardoso Lopes2008-06-081-1/+58
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52086 91177308-0d34-0410-b5e6-96231b3b80d8