aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Reinstate -O3 for LTO.David Blaikie2012-05-301-3/+3
| | | | | | | | | | | | | | | | | This broke in r144788 when the CodeGenOpt option was moved from everywhere else (specifically, from addPassesToEmitFile) to createTargetMachine. Since LTOCodeGenerator wasn't passing the 4th argument, when the 4th parameter became the 3rd, it silently continued to compile (int->bool conversion) but meant something completely different. This change preserves the existing (accidental) and previous (default) semantics of the addPassesToEmitFile and restores the previous/intended CodeGenOpt argument by passing it appropriately to createTargetMachine. (discovered by pending changes to -Wconversion to catch constant->bool conversions) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157705 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that we're dealing with a binary SCEVExpr when simplifying.Benjamin Kramer2012-05-301-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157704 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some uses of getSubRegisters() to use getSubReg() instead.Jakob Stoklund Olesen2012-05-303-10/+13
| | | | | | | It is better to address sub-registers directly by name instead of relying on their position in the sub-register list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157703 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some redundant tests.Jakob Stoklund Olesen2012-05-301-3/+1
| | | | | | | An empty list is not represented as a null pointer. Let TRI do its own shortcuts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157702 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach SCEV's icmp simplification logic that a-b == 0 is equivalent to a == b.Benjamin Kramer2012-05-303-2/+64
| | | | | | | | | | | | | | | This also required making recursive simplifications until nothing changes or a hard limit (currently 3) is hit. With the simplification in place indvars can canonicalize loops of the form for (unsigned i = 0; i < a-b; ++i) into for (unsigned i = 0; i != a-b; ++i) which used to fail because SCEV created a weird umax expr for the backedge taken count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157701 91177308-0d34-0410-b5e6-96231b3b80d8
* it's pointed out that R11 can be used for magic things, and doing things ↵Chris Lattner2012-05-303-18/+17
| | | | | | just for 64-bit registers is silly. Just optimize 3 more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157699 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the (abi-irrelevant) return convention to be able to return more than ↵Chris Lattner2012-05-302-4/+24
| | | | | | | | | | | | | | two values in integer registers. This is already supported by the fastcc convention, but it doesn't hurt to support it in the standard conventions as well. In cases where we can cheat at the calling convention, this allows us to avoid returning things through memory in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157698 91177308-0d34-0410-b5e6-96231b3b80d8
* [arm-fast-isel] Add support for the llvm.frameaddress() intrinsic.Chad Rosier2012-05-302-0/+136
| | | | | | | Patch by Jush Lu <jush.msn@gmail.com>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157696 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MCRegisterInfo::RegListIterator.Jakob Stoklund Olesen2012-05-302-6/+58
| | | | | | | | | | | Also add subclasses MCSubRegIterator, MCSuperRegIterator, and MCRegAliasIterator. These iterators provide an abstract interface to the MCRegisterInfo register lists so the internal representation can be changed without changing all clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157695 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark insertq/extrq intrinsic readnone.Benjamin Kramer2012-05-301-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157688 91177308-0d34-0410-b5e6-96231b3b80d8
* Port support for SSE4a extrq/insertq to the old jit code emitter.Benjamin Kramer2012-05-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157685 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove little semicolon that caused a lot of warnings.Benjamin Kramer2012-05-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157684 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] instrument cmpxchg and atomicrmwKostya Serebryany2012-05-302-8/+52
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157683 91177308-0d34-0410-b5e6-96231b3b80d8
* SCEV: Handle a corner case reducing AddRecExpr * AddRecExprAndrew Trick2012-05-302-1/+49
| | | | | | | | | If integer overflow causes one of the terms to reach zero, that can force the entire expression to zero. Fixes PR12929: cast<Ty>() argument of incompatible type git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157673 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformat the loop that does AddRecExpr * AddRecExpr reduction.Andrew Trick2012-05-301-55/+56
| | | | | | No functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157672 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach taildup to update livein set. rdar://11538365Evan Cheng2012-05-302-0/+165
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157663 91177308-0d34-0410-b5e6-96231b3b80d8
* If-converter models predicated defs as read + write. The read should be ↵Evan Cheng2012-05-301-1/+2
| | | | | | marked as 'undef' since it may not already be live. This appeases -verify-machineinstrs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157662 91177308-0d34-0410-b5e6-96231b3b80d8
* typo fixChris Lattner2012-05-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157661 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an insertPass API to TargetPassConfig. <rdar://problem/11498613>Bob Wilson2012-05-307-6/+70
| | | | | | | | | | Besides adding the new insertPass function, this patch uses it to enhance the existing -print-machineinstrs so that the MachineInstrs after a specific pass can be printed. Patch by Bin Zeng! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157655 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DiffListIterator public to unbreak the gcc buildbots.Jakob Stoklund Olesen2012-05-301-1/+1
| | | | | | Apparently, a friend can't derive from a private class according to gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157654 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MCRegUnitIterator to compute regsOverlap().Jakob Stoklund Olesen2012-05-291-3/+9
| | | | | | | | | | The register unit lists are typically much shorter than the register overlap lists, and the backing table for register units has better cache locality because it is smaller. This makes llc about 0.5% faster. The regsOverlap() function isn't that hot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157651 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit register unit lists for each register.Jakob Stoklund Olesen2012-05-294-5/+196
| | | | | | | | | | | | | | | | Register units are already used internally in TableGen to compute register pressure sets and overlapping registers. This patch makes them available to the code generators. The register unit lists are differentially encoded so they can be reused for many related registers. This keeps the total size of the lists below 200 bytes for most targets. ARM has the largest table at 560 bytes. Add an MCRegUnitIterator for traversing the register unit lists. It provides an abstract interface so the representation can be changed in the future without changing all clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157650 91177308-0d34-0410-b5e6-96231b3b80d8
* bounds checking:Nuno Lopes2012-05-291-13/+51
| | | | | | | - hoist checks out of loops where SCEV is smart enough - add additional statistics to measure how much we loose for not supporting interprocedural and pointers loaded from memory git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157649 91177308-0d34-0410-b5e6-96231b3b80d8
* DenseMap's move assignment operator needs to return *thisDouglas Gregor2012-05-291-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157644 91177308-0d34-0410-b5e6-96231b3b80d8
* Optional def can be either a def or a use (of reg0).Evan Cheng2012-05-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add intrinsics, code gen, assembler and disassembler support for the SSE4a ↵Benjamin Kramer2012-05-298-6/+145
| | | | | | | | | | | extrq and insertq instructions. This required light surgery on the assembler and disassembler because the instructions use an uncommon encoding. They are the only two instructions in x86 that use register operands and two immediates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157634 91177308-0d34-0410-b5e6-96231b3b80d8
* Clear the entering, exiting and internal ranges of a bundle before collectingLang Hames2012-05-291-0/+3
| | | | | | | | | | | | ranges for the instruction about to be bundled. This fixes a bug in an external project where an assertion was triggered due to spurious 'multiple defs' within the bundle. Patch by Ivan Llopard. Thanks Ivan! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157632 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CPPBackend to new API for AttrListPtr::get.Nicolas Geoffray2012-05-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157624 91177308-0d34-0410-b5e6-96231b3b80d8
* ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to ↵Stepan Dyatkovskiy2012-05-2913-109/+95
| | | | | | IntegersSubsetMapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm.fabs intrinsic.Peter Collingbourne2012-05-283-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157594 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix suspicous hasOneUse() check, found by PVS Studio (PR12357).Benjamin Kramer2012-05-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157592 91177308-0d34-0410-b5e6-96231b3b80d8
* InstCombine: Fix infinite loop when encountering switch on trivial icmp.Benjamin Kramer2012-05-282-1/+40
| | | | | | | | | | | | The test case feeds the following into InstCombine's visitSelect: %tobool8 = icmp ne i32 0, 0 %phitmp = select i1 %tobool8, i32 3, i32 0 Then instcombine replaces the right side of the switch with 0, doesn't notice that nothing changes and tries again indefinitely. This fixes PR12897. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157587 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused variable.David Blaikie2012-05-281-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157586 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12696: Attribute bits above 1<<30 are not encoded in bitcodeMeador Inge2012-05-284-26/+211
| | | | | | | | | | Attribute bits above 1<<30 are now encoded correctly. Additionally, the encoding/decoding functionality has been hoisted to helper functions in Attributes.h in an effort to help the encoding/decoding to stay in sync with the Attribute bitcode definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157581 91177308-0d34-0410-b5e6-96231b3b80d8
* Random BitcodeReader cleanups.Benjamin Kramer2012-05-281-49/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157577 91177308-0d34-0410-b5e6-96231b3b80d8
* PR1255: Case RangesStepan Dyatkovskiy2012-05-2811-154/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now? 1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst. 2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case. 3. IntItem can be easyly easily replaced with APInt. 4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes. Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code ConstantInt *V = ...; if (V->getValue().ugt(AnotherV->getValue()) { ... } will look awful. Much more better this way: IntItem V = ConstantIntVal->getValue(); if (AnotherV < V) { } Of course any reviews are welcome. P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks). Since in future these classes will founded on APInt, it will possible to use them in more generic ways. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157576 91177308-0d34-0410-b5e6-96231b3b80d8
* SwitchInst: Due to bad readability case iterators definition was moved to ↵Stepan Dyatkovskiy2012-05-281-131/+139
| | | | | | the end of SwitchInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157575 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the indirect counter increment code in a better way. Instead ofBill Wendling2012-05-281-53/+72
| | | | | | | | | replicating the code for every place it's needed, we instead generate a function that does that for us. This function is local to the executable, so there shouldn't be any writing violations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157564 91177308-0d34-0410-b5e6-96231b3b80d8
* switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients.Chris Lattner2012-05-289-57/+43
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157556 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify code.Chris Lattner2012-05-281-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157555 91177308-0d34-0410-b5e6-96231b3b80d8
* add some helper methods to make the type more uniform.Chris Lattner2012-05-281-0/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157554 91177308-0d34-0410-b5e6-96231b3b80d8
* rdar://11542750 - llvm.trap should be marked no return.Chris Lattner2012-05-276-8/+43
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157551 91177308-0d34-0410-b5e6-96231b3b80d8
* DenseMap: Use an early exit when there is nothing to do in DestroyAll().Benjamin Kramer2012-05-271-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157550 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12967: Don't crash when trying to fold a shift that's larger than the ↵Benjamin Kramer2012-05-272-1/+62
| | | | | | type's size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157548 91177308-0d34-0410-b5e6-96231b3b80d8
* IntrusiveRefCntPtr: Use the same pattern as the other operator= overloads ↵Benjamin Kramer2012-05-271-4/+3
| | | | | | when using rvalue refs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157546 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement the intrinsic verifier to use the same table as ↵Chris Lattner2012-05-273-403/+107
| | | | | | | | | | | | | | Intrinsic::getDefinition, making it stronger and more sane. Delete the code from tblgen that produced the old code. Besides being a path forward in intrinsic sanity, this also eliminates a bunch of machine generated code that was compiled into Function.o git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157545 91177308-0d34-0410-b5e6-96231b3b80d8
* These tests used intrinsics with the wrong prototype. They weren't caught ↵Chris Lattner2012-05-274-26/+28
| | | | | | | | | | because the old verifier just checked that something "was a pointer", but not that the pointee was correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157544 91177308-0d34-0410-b5e6-96231b3b80d8
* remove two (useless) tests that use incorrect intrinsic prototypes, detected ↵Chris Lattner2012-05-272-55/+0
| | | | | | by the new intrinsic verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157543 91177308-0d34-0410-b5e6-96231b3b80d8
* generalize this to allow any argument.Chris Lattner2012-05-271-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157542 91177308-0d34-0410-b5e6-96231b3b80d8
* Have getOrCreateSubprogramDIE store the DIE for a subprogramPeter Collingbourne2012-05-272-5/+243
| | | | | | | | | definition in the map before calling itself to retrieve the DIE for the declaration. Without this change, if this causes getOrCreateSubprogramDIE to be recursively called on the definition, it will create multiple DIEs for that definition. Fixes PR12831. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157541 91177308-0d34-0410-b5e6-96231b3b80d8