aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Support/raw_ostream: Fix uninitalized variable in raw_fd_ostream constructor.Michael J. Spencer2011-01-171-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123643 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove useless Tag enumeration.Jay Foad2011-01-172-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123623 91177308-0d34-0410-b5e6-96231b3b80d8
* Split up RotateShift itinerary in SPU.Kalle Raiskila2011-01-172-38/+40
| | | | | | | | | 'rotq*' and 'shlq*' instructions go to the odd pipeline, wheras the inter-vector equivalents 'rot*', 'shl*' go to the even. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123622 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a DAGCombine to turn (ctpop x) u< 2 into (x & x-1) == 0.Benjamin Kramer2011-01-171-0/+24
| | | | | | | | | | This shaves off 4 popcounts from the hacked 186.crafty source. This is enabled even when a native popcount instruction is available. The combined code is one operation longer but it should be faster nevertheless. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123621 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash SPU BE with memory accesses with big alignmnet.Kalle Raiskila2011-01-171-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123620 91177308-0d34-0410-b5e6-96231b3b80d8
* Materialize GA addresses with movw + movt pairs for Darwin in PIC mode. e.g.Evan Cheng2011-01-1715-81/+244
| | | | | | | | | | | | | movw r0, :lower16:(L_foo$non_lazy_ptr-(LPC0_0+4)) movt r0, :upper16:(L_foo$non_lazy_ptr-(LPC0_0+4)) LPC0_0: add r0, pc, r0 It's not yet enabled by default as some tests are failing. I suspect bugs in down stream tools. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123619 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll out r123609 due to failures on the llvm-x86_64-linux-checks bot.Cameron Zwarich2011-01-173-121/+60
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123618 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the use of dominance frontiers in PromoteMemToReg. In addition toCameron Zwarich2011-01-173-60/+121
| | | | | | | | | | | | | | eliminating a potentially quadratic data structure, this also gives a 17% speedup when running -scalarrepl on test-suite + SPEC2000 + SPEC2006. My initial experiment gave a greater speedup around 25%, but I moved the dominator tree level computation from dominator tree construction to PromoteMemToReg. Since this approach to computing IDFs has a much lower overhead than the old code using precomputed DFs, it is worth looking at using this new code for the second scalarrepl pass as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123609 91177308-0d34-0410-b5e6-96231b3b80d8
* UnRevert "Revert "Archive: Replace all internal uses of PathV1 with PathV2. ↵Michael J. Spencer2011-01-161-36/+36
| | | | | | The external API still uses PathV1."" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123605 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix rename.Michael J. Spencer2011-01-161-2/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123604 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide instruction sizes for ARMv5 variants of MUL instructions.Anton Korobeynikov2011-01-161-29/+30
| | | | | | This fixes PR8987 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123598 91177308-0d34-0410-b5e6-96231b3b80d8
* Update README.txt to remove the DAE enhancement.Anders Carlsson2011-01-161-23/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123597 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach DAE to look for functions whose arguments are unused, and change all ↵Anders Carlsson2011-01-161-1/+61
| | | | | | callers to pass in an undefvalue instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123596 91177308-0d34-0410-b5e6-96231b3b80d8
* UnRevert "Revert the archive part of "Support/PathV2: Add identify_magic.""Michael J. Spencer2011-01-162-6/+7
| | | | | | This reverts commit dd103021a889a986a181ce36ed7b0e8dc9b645e1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123595 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the archive part of "Support/PathV2: Add identify_magic."Michael J. Spencer2011-01-162-7/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123593 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy up a comment, as suggested by duncanChris Lattner2011-01-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123590 91177308-0d34-0410-b5e6-96231b3b80d8
* Only put unnamed_addr constants in mergeable sections. Fixes PR8297.Rafael Espindola2011-01-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123585 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't merge two constants if we care about the address of both.Rafael Espindola2011-01-161-22/+38
| | | | | | | | | | | | | | This fixes the original testcase in PR8927. It also causes a clang binary built with a patched clang to increase in size by 0.21%. We can probably get some of the size back by writing a pass that detects that a global never has its pointer compared and adds unnamed_addr to it (maybe extend global opt). It is also possible that there are some other cases clang could add unnamed_addr to. I will investigate extending globalopt next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123584 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the construction and destruction of Uses. SimplifyJay Foad2011-01-162-24/+15
| | | | | | User::dropHungOffUses(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123580 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8514, a bug where the "heroic" transformation of shift/and Chris Lattner2011-01-161-13/+9
| | | | | | | | | | into and/shift would cause nodes to move around and a dangling pointer to happen. The code tried to avoid this with a HandleSDNode, but got the details wrong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123578 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the implementation of the User class into a new source file,Jay Foad2011-01-164-83/+89
| | | | | | User.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123575 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8932, a case where arg promotion could infinitely promote.Chris Lattner2011-01-161-24/+51
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123574 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify a littleChris Lattner2011-01-161-7/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123573 91177308-0d34-0410-b5e6-96231b3b80d8
* add some commentaryChris Lattner2011-01-161-1/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123572 91177308-0d34-0410-b5e6-96231b3b80d8
* if an alloca is only ever accessed as a unit, and is accessed with ↵Chris Lattner2011-01-161-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | load/store instructions, then don't try to decimate it into its individual pieces. This will just make a mess of the IR and is pointless if none of the elements are individually accessed. This was generating really terrible code for std::bitset (PR8980) because it happens to be lowered by clang as an {[8 x i8]} structure instead of {i64}. The testcase now is optimized to: define i64 @test2(i64 %X) { br label %L2 L2: ; preds = %0 ret i64 %X } before we generated: define i64 @test2(i64 %X) { %sroa.store.elt = lshr i64 %X, 56 %1 = trunc i64 %sroa.store.elt to i8 %sroa.store.elt8 = lshr i64 %X, 48 %2 = trunc i64 %sroa.store.elt8 to i8 %sroa.store.elt9 = lshr i64 %X, 40 %3 = trunc i64 %sroa.store.elt9 to i8 %sroa.store.elt10 = lshr i64 %X, 32 %4 = trunc i64 %sroa.store.elt10 to i8 %sroa.store.elt11 = lshr i64 %X, 24 %5 = trunc i64 %sroa.store.elt11 to i8 %sroa.store.elt12 = lshr i64 %X, 16 %6 = trunc i64 %sroa.store.elt12 to i8 %sroa.store.elt13 = lshr i64 %X, 8 %7 = trunc i64 %sroa.store.elt13 to i8 %8 = trunc i64 %X to i8 br label %L2 L2: ; preds = %0 %9 = zext i8 %1 to i64 %10 = shl i64 %9, 56 %11 = zext i8 %2 to i64 %12 = shl i64 %11, 48 %13 = or i64 %12, %10 %14 = zext i8 %3 to i64 %15 = shl i64 %14, 40 %16 = or i64 %15, %13 %17 = zext i8 %4 to i64 %18 = shl i64 %17, 32 %19 = or i64 %18, %16 %20 = zext i8 %5 to i64 %21 = shl i64 %20, 24 %22 = or i64 %21, %19 %23 = zext i8 %6 to i64 %24 = shl i64 %23, 16 %25 = or i64 %24, %22 %26 = zext i8 %7 to i64 %27 = shl i64 %26, 8 %28 = or i64 %27, %25 %29 = zext i8 %8 to i64 %30 = or i64 %29, %28 ret i64 %30 } In this case, instcombine was able to eliminate the nonsense, but in PR8980 enough PHIs are in play that instcombine backs off. It's better to not generate this stuff in the first place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123571 91177308-0d34-0410-b5e6-96231b3b80d8
* Use an irbuilder to get some trivial constant folding when doing a storeChris Lattner2011-01-161-21/+17
| | | | | | | of a constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123570 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a dead check, this was needed before we had an explicit veto on uses ↵Chris Lattner2011-01-161-5/+0
| | | | | | of phis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123569 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance FoldOpIntoPhi in instcombine to try harder when a phi hasChris Lattner2011-01-162-3/+20
| | | | | | | | | multiple uses. In some cases, all the uses are the same operation, so instcombine can go ahead and promote the phi. In the testcase this pushes an add out of the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123568 91177308-0d34-0410-b5e6-96231b3b80d8
* Spill R4 if it's going to be used to restore SP from FP.Evan Cheng2011-01-161-4/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123567 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the AllowAggressive argument to FoldOpIntoPhi. It is forced to false ↵Chris Lattner2011-01-163-14/+6
| | | | | | | | | in the first line of the function because it isn't a good idea, even for compares. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123566 91177308-0d34-0410-b5e6-96231b3b80d8
* more cleanups: use the IR builder.Chris Lattner2011-01-161-38/+39
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123565 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy up code.Chris Lattner2011-01-161-16/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123564 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve the safety of my globalopt enhancement by ensuring that the bitcastOwen Anderson2011-01-161-12/+22
| | | | | | | of the stored value to the new store type is always. Also, add a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123563 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8983, a broken assertion.Chris Lattner2011-01-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123562 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement AnalyzeBranch in Sparc Backend.Venkatraman Govindaraju2011-01-162-7/+199
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123561 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8981, a crash trying to form a conditional inc with a floating point ↵Chris Lattner2011-01-161-1/+2
| | | | | | compare. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123560 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply my fix for PR8961 with a tweak to properly handleChris Lattner2011-01-162-7/+13
| | | | | | | | multi-instruction sequences like calls. Many thanks to Jakob for finding a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123559 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify this code, it is still broken but will follow up on llvm-commits.Chris Lattner2011-01-161-15/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123558 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Archive: Replace all internal uses of PathV1 with PathV2. The ↵Michael J. Spencer2011-01-161-36/+36
| | | | | | external API still uses PathV1." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123557 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify a README.txt entry significantly to expose the core issue.Chandler Carruth2011-01-161-28/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123556 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the partial specialization pass. It is unmaintained and has bugs.Chris Lattner2011-01-163-230/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123554 91177308-0d34-0410-b5e6-96231b3b80d8
* Archive: Replace all internal uses of PathV1 with PathV2. The external API ↵Michael J. Spencer2011-01-151-36/+36
| | | | | | still uses PathV1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123551 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an assert so we don't silently miscompile ctpop for bit widths > 128.Benjamin Kramer2011-01-151-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123549 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/PathV2: Add identify_magic.Michael J. Spencer2011-01-154-40/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123548 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement CTPOP legalization with the "best" algorithm fromBenjamin Kramer2011-01-151-18/+45
| | | | | | | | | | | | | | http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel In a silly microbenchmark on a 65 nm core2 this is 1.5x faster than the old code in 32 bit mode and about 2x faster in 64 bit mode. It's also a lot shorter, especially when counting 64 bit population on a 32 bit target. I hope this is fast enough to replace Kernighan-style counting loops even when the input is rather sparse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123547 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/PathV2: Implement has_magic in terms of get_magic.Michael J. Spencer2011-01-151-26/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123545 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/PathV2: Implement get_magic.Michael J. Spencer2011-01-153-0/+74
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123544 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing whitespace.Nick Lewycky2011-01-151-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123543 91177308-0d34-0410-b5e6-96231b3b80d8
* Make constmerge a two-pass algorithm so that it won't miss mergingNick Lewycky2011-01-151-4/+34
| | | | | | | opporuntities. Fixes PR8978. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123541 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to unbreak selfhost.Benjamin Kramer2011-01-151-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123537 91177308-0d34-0410-b5e6-96231b3b80d8