summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* Start cleanup of PPC register definitions using foreach loops.Hal Finkel2013-01-241-65/+7
| | | | | | | | | | | No functionality change intended. This captures the first two cases GPR32/64. For the others, we need an addition operator (if we have one, I've not yet found it). Based on a suggestion made by Tom Stellard in the AArch64 review! llvm-svn: 173366
* Reapply chandlerc's r173342 now that the miscompile it was triggering is fixed.Benjamin Kramer2013-01-241-9/+18
| | | | | | | | | | | | | | | | | | | | Original commit message: Plug TTI into the speculation logic, giving it a real cost interface that can be specialized by targets. The goal here is not to be more aggressive, but to just be more accurate with very obvious cases. There are instructions which are known to be truly free and which were not being modeled as such in this code -- see the regression test which is distilled from an inner loop of zlib. Everywhere the TTI cost model is insufficiently conservative I've added explicit checks with FIXME comments to go add proper modelling of these cost factors. If this causes regressions, the likely solution is to make TTI even more conservative in its cost estimates, but test cases will help here. llvm-svn: 173357
* ConstantFolding: Add a missing folding that leads to a miscompile.Benjamin Kramer2013-01-241-4/+4
| | | | | | | | | | We use constant folding to see if an intrinsic evaluates to the same value as a constant that we know. If we don't take the undefinedness into account we get a value that doesn't match the actual implementation, and miscompiled code. This was uncovered by Chandler's simplifycfg changes. llvm-svn: 173356
* Revert r173342 temporarily. It appears to cause a very late miscompileChandler Carruth2013-01-241-18/+9
| | | | | | of stage2 in a bootstrap. Still investigating.... llvm-svn: 173343
* Plug TTI into the speculation logic, giving it a real cost interfaceChandler Carruth2013-01-241-9/+18
| | | | | | | | | | | | | | | | | | that can be specialized by targets. The goal here is not to be more aggressive, but to just be more accurate with very obvious cases. There are instructions which are known to be truly free and which were not being modeled as such in this code -- see the regression test which is distilled from an inner loop of zlib. Everywhere the TTI cost model is insufficiently conservative I've added explicit checks with FIXME comments to go add proper modelling of these cost factors. If this causes regressions, the likely solution is to make TTI even more conservative in its cost estimates, but test cases will help here. llvm-svn: 173342
* Address a large chunk of this FIXME by accumulating the cost forChandler Carruth2013-01-241-8/+6
| | | | | | | unfolded constant expressions rather than checking each one independently. llvm-svn: 173341
* Switch the constant expression speculation cost evaluation away fromChandler Carruth2013-01-241-7/+14
| | | | | | | | | | | | | | | | | | | | a cost fuction that seems both a bit ad-hoc and also poorly suited to evaluating constant expressions. Notably, it is missing any support for trivial expressions such as 'inttoptr'. I could fix this routine, but it isn't clear to me all of the constraints its other users are operating under. The core protection that seems relevant here is avoiding the formation of a select instruction wich a further chain of select operations in a constant expression operand. Just explicitly encode that constraint. Also, update the comments and organization here to make it clear where this needs to go -- this should be driven off of real cost measurements which take into account the number of constants expressions and the depth of the constant expression tree. llvm-svn: 173340
* Rephrase the speculating scan of the conditional BB to be phrased inChandler Carruth2013-01-241-19/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | terms of cost rather than hoisting a single instruction. This does *not* change the cost model! We still set the cost threshold at 1 here, it's just that we track it by accumulating cost rather than by storing an instruction. The primary advantage is that we no longer leave no-op intrinsics in the basic block. For example, this will now move both debug info intrinsics and a single instruction, instead of only moving the instruction and leaving a basic block with nothing bug debug info intrinsics in it, and those intrinsics now no longer ordered correctly with the hoisted value. Instead, we now splice the entire conditional basic block's instruction sequence. This also places the code for checking the safety of hoisting next to the code computing the cost. Currently, the only observable side-effect of this change is that debug info intrinsics are no longer abandoned. I'm not sure how to craft a test case for this, and my real goal was the refactoring, but I'll talk to Dave or Eric about how to add a test case for this. llvm-svn: 173339
* [asan] fix 32-bit buildsKostya Serebryany2013-01-241-3/+3
| | | | llvm-svn: 173338
* Simplify the PHI node operand rewriting.Chandler Carruth2013-01-241-42/+35
| | | | | | | | | | | | | | | | | | Previously, the code would scan the PHI nodes and build up a small setvector of candidate value pairs in phi nodes to go and rewrite. Once certain the rewrite could be performed, the code walks the set, and for each one re-scans the entire PHI node list looking for nodes to rewrite operands. Instead, scan the PHI nodes once to check for hazards, and then scan it a second time to rewrite the operands to selects. No set vector, and a max of two scans. The only downside is that we might form identical selects, but instcombine or anything else should fold those easily, and it seems unlikely to happen often. llvm-svn: 173337
* [asan] adaptive redzones for globals (the larger the global the larger is ↵Kostya Serebryany2013-01-241-3/+13
| | | | | | the redzone) llvm-svn: 173335
* Give the basic block variables here names based on the if-then-endChandler Carruth2013-01-241-32/+33
| | | | | | structure being analyzed. No functionality changed. llvm-svn: 173334
* Lift a cheap early exit test above loops and other complex early exitChandler Carruth2013-01-241-5/+5
| | | | | | | | | tests. No need to pay the high cost when we're never going to do anything. No functionality changed. llvm-svn: 173331
* Spiff up the comment on this method, making the example a bit moreChandler Carruth2013-01-241-16/+35
| | | | | | | | | | | pretty in doxygen, adding some of the details actually present in a classic example where this matters (a loop from gzip and many other compression algorithms), and a cautionary note about the risks inherent in the transform. This has come up on the mailing lists recently, and I suspect folks reading this code could benefit from going and looking at the MI pass that can really deal with these issues. llvm-svn: 173329
* MipsISelLowering.cpp: Fill unreachable paths to fix warnings. ↵NAKAMURA Takumi2013-01-241-0/+6
| | | | | | | | [-Wsometimes-uninitialized] FIXME: Could they, unreachable(s), be removed? FIXME: I could prefer the coding standards... llvm-svn: 173325
* MipsISelLowering.cpp: Fix a warning, take two. [-Wunused-variable]NAKAMURA Takumi2013-01-241-2/+2
| | | | | | ...and fix a typo, s/#ifdef/#ifndef/ llvm-svn: 173324
* MipsISelLowering.cpp: Fix a warning. [-Wunused-variable]NAKAMURA Takumi2013-01-241-3/+5
| | | | llvm-svn: 173323
* Remove trailing whitespace.Craig Topper2013-01-241-134/+134
| | | | llvm-svn: 173322
* The next phase of Mips16 hard float implementation.Reed Kotler2013-01-242-36/+246
| | | | | | | | | | | | | | | | Allow Mips16 routines to call Mips32 routines that have abi requirements that either arguments or return values are passed in floating point registers. This handles only the pic case. We have not done non pic for Mips16 yet in any form. The libm functions are Mips32, so with this addition we have a complete Mips16 hard float implementation. We still are not able to complete mix Mip16 and Mips32 with hard float. That will be the next phase which will have several steps. For Mips32 to freely call Mips16 some stub functions must be created. llvm-svn: 173320
* MachineScheduler: enable biasCriticalPath for all DAGs.Andrew Trick2013-01-241-0/+4
| | | | llvm-svn: 173318
* MIsched: Added biasCriticalPath.Andrew Trick2013-01-241-0/+15
| | | | | | | Allow schedulers to order DAG edges by critical path. This makes DFS-based heuristics more stable and effective. llvm-svn: 173317
* Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.Bill Wendling2013-01-242-6/+14
| | | | llvm-svn: 173313
* Cleanup the AttributeSetNodes that we create.Bill Wendling2013-01-241-0/+7
| | | | llvm-svn: 173311
* Create a new class: AttributeSetNode.Bill Wendling2013-01-243-1/+107
| | | | | | | | | | This is a helper class for the AttributeSetImpl class. It holds a set of attributes that apply to a single element: function, return type, or parameter. These are uniqued. llvm-svn: 173310
* Push down the conversion of the alignment from the bit mask to a real number ↵Bill Wendling2013-01-231-4/+6
| | | | | | into the attribute implementation class. llvm-svn: 173304
* Remove dead methods.Bill Wendling2013-01-232-23/+0
| | | | llvm-svn: 173302
* R600: Add a llvm.R600.store.swizzle intrinsicsTom Stellard2013-01-233-2/+31
| | | | | | | | | | This intrinsic is translated to ALLOC_EXPORT_WORD1_SWIZ, hence its name. It is used to store vs/fs outputs Patch by: Vincent Lejeune Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 173297
* R600: Simplify stream outputs intrinsicTom Stellard2013-01-235-47/+13
| | | | | | | Patch by: Vincent Lejeune Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 173296
* ConstantFolding: Tweak r173289, it should evaluate in the intptr type, not ↵Benjamin Kramer2013-01-231-18/+15
| | | | | | the index type. llvm-svn: 173293
* ConstantFolding: Evaluate GEP indices in the index type.Benjamin Kramer2013-01-231-2/+11
| | | | | | | This fixes some edge cases that we would get wrong with uint64_ts. PR14986. llvm-svn: 173289
* Add instruction encodings / disassembly support for l6r instructions.Richard Osborne2013-01-233-6/+34
| | | | llvm-svn: 173288
* Revert "InstCombine: Clean up weird code that talks about a modulus that's ↵Benjamin Kramer2013-01-231-1/+6
| | | | | | | | | long gone." This causes crashes during the build of compiler-rt during selfhost. Add a testcase for coverage. llvm-svn: 173279
* InstCombine: Clean up weird code that talks about a modulus that's long gone.Benjamin Kramer2013-01-231-6/+1
| | | | | | | This does the right thing unless the multiplication overflows, but the old code didn't handle that case either. llvm-svn: 173276
* Fix powerpc test failure - forgot to initialize stack slot size for ↵Eli Bendersky2013-01-231-2/+3
| | | | | | PPCLinuxMCAsmInfo llvm-svn: 173275
* Clean up assignment of CalleeSaveStackSlotSize: get rid of the default and ↵Eli Bendersky2013-01-236-10/+14
| | | | | | explicitly set this in every target that needs to change it from the default. llvm-svn: 173270
* NVPTX: Stop leaking memory by using a managed constant instead of a new ↵Benjamin Kramer2013-01-231-3/+5
| | | | | | | | | Argument. This is still an egregious hack since we don't have a nice interface for this kind of thing but should help the valgrind leak check buildbot to become green. llvm-svn: 173267
* Make sure metarenamer won't rename special stuff (intrinsics and explicitly ↵Anton Korobeynikov2013-01-231-3/+17
| | | | | | | | renamed stuff). Otherwise this might hide the problems. llvm-svn: 173265
* [asan] use ADD instead of OR when applying shadow offset of PowerPC. See ↵Kostya Serebryany2013-01-231-4/+15
| | | | | | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55975 for details llvm-svn: 173258
* Initialize the components of this class. Otherwise GCC thinks that Array may beDuncan Sands2013-01-231-1/+2
| | | | | | | | used uninitialized, since it fails to understand that Array is only used when SingleValue is not, and outputs a warning. It also seems generally safer given that the constructor is non-trivial and has plenty of early exits. llvm-svn: 173242
* Add the heuristic to differentiate SSPStrong from SSPRequired.Bill Wendling2013-01-231-23/+103
| | | | | | | | | | | | | | | | | | The requirements of the strong heuristic are: * A Protector is required for functions which contain an array, regardless of type or length. * A Protector is required for functions which contain a structure/union which contains an array, regardless of type or length. Note, there is no limit to the depth of nesting. * A protector is required when the address of a local variable (i.e., stack based variable) is exposed. (E.g., such as through a local whose address is taken as part of the RHS of an assignment or a local whose address is taken as part of a function argument.) llvm-svn: 173231
* Add the IR attribute 'sspstrong'.Bill Wendling2013-01-237-15/+53
| | | | | | | | | | | | | | | | | | | | | SSPStrong applies a heuristic to insert stack protectors in these situations: * A Protector is required for functions which contain an array, regardless of type or length. * A Protector is required for functions which contain a structure/union which contains an array, regardless of type or length. Note, there is no limit to the depth of nesting. * A protector is required when the address of a local variable (i.e., stack based variable) is exposed. (E.g., such as through a local whose address is taken as part of the RHS of an assignment or a local whose address is taken as part of a function argument.) This patch implements the SSPString attribute to be equivalent to SSPRequired. This will change in a subsequent patch. llvm-svn: 173230
* Remove the last of uses that use the Attribute object as a collection of ↵Bill Wendling2013-01-238-54/+88
| | | | | | | | | attributes. Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. llvm-svn: 173228
* R600: rework handling of the constantsTom Stellard2013-01-2316-104/+483
| | | | | | | | | | | | | | | | | | | | Remove Cxxx registers, add new special register - "ALU_CONST" and new operand for each alu src - "sel". ALU_CONST is used to designate that the new operand contains the value to override src.sel, src.kc_bank, src.chan for constants in the driver. Patch by: Vadim Girlin Vincent Lejeune: - Use pointers for constants - Fold CONST_ADDRESS when possible Tom Stellard: - Give CONSTANT_BUFFER_0 its own address space - Use integer types for constant loads Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 173222
* R600: Add a CONST_ADDRESS node to model constant buf readTom Stellard2013-01-233-1/+12
| | | | | | | Patch by: Vincent Lejeune Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 173221
* R600: Factorise VTX_WORD0 and VTX_WORD1 in tblgen defTom Stellard2013-01-231-45/+65
| | | | | | | Patch by: Vincent Lejeune Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 173220
* Add support for reverse pointer induction variables. These are loops that ↵Nadav Rotem2013-01-231-7/+82
| | | | | | | | | | | | | contain pointers that count backwards. For example, this is the hot loop in BZIP: do { m = *--p; *p = ( ... ); } while (--n); llvm-svn: 173219
* Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKindBill Wendling2013-01-237-20/+44
| | | | | | when removing one attribute. This further encapsulates the use of the attributes. llvm-svn: 173214
* Use the AttributeSet when adding multiple attributes and an Attribute::AttrKindBill Wendling2013-01-232-10/+15
| | | | | | when adding a single attribute to the function. llvm-svn: 173210
* Add instruction encodings / disassembly support for u10 / lu10 instructions.Richard Osborne2013-01-222-12/+22
| | | | llvm-svn: 173204
* Fixed typo.Michael Gottesman2013-01-221-2/+1
| | | | llvm-svn: 173202
OpenPOWER on IntegriCloud