aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* make these tests a bit less fragileChris Lattner2010-12-132-12/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121682 91177308-0d34-0410-b5e6-96231b3b80d8
* factor new code out to a SimplifyBranchOnICmpChain helper function.Chris Lattner2010-12-131-77/+91
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121681 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance the "change or icmp's into switch" xform to handle one value in an Chris Lattner2010-12-132-5/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'or sequence' that it doesn't understand. This allows us to optimize something insane like this: int crud (unsigned char c, unsigned x) { if(((((((((( (int) c <= 32 || (int) c == 46) || (int) c == 44) || (int) c == 58) || (int) c == 59) || (int) c == 60) || (int) c == 62) || (int) c == 34) || (int) c == 92) || (int) c == 39) != 0) foo(); } into: define i32 @crud(i8 zeroext %c, i32 %x) nounwind ssp noredzone { entry: %cmp = icmp ult i8 %c, 33 br i1 %cmp, label %if.then, label %switch.early.test switch.early.test: ; preds = %entry switch i8 %c, label %if.end [ i8 39, label %if.then i8 44, label %if.then i8 58, label %if.then i8 59, label %if.then i8 60, label %if.then i8 62, label %if.then i8 46, label %if.then i8 92, label %if.then i8 34, label %if.then ] by pulling the < comparison out ahead of the newly formed switch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121680 91177308-0d34-0410-b5e6-96231b3b80d8
* merge two testsChris Lattner2010-12-132-30/+42
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121679 91177308-0d34-0410-b5e6-96231b3b80d8
* merge two very similar functions into one that has a bool argument.Chris Lattner2010-12-131-47/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121678 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable auto-detection of AVX support since AVX codegen support is not ready.Evan Cheng2010-12-132-2/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121677 91177308-0d34-0410-b5e6-96231b3b80d8
* don't bother handling non-canonical icmp'sChris Lattner2010-12-131-11/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121676 91177308-0d34-0410-b5e6-96231b3b80d8
* inline a function, making the result much simpler.Chris Lattner2010-12-131-27/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121675 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix my previous patch to handle a degenerate case that the llvm-gccChris Lattner2010-12-132-0/+39
| | | | | | | bootstrap buildbot tripped over. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121674 91177308-0d34-0410-b5e6-96231b3b80d8
* convert some methods to be static functionsChris Lattner2010-12-131-25/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121673 91177308-0d34-0410-b5e6-96231b3b80d8
* zap two more std::sorts.Chris Lattner2010-12-131-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121672 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a fairly serious oversight with switch formation fromChris Lattner2010-12-132-2/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or'd conditions. Previously we'd compile something like this: int crud (unsigned char c) { return c == 62 || c == 34 || c == 92; } into: switch i8 %c, label %lor.rhs [ i8 62, label %lor.end i8 34, label %lor.end ] lor.rhs: ; preds = %entry %cmp8 = icmp eq i8 %c, 92 br label %lor.end lor.end: ; preds = %entry, %entry, %lor.rhs %0 = phi i1 [ true, %entry ], [ %cmp8, %lor.rhs ], [ true, %entry ] %lor.ext = zext i1 %0 to i32 ret i32 %lor.ext which failed to merge the compare-with-92 into the switch. With this patch we simplify this all the way to: switch i8 %c, label %lor.rhs [ i8 62, label %lor.end i8 34, label %lor.end i8 92, label %lor.end ] lor.rhs: ; preds = %entry br label %lor.end lor.end: ; preds = %entry, %entry, %entry, %lor.rhs %0 = phi i1 [ true, %entry ], [ false, %lor.rhs ], [ true, %entry ], [ true, %entry ] %lor.ext = zext i1 %0 to i32 ret i32 %lor.ext which is much better for codegen's switch lowering stuff. This kicks in 33 times on 176.gcc (for example) cutting 103 instructions off the generated code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121671 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify code and reduce indentationChris Lattner2010-12-131-32/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121670 91177308-0d34-0410-b5e6-96231b3b80d8
* convert an std::sort to array_pod_sort.Chris Lattner2010-12-131-2/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121669 91177308-0d34-0410-b5e6-96231b3b80d8
* move the "br (X == 0 | X == 1), T, F" -> switch optimization to a newChris Lattner2010-12-131-57/+56
| | | | | | | | | | | | | location in simplifycfg. In the old days, SimplifyCFG was never run on the entry block, so we had to scan over all preds of the BB passed into simplifycfg to do this xform, now we can just check blocks ending with a condbranch. This avoids a scan over all preds of every simplified block, which should be a significant compile-time perf win on functions with lots of edges. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121668 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce indentation and generally simplify code, no functionality change.Chris Lattner2010-12-131-333/+309
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121667 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for using the `!if' operator when initializing variables:Bill Wendling2010-12-134-21/+127
| | | | | | | | | | | | class A<bit a, bits<3> x, bits<3> y> { bits<3> z; let z = !if(a, x, y); } The variable z will get the value of x when 'a' is 1 and 'y' when a is '0'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121666 91177308-0d34-0410-b5e6-96231b3b80d8
* use getFirstNonPHIOrDbg to simplify this code.Chris Lattner2010-12-131-9/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121664 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce indentation by using continue, no functionality change.Chris Lattner2010-12-131-38/+41
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121662 91177308-0d34-0410-b5e6-96231b3b80d8
* Move <map> include out of .h and into .cpp.Bill Wendling2010-12-132-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121661 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge DEBUG statements.Bill Wendling2010-12-131-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121660 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the Records global variable, patch by Garrison Venn!Chris Lattner2010-12-1321-59/+104
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121659 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up RecordKeeper::getAllDerivedDefinitions, patch by Garrison Venn!Chris Lattner2010-12-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121658 91177308-0d34-0410-b5e6-96231b3b80d8
* further fixes.Chris Lattner2010-12-131-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121657 91177308-0d34-0410-b5e6-96231b3b80d8
* add a noteChris Lattner2010-12-131-0/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121656 91177308-0d34-0410-b5e6-96231b3b80d8
* Missed some ADDI <-> ADDIK conversions in 121649.Wesley Peck2010-12-122-10/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121652 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting commit to LLVMLibDeps that was inadvertently done in 121649.Wesley Peck2010-12-121-51/+50
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121651 91177308-0d34-0410-b5e6-96231b3b80d8
* MBlaze delay slot filler was not capable of using ADDK and variants to fill ↵Wesley Peck2010-12-121-1/+18
| | | | | | delay slots. This broke several test cases when 121649 was committed. This fixes the regression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121650 91177308-0d34-0410-b5e6-96231b3b80d8
* The ADD and ADDK (and all variants) instructions where flip-flopped in the ↵Wesley Peck2010-12-129-99/+100
| | | | | | MBlaze backend. This bug fix makes 64-bit math work on the MBlaze backend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121649 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove useless dynamic_cast<>().Tobias Grosser2010-12-121-2/+1
| | | | | | | Thanks Peter for pointing me to something that should have never been committed to the llvm code base. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121648 91177308-0d34-0410-b5e6-96231b3b80d8
* Regen configurePeter Collingbourne2010-12-121-1003/+1360
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121646 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix paths; AutoRegen.sh changes its current working directory to be thePeter Collingbourne2010-12-122-7/+11
| | | | | | | | | | autoconf directory, but these paths need to be relative to the main source directory. Patch originally by Dan Gohman, r67655. Also, cause configure.ac to find absolute paths to LLVM source and object trees. Together, fixes PR1220. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121645 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Change MBlaze indirect branches to use absolute branch BRALD instead of ↵Wesley Peck2010-12-125-12/+158
| | | | | | | | | | pc relative branch BRLD. 2. Make sure that the MBlaze stack is aligned to 4-byte boundaries. 3. Determine frame indexes that should be placed in the callers stack frame, as per the MBlaze ABI, and place them in the correct locations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121639 91177308-0d34-0410-b5e6-96231b3b80d8
* Catch attempts to remove a deleted node from the CSE maps. Better toDuncan Sands2010-12-121-3/+2
| | | | | | | | catch this here rather than later after accessing uninitialized memory etc. Fires when compiling the testcase in PR8237. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121635 91177308-0d34-0410-b5e6-96231b3b80d8
* fix typoChris Lattner2010-12-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121620 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the and-icmp-select instcombine further by allowing selects of ↵Benjamin Kramer2010-12-113-16/+72
| | | | | | | | | | | | the form (x & 2^n) ? 2^m+C : C we can offset both arms by C to get the "(x & 2^n) ? 2^m : 0" form, optimize the select to a shift and apply the offset afterwards. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121609 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor the (x & 2^n) ? 2^m : 0 instcombine into its own method and generalize itBenjamin Kramer2010-12-113-66/+79
| | | | | | | to catch cases where n != m with a shift. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121608 91177308-0d34-0410-b5e6-96231b3b80d8
* (or (and (shl A, #shamt), mask), B) => ARMbfi B, A, ~mask where lsb(mask) == ↵Evan Cheng2010-12-114-19/+62
| | | | | | #shamt. rdar://8752056 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121606 91177308-0d34-0410-b5e6-96231b3b80d8
* Add named timer groups for the different stages of register allocation.Jakob Stoklund Olesen2010-12-113-9/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121604 91177308-0d34-0410-b5e6-96231b3b80d8
* Move MRI into RegAllocBase. Clean up debug output a bit.Jakob Stoklund Olesen2010-12-103-31/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121599 91177308-0d34-0410-b5e6-96231b3b80d8
* Add FIXMEJim Grosbach2010-12-101-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121598 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extraneous close parenthesis.Nick Lewycky2010-12-101-1/+1
| | | | | | | Fix build breakage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121596 91177308-0d34-0410-b5e6-96231b3b80d8
* Move variable that's unused in an NDEBUG build inside the DEBUG() macro, fixingNick Lewycky2010-12-101-3/+4
| | | | | | | lib/CodeGen/RegAllocGreedy.cpp:233: error: unused variable 'TRC' [-Wunused-variable] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121594 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to get Thumb2 branch fixups working properly.Owen Anderson2010-12-102-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121593 91177308-0d34-0410-b5e6-96231b3b80d8
* Force the greedy register allocator to always use the inline spiller.Jakob Stoklund Olesen2010-12-103-7/+8
| | | | | | | Soon, RegAllocGreedy will start splitting live ranges, and then deferred spilling won't work anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121591 91177308-0d34-0410-b5e6-96231b3b80d8
* Rip out live range splitting support from the inline spiller.Jakob Stoklund Olesen2010-12-101-56/+1
| | | | | | | | The spiller should only spill. The register allocator will drive live range splitting, it has the needed information about register pressure and interferences. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121590 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of ellipses.Bill Wendling2010-12-101-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121589 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix merge error in my last fix to Thumb2 vldr fixups.Owen Anderson2010-12-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121588 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixups for Thumb2 vldr's need to have the effective PC aligned as well.Owen Anderson2010-12-102-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121587 91177308-0d34-0410-b5e6-96231b3b80d8
* The MCFixupKindInfo table needs to be in the order that the enums wereBill Wendling2010-12-101-16/+19
| | | | | | | declared. Add a note specifying this and spruce up the list a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121586 91177308-0d34-0410-b5e6-96231b3b80d8