Commit Graph

45848 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
1841d14eff Drop RAGreedy::trySpillInterferences().
This is a waste of time since we already know how to evict all interferences
which is a better approach anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126798 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 23:14:48 +00:00
Oscar Fuentes
9bf9aa5106 Fixes warnings emitted by Visual Studio 2010 compiler.
Patch by Erik Olofsson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 23:11:57 +00:00
Devang Patel
0478c15d1e If argument numbering is encoded in metadata then emit arguments' debug info in that order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 22:58:55 +00:00
Devang Patel
e9e16c5f52 Today, the language front ends produces llvm.dbg.* intrinsics, used to encode arguments' debug info, in order any way, most of the times. However, if a front end mix-n-matches llvm.dbg.declare and llvm.dbg.value intrinsics to encode debug info for arguments then code generator needs a way to find argument order.
Use 8 bits from line number field to keep track of argument ordering while encoding debug info for an argument. That leaves 24 bit for line no, DebugLoc also allocates 24 bit for line numbers. If a function has more than 255 arguments then rest of the arguments will be ordered by llvm.dbg.* intrinsics' ordering in IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 22:58:13 +00:00
Cameron Zwarich
4c078f0d6d Stop computing the number of uses twice per value in CodeGenPrepare's sinking of
addressing code. On 403.gcc this almost halves CodeGenPrepare time and reduces
total llc time by 9.5%. Unfortunately, getNumUses() is still the hottest function
in llc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 21:13:53 +00:00
Jakob Stoklund Olesen
22a1df6bf2 Keep track of which stage produced a live range, and bypass earlier stages when revisiting.
This effectively disables the 'turbo' functionality of the greedy register
allocator where all new live ranges created by splitting would be reconsidered
as if they were originals.

There are two reasons for doing this, 1. It guarantees that the algorithm
terminates. Early versions were prone to infinite looping in certain corner
cases. 2. It is a 2x speedup. We can skip a lot of unnecessary interference
checks that won't lead to good splitting anyway.

The problem is that region splitting only gets one shot, so it should probably
be changed to target multiple physical registers at once.

Local live range splitting is still 'turbo' enabled. It only accounts for a
small fraction of compile time, so it is probably not necessary to do anything
about that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126781 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 21:10:07 +00:00
Duncan Sands
c92cb649e3 Add datalayout information for the IEEE quad precision fp128 type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126780 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 20:56:50 +00:00
Dan Gohman
898fd7fd61 Revert PathV2 changes, as sys::fs::unique_file is not finished yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126773 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 19:50:55 +00:00
Talin
bdcd766028 Added missing va_end().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 18:00:49 +00:00
Duncan Sands
e80338af3f Add a few missed unary cases when legalizing vector results. Put some cases
in alphabetical order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126745 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 15:15:43 +00:00
Anders Carlsson
d70be0b2c1 Make InstCombiner::FoldAndOfICmps create a ConstantRange that's the
intersection of the LHS and RHS ConstantRanges and return "false" when
the range is empty.

This simplifies some code and catches some extra cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126744 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 15:05:01 +00:00
Nick Lewycky
88cd0aadb2 Optimize "icmp pred (urem X, Y), Y" --> true/false depending on pred. There's
more work to do here, "icmp ult (urem X, 10), 11" doesn't optimize away yet.
Fixes example 3 from PR9343!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126741 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 08:15:50 +00:00
Jim Grosbach
9d40193d79 trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126733 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 01:39:05 +00:00
Jim Grosbach
2d76c84514 Generalize the register matching code in DAGISel a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126731 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 01:37:19 +00:00
Bill Wendling
a656b63ee4 Narrow right shifts need to encode their immediates differently from a normal
shift.

   16-bit: imm6<5:3> = '001', 8 - <imm> is encded in imm6<2:0>
   32-bit: imm6<5:4> = '01',16 - <imm> is encded in imm6<3:0>
   64-bit: imm6<5> = '1', 32 - <imm> is encded in imm6<4:0>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126723 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 01:00:59 +00:00
Eli Friedman
f291ab2fba Add an obvious missing safety check to DAE::RemoveDeadArgumentsFromCallers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126720 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 00:33:47 +00:00
Chris Lattner
d3e768ecab add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126719 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 00:24:51 +00:00
Ted Kremenek
918de31976 Unbreak CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126717 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 00:02:51 +00:00
Ted Kremenek
8e77a1be09 Unbreak CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126715 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 23:56:33 +00:00
Talin
41ee4e57ea Add an END_WITH_NULL accessor for ConstantStruct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126714 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 23:53:27 +00:00
Chris Lattner
e7200684b0 update cmake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126694 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 22:45:25 +00:00
Renato Golin
728ff0db78 Fix .fpu printing in ARM assembly, regarding bug http://llvm.org/bugs/show_bug.cgi?id=8931
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126689 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 22:04:27 +00:00
Kevin Enderby
4da434cd40 Add missing whitespace in the formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126687 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 21:45:12 +00:00
Jan Sjödin
2ddfd95d40 Make all static functions become static class methods. Move shared (duplicated) functions to new MCELF class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126686 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 21:45:04 +00:00
Owen Anderson
6973289208 Use the correct shift amount type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 21:10:10 +00:00
Owen Anderson
c6d160bfa2 Clean whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126683 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 20:57:56 +00:00
Chris Lattner
99825b4455 fix a signed comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126682 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 20:50:35 +00:00
Dan Gohman
00141694fa Delete the GEPSplitter experiment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126671 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:47:47 +00:00
Dan Gohman
1551abdea6 Delete the SimplifyHalfPowrLibCalls pass, which was unused, and
only existed as the result of a misunderstanding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:41:14 +00:00
Dan Gohman
c92383fd0d Delete the LiveValues pass. I won't get get back to the project it
was started for in the foreseeable future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:37:59 +00:00
David Greene
c4db4e5105 [AVX] Add decode support for VUNPCKLPS/D instructions, both 128-bit
and 256-bit forms.  Because the number of elements in a vector
      does not determine the vector type (4 elements could be v4f32 or
      v4f64), pass the full type of the vector to decode routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126664 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:06:56 +00:00
Kevin Enderby
d436d5b1c9 Fix the arm's disassembler for blx that was building an MCInst without the
needed two predicate operands before the imm operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126662 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 18:46:31 +00:00
Evan Cheng
c24ab5c654 Fix a typo which cause dag combine crash. rdar://9059537.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126661 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 18:45:27 +00:00
Stuart Hastings
f222e595c0 Support for byval parameters on ARM. Will be enabled by a forthcoming
patch to the front-end.  Radar 7662569.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126655 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 17:17:53 +00:00
Kalle Raiskila
2d25d247bd Add branch hinting for SPU.
The implemented algorithm is overly simplistic (just speculate all branches are
taken)- this is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126651 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 14:08:24 +00:00
Frits van Bommel
f7b2a9d7df Teach SimplifyCFG that (switch (select cond, X, Y)) is better expressed as a branch.
Based on a patch by Alistair Lynn.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126647 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 09:44:07 +00:00
Nick Lewycky
da834093b7 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126645 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 09:18:11 +00:00
Nick Lewycky
3dc7e49c70 srem doesn't actually have the same resulting sign as its numerator, you could
also have a zero when numerator = denominator. Reverts parts of r126635 and
r126637.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 09:17:39 +00:00
Nick Lewycky
b042f8e969 Teach InstCombine to fold "(shr exact X, Y) == 0" --> X == 0, fixing #1 from
PR9343.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126643 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 08:31:40 +00:00
Nick Lewycky
3dfd98744c Teach value tracking to make use of flags in more situations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126642 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 08:02:21 +00:00
Nick Lewycky
346018bbe7 Teach ValueTracking to look at the dividend when determining the sign bit of an
srem instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 06:52:12 +00:00
Che-Liang Chiou
f71720231f Add preliminary support for .f32 in the PTX backend.
- Add appropriate TableGen patterns for fadd, fsub, fmul.
- Add .f32 as the PTX type for the LLVM float type.
- Allow parameters, return values, and global variable declarations
  to accept the float type.
- Add appropriate test cases.

Patch by Justin Holewinski



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126636 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 06:34:09 +00:00
Nick Lewycky
d8d1584c13 The sign of an srem instruction is the sign of its dividend (the first
argument), regardless of the divisor. Teach instcombine about this and fix
test7 in PR9343!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126635 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 06:20:05 +00:00
Benjamin Kramer
9e9bb0871d Silence enum conversion warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126578 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 18:13:53 +00:00
Duncan Sands
9c45251e11 Legalize support for fpextend of vector. PR9309.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126574 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 14:41:27 +00:00
NAKAMURA Takumi
419f232783 Target/X86: Always emit "push/pop GPRs" in prologue/epilogue and emit "spill/reload frames" for XMMs.
It improves Win64's prologue/epilogue but it would not affect ia32 and amd64 (lack of nonvolatile XMMs).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126568 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 08:47:19 +00:00
Nadav Rotem
fcd96199f5 Fix typos in the comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126565 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 07:40:43 +00:00
Tobias Grosser
3091c92eed RegionPrinter: Ignore back edges when layouting the graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126564 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 04:11:07 +00:00
Tobias Grosser
a91f86c49a Pass the graph to the DOTGraphTraits.getEdgeAttributes().
This follows the interface of getNodeAttributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126562 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 04:11:03 +00:00
Daniel Dunbar
0aa00f9110 Support: Add llvm::AreStatisticsEnabled().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-26 23:17:12 +00:00
Benjamin Kramer
7466678003 Add some DAGCombines for (adde 0, 0, glue), which are useful to optimize legalized code for large integer arithmetic.
1. Inform users of ADDEs with two 0 operands that it never sets carry
2. Fold other ADDs or ADDCs into the ADDE if possible

It would be neat if we could do the same thing for SETCC+ADD eventually, but we can't do that in target independent code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126557 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-26 22:48:07 +00:00
Jim Grosbach
08da6365df Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 22:53:20 +00:00
Owen Anderson
95771afbfd Allow targets to specify a the type of the RHS of a shift parameterized on the type of the LHS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126518 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 21:41:48 +00:00
Cameron Zwarich
f754f50805 Roll out r126425 and r126450 to see if it fixes the failures on the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126488 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 16:30:32 +00:00
Benjamin Kramer
278be783b5 Revert "SimplifyCFG: GEPs with just one non-constant index are also cheap."
Yes, there are other types than i8* and GEPs on them can produce an add+multiply.
We don't consider that cheap enough to be speculatively executed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126481 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 10:33:33 +00:00
Bob Wilson
da52506792 Add patterns to use post-increment addressing for Neon VST1-lane instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126477 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 06:42:42 +00:00
Jim Grosbach
3fc8317798 Fix formatting of debug helper string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126471 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 03:59:03 +00:00
Evan Cheng
9831f2d585 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126467 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 01:29:29 +00:00
Cameron Zwarich
8fbbdca45c Set NumSignBits to 1 if KnownZero/KnownOne are being zero extended. In theory it
is possible to do better if the high bit is set in either KnownZero/KnownOne, but
in practice NumSignBits is always 1 when we are zero extending because nothing
is known about that register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126465 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 01:11:01 +00:00
Cameron Zwarich
33b554795d We only want to zero extend the existing information if the bit width is
actually larger.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126464 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 01:10:55 +00:00
Jakob Stoklund Olesen
57f1e2cee0 Try harder to get the hint by preferring to evict hint interference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126463 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 01:04:22 +00:00
Evan Cheng
acca09bd64 Each prologue may have multiple vpush instructions to store callee-saved
D registers since the vpush list may not have gaps. Make sure the stack
adjustment instruction isn't moved between them. Ditto for vpop in
epilogues.

Sorry, can't reduce a small test case.
rdar://9043312


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126457 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 00:24:46 +00:00
Benjamin Kramer
9ae59e3444 SimplifyCFG: GEPs with just one non-constant index are also cheap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126452 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 23:26:09 +00:00
Jakob Stoklund Olesen
107d366df7 Tweak the register allocator priority queue some more.
New live ranges are assigned in long -> short order, but live ranges that have
been evicted at least once are deferred and assigned in short -> long order.

Also disable splitting and spilling for live ranges seen for the first time.

The intention is to create a realistic interference pattern from the heavy live
ranges before starting splitting and spilling around it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126451 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 23:21:36 +00:00
Nick Lewycky
4e671437ed Remove dead variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126450 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 23:15:43 +00:00
Benjamin Kramer
9b61c550c2 SimplifyCFG: GEPs with constant indices are cheap enough to be executed unconditionally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126445 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 22:46:11 +00:00
Joerg Sonnenberger
93c65e6e66 Restore r125595 (reverted in r126336) with modifications:
Introduce a variable in the AsmParserExtension whether [] is valid in an
expression. If it is true, parse them like (). Enable this for ELF only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126443 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 21:59:22 +00:00
Chris Lattner
12d18a07a0 remove command line option debugging hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126441 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 21:53:03 +00:00
Devang Patel
f410608271 Enable DebugInfo support for COFF object files.
Patch by Nathan Jeffords!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126425 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 21:04:00 +00:00
Nadav Rotem
8c20ec54d9 Enable support for vector sext and trunc:
Limit the folding of any_ext and sext  into the load operation to scalars.
Limit the active-bits trunc optimization to scalars.
Document vector trunc and vector sext in LangRef.

Similar to commit 126080 (for enabling zext).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126424 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 21:01:34 +00:00
Rafael Espindola
0412d5b40a Fix llvm-gcc bootstrap with gnu ld.
The problem was codegen guessing the wrong values and printing

	.section	.eh_frame,"aMS",@progbits,4

It is not clear at all if Codegen should try to guess, MC is the
one that should know the default flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126421 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 20:18:01 +00:00
Devang Patel
afd0d0e8a7 Do not use DIFactory. Use DIBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126398 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 18:49:55 +00:00
Devang Patel
0eea95d1cd Do not use DIFactory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126397 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 18:49:30 +00:00
Richard Osborne
21d7eb3f3b Add XCore intrinsic for eeu instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 13:39:18 +00:00
Benjamin Kramer
f26be1e965 Plug some leaks in edis.
- Don't leak parsed operands during tokenization.
- Don't leak printed insts in llvm-mc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126381 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 11:03:19 +00:00
Cameron Zwarich
8ca814c4e0 Merge information about the number of zero, one, and sign bits of live-out
registers at phis. This enables us to eliminate a lot of pointless zexts during
the DAGCombine phase. This fixes <rdar://problem/8760114>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126380 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 10:00:25 +00:00
Cameron Zwarich
9b6af8de58 Add a getNumSignBits() method to APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 10:00:20 +00:00
Cameron Zwarich
324a24f6aa Add a mechanism for invalidating the LiveOutInfo of a PHI, and use it whenever
a block is visited before all of its predecessors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 10:00:16 +00:00
Cameron Zwarich
a46cd97818 Track blocks visited in reverse postorder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126377 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 10:00:13 +00:00
Cameron Zwarich
e1497b9791 Refactor the LiveOutInfo interface into a few methods on FunctionLoweringInfo
and make the actual map private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126376 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 10:00:08 +00:00
Cameron Zwarich
2dbe2850d0 Have isel visit blocks in reverse postorder rather than an undefined order. This
allows for the information propagated across basic blocks to be merged at phis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126375 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 10:00:04 +00:00
Chris Lattner
afbf48363a wire TargetLibraryInfo into simplify libcalls and use it in a couple of
trivial places.  This pass needs a lot of work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 07:16:14 +00:00
Chris Lattner
e265ad8678 move a massive amount of code out into its own helper function
to reduce nesting.  This needs to be turned into a table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126366 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 07:12:12 +00:00
Chris Lattner
091b1e3c74 change instcombine to not turn a call to non-varargs bitcast of
function prototype into a call to a varargs prototype.  We do
allow the xform if we have a definition, but otherwise we don't
want to risk that we're changing the abi in a subtle way.  On
X86-64, for example, varargs require passing stuff in %al.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126363 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 05:10:56 +00:00
Evan Cheng
7558e2e415 Fix bug in X86 folding / unfolding table. Int_CMPSDrm and Int_CMPSSrm memory
operands starts at index 2, not 1.
rdar://9045024
PR9305


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126359 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 02:36:52 +00:00
Jakob Stoklund Olesen
b2597268c2 Use the same spill slot for all live ranges that descend form the same original
register.

This avoids some silly stack slot shuffling when both sides of a copy get
spilled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126353 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 01:07:55 +00:00
Devang Patel
3a4ae32ed7 Use DW_FORM_data2 for DW_AT_language and let users use DW_LANG_lo_user=0x8000 to DW_LANG_hi_user=0xffff range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126339 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 22:37:04 +00:00
Jim Grosbach
33b7bebca4 Revert r125595, which is an X86-only undocumented assembly syntax extension
enabled for all targets. Non-X86 targets should not have this behavior
enabled by default.

Joerg, if you would like to resubmit with the behavior conditionalized to be
X86-ELF only, that's fine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126336 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 21:26:51 +00:00
Rafael Espindola
21451e533f Put in the symbol table symbols only used in a .globl statement.
Fixes PR9292.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 20:22:07 +00:00
Richard Osborne
d04b4937d1 Add XCore intrinsic for clre instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126322 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 18:52:05 +00:00
Richard Osborne
9935bd0819 Add llvm.xcore.waitevent intrinsic. The effect of this intrinsic is to enable
events on the thread and wait until a resource is ready to event. The vector
of the resource that is ready is returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126320 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 18:35:59 +00:00
Jakob Stoklund Olesen
c70f687dce It is safe to ignore LastSplitPoint when the variable is not live out.
No code will be inserted after the split point anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126319 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 18:26:31 +00:00
Richard Osborne
292f62e06f Add XCore intrinsic for the setv instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126315 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 16:46:37 +00:00
Richard Osborne
2254d0eaa1 Fix format for setc instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126314 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 15:20:16 +00:00
Richard Osborne
2a2cb28526 Add XCore intrinsic for settw instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126313 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 14:45:03 +00:00
Sean Callanan
8fbc00b5ba Fixed a bug in the enhanced disassembler that caused
it to ignore valid uses of FS and GS as additional
base registers in address computations.  Added a test
case for this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126302 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 03:31:28 +00:00
Evan Cheng
2b943566f3 Change VFPNeonA8 definition to make the code easier to read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126298 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 02:35:33 +00:00
Stuart Hastings
5129bdecd8 Omit private_extern declarations of extern symbols; followup to
r124468.  Patch by Rafael Avila de Espindola!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126297 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 02:27:05 +00:00
Evan Cheng
e573fb3255 More fcopysign correctness and performance fix.
The previous codegen for the slow path (when values are in VFP / NEON
registers) was incorrect if the source is NaN.

The new codegen uses NEON vbsl instruction to copy the sign bit. e.g.
        vmov.i32        d1, #0x80000000
        vbsl    d1, d2, d0
If NEON is not available, it uses integer instructions to copy the sign bit.
rdar://9034702


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126295 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 02:24:55 +00:00
Jakob Stoklund Olesen
d2a5073423 Keep track of how many times a live range has been dequeued, and prioritize new ranges.
When a large live range is evicted, it will usually be split when it comes
around again. By deferring evicted live ranges, the splitting happens at a time
when the interference pattern is more realistic. This prevents repeated
splitting and evictions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126282 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 00:56:56 +00:00
Jakob Stoklund Olesen
417df01291 Fix a bug in determining if there is only a single interfering register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 00:29:55 +00:00
Jakob Stoklund Olesen
98c8141b6d Be more aggressive about evicting interference.
Use interval sizes instead of spill weights to determine if it is legal to evict
interference. A smaller interval can evict interference if all interfering live
ranges are larger.

Allow multiple interferences to be evicted as along as they are all larger than
the live range being allocated.

Spill weights are still used to select the preferred eviction candidate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126276 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 00:29:52 +00:00
David Greene
fbf05d32b4 [AVX] General VUNPCKL codegen support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126264 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 23:31:46 +00:00
Jakob Stoklund Olesen
98d9648de7 Change the RAGreedy register assignment order so large live ranges are allocated first.
This is based on the observation that long live ranges are more difficult to
allocate, so there is a better chance of solving the puzzle by handling the big
pieces first. The allocator will evict and split long alive ranges when they get
in the way.

RABasic is still using spill weights for its priority queue, so the interface to
the queue has been virtualized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 23:01:52 +00:00
Jakob Stoklund Olesen
75b5409d3a 80 Col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126258 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 23:01:49 +00:00
Cameron Zwarich
c4f3d51e12 Make LoopDeletion work on loops with multiple edges, as long as the incoming
values from all of the loop's exiting blocks are equal. Patch by Andrew Clinton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126253 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 22:25:39 +00:00
Joerg Sonnenberger
00743c2218 Use the same (%dx) hack for in[bwl] as for out[bwl].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 20:40:09 +00:00
Evan Cheng
6557bce3ec VFP single precision arith instructions can go down to NEON pipeline, but on Cortex-A8 only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 19:53:14 +00:00
Devang Patel
50d280c14e Follow LLVM coding style.
clang uses DBuilder, so it requries corresponding change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126231 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 18:56:12 +00:00
Roman Divacky
4c3ab58c47 Stack alignment is 16 bytes on FreeBSD/i386 too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126226 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 17:30:05 +00:00
Joerg Sonnenberger
a04663ecb2 Bug#9172: Don't use static in file scope, use an attribute on the
parser.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126225 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 16:53:11 +00:00
Cameron Zwarich
5567869637 MachineConstantPoolValues are not uniqued, so they need to be freed if they
share entries. Add a DenseSet to MachineConstantPool for the MachineCPVs that
it owns.

This will hopefully fix the MC/ARM/elf-reloc-01.ll failure on the leaks bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 08:54:30 +00:00
Evan Cheng
0a921698b6 Guard against de-referencing MBB.end().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126192 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:07:59 +00:00
Evan Cheng
af05c69ba0 available_externally (hidden or not) GVs are always accessed via stubs. rdar://9027648.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 06:58:34 +00:00
Andrew Trick
fcfcdbc86a VirtRegRewriter assertion fix.
Apparently it's ok for multiple operands to "kill" the same register.
Fixes PR9237.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 06:52:56 +00:00
Cameron Zwarich
4ecc82e592 Roll out r126169 and r126170 in an attempt to fix the selfhost bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126185 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 03:24:52 +00:00
Eric Christopher
872f4a2247 Only use blx for external function calls on thumb, these could be fixed
up by the dynamic linker, but it's better to use the correct instruction
to begin with.

Fixes rdar://9011034


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126176 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 01:37:10 +00:00
Cameron Zwarich
92efda7e91 Merge information about the number of zero, one, and sign bits of live-out registers
at phis. This enables us to eliminate a lot of pointless zexts during the DAGCombine
phase. This fixes <rdar://problem/8760114>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 00:46:27 +00:00
Cameron Zwarich
63a8dae64d Have isel visit blocks in reverse postorder rather than an undefined order. This
allows for the information propagated across basic blocks to be merged at phis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126169 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 00:46:22 +00:00
Joerg Sonnenberger
d86f482e4a Recognize loopz and loopnz as aliases for loope and loopne.
From Dimitry Andric.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 00:43:07 +00:00
Rafael Espindola
87ca0e077d Implement xgetbv and xsetbv.
Patch by Jai Menon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126165 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 00:35:18 +00:00
Eric Christopher
f8597eb0d9 Revert r125960, it's breaking darwin10 bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126163 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:52:19 +00:00
Evan Cheng
557b297f35 Skipping over debugvalue instructions to determine whether the split spot is in a IT block. rdar://9030770
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126159 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:40:47 +00:00
Evan Cheng
cf13af6fde Add more debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126158 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:39:48 +00:00
Joerg Sonnenberger
d45e8bf93b Handle FK_PCRel_1 and add a test case for this and FK_PCRel_4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126157 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:25:41 +00:00
Devang Patel
68e6beeccc Revert r124611 - "Keep track of incoming argument's location while emitting LiveIns."
In other words, do not keep track of argument's location.  The debugger (gdb) is not prepared to see line table entries for arguments. For the debugger, "second" line table entry marks beginning of function body.
This requires some coordination with debugger to get this working. 
 - The debugger needs to be aware of prolog_end attribute attached with line table entries.
 - The compiler needs to accurately mark prolog_end in line table entries (at -O0 and at -O1+)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:21:26 +00:00
Jakob Stoklund Olesen
06c0f25499 Add SplitKit::isOriginalEndpoint and use it to force live range splitting to terminate.
An original endpoint is an instruction that killed or defined the original live
range before any live ranges were split.

When splitting global live ranges, avoid creating local live ranges without any
original endpoints. We may still create global live ranges without original
endpoints, but such a range won't be split again, and live range splitting still
terminates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126151 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:09:46 +00:00
Sean Callanan
89e59e6343 Fixed a bug in the X86 disassembler where a member of the
X86 instruction decode structure was being interpreted as
being in units of bits, although it is actually stored in
units of bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126147 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 21:55:05 +00:00
Stuart Hastings
37c79c5942 End the line if we return early. Radar 9012638.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126141 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 21:07:07 +00:00
Richard Osborne
d83318450b Add XCore intrinsics for various instructions on ports.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126132 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 18:23:30 +00:00
Duncan Sands
7331ca853a The stack should be 16 byte aligned on 32 bit solaris. Patch by Yuri.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126130 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 17:37:17 +00:00
Duncan Sands
2cfbf018a9 If the phi node was used by an unreachable instruction that ends up using
itself without going via a phi node then we could return false here in
spite of making a change.  Also, tweak the comment because this method
can (and always could) return true without deleting the original phi node.
For example, if the phi node was used by a read-only invoke instruction
which is used by another phi node phi2 which is only used by and only uses
the invoke, then phi2 would be deleted but not the invoke instruction and
not the original phi node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 17:32:05 +00:00
Stuart Hastings
6ad82d81cc Fix to correctly support attribute((section("__DATA, __common"))).
Radar 9012638.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 17:27:17 +00:00
Chris Lattner
fb456c25c2 a serious "compare CSE" issue that is nontrivial to get right,
but which is responsible for us doing really bad things to 256.bzip2.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126126 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 17:03:47 +00:00
Chris Lattner
0e68cee62f fix a crasher in disabled code (on variable stride loops)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126125 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 17:02:55 +00:00
Duncan Sands
b4098ba03d Simplify RecursivelyDeleteDeadPHINode. The only functionality change
should be that if the phi is used by a side-effect free instruction with
no uses then the phi and the instruction now get zapped (checked by the
unittest).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126124 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 16:27:36 +00:00
NAKAMURA Takumi
d64cfe1506 Target/X86/X86FastISel: [PR6275] Fix Win32's dllimport function with fastisel.
"dllimport" function must not be GlobalVariable, but Function. It is enough to check with GlobalValue.
test/CodeGen/X86/dll-linkage.ll is updated to check llc -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 04:50:06 +00:00
Venkatraman Govindaraju
58269b9732 Generate correct Sparc32 ABI compliant code for functions that return a struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126108 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 03:42:44 +00:00
Chris Lattner
19310fc199 add a missed loop deletion case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126103 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 02:13:39 +00:00
Chris Lattner
408b534e43 Add some (disabled code) to print out negative strides.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 02:08:54 +00:00
Chris Lattner
477a98824a add an idiom that loop idiom could theoretically catch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126101 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 01:33:38 +00:00
Cameron Zwarich
ad48a4fc32 A lo/hi mul has higher latency than an imul r,ri, e.g. 5 cycles compared to 3
on Core 2 and Nehalem, so the code we generate is better than GCC's here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126100 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 01:29:32 +00:00
Joerg Sonnenberger
7d0805dcb8 Use a vector of pairs to implement the section stack, not two
independent vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126099 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 01:07:42 +00:00
Cameron Zwarich
8d7285d0e5 The signed version of our "magic number" computation for the integer approximation
of a constant had a minor typo introduced when copying it from the book, which
caused it to favor negative approximations over positive approximations in many
cases. Positive approximations require fewer operations beyond the multiplication.

In the case of division by 3, we still generate code that is a single instruction
larger than GCC's code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126097 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 00:22:02 +00:00
Rafael Espindola
f7ad048f1e Add some limited support for labels in org directives. Hopefully enough to fix
PR9245.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126091 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 20:20:07 +00:00
Nick Lewycky
eff5e69c82 Make RecursivelyDeleteDeadPHINode delete a phi node that has no users and add a
test for that. With this change, test/CodeGen/X86/codegen-dce.ll no longer finds
any instructions to DCE, so delete the test.

Also renamed J and JP to I and IP in RecursivelyDeleteDeadPHINode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126088 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 18:05:56 +00:00
Benjamin Kramer
38f7f66fcc Move "A | ~(A & ?) -> -1" from InstCombine to InstructionSimplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126082 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 15:20:01 +00:00
Benjamin Kramer
91e37ef278 InstCombine: Add a bunch of combines of the form x | (y ^ z).
We usually catch this kind of optimization through InstSimplify's distributive
magic, but or doesn't distribute over xor in general.

"A | ~(A | B) -> A | ~B" hits 24 times on gcc.c.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126081 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 13:23:43 +00:00
Nadav Rotem
ed9b934f65 Fix 9267; Add vector zext support.
The DAGCombiner folds the zext into complex load instructions. This patch
prevents this optimization on vectors since none of the supported targets
knows how to perform load+vector_zext in one instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126080 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 12:37:50 +00:00
Nick Lewycky
1a4021a2be Teach RecursivelyDeleteDeadPHINodes to handle multiple self-references. Patch
by Andrew Clinton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126077 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 08:38:20 +00:00
Nick Lewycky
eafe863b6d Instead of keeping two Value*->id# mappings, keep one Value->Value mapping and
one Value set. This is faster because we only need to use the set when there
isn't already an entry in the map. No functionality change!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126076 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 08:11:03 +00:00
Eric Christopher
893a882d09 If both operands are loads from stores in memory we can't use movlpd/movlps
since one needs to be a register operand. Just use movss instead of forcing
an operand into a register.

Fixes PR9239


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126072 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 05:04:42 +00:00
Oscar Fuentes
00d78f1348 Use explicit add_subdirectory's for LLVM target sublibraries instead
of testing for its presence at cmake time.

This way the build automatically regenerates the makefiles when a svn
update brings in a new sublibrary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 02:55:27 +00:00
Eli Friedman
1347623aaf PR9218: SimplifyDemandedVectorElts can return a non-null value that is not
the instruction passed in.  Make sure to account for this correctly, instead
of looping infinitely.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 22:42:40 +00:00
Eli Friedman
86b115c78b Minor x86 README updates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 21:54:28 +00:00
Chris Lattner
824a9076ea implement PR9264: disambiguating 'bt mem, imm' as a btl.
This is reasonable to do since all bt-mem forms do the
same thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 21:06:36 +00:00
Chris Lattner
80e8b506b8 rewrite the memset_pattern pattern generation stuff to accept any 2/4/8/16-byte
constant, including globals.  This makes us generate much more "pretty" pattern
globals as well because it doesn't break it down to an array of bytes all the
time.

This enables us to handle stores of relocatable globals.  This kicks in about
48 times in 254.gap, giving us stuff like this:

@.memset_pattern40 = internal constant [2 x %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)*] [%struct.TypHeader* (%struct.TypHeader*, %struct
.TypHeader*)* @IsFalse, %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)* @IsFalse], align 16

...
  call void @memset_pattern16(i8* %scevgep5859, i8* bitcast ([2 x %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)*]* @.memset_pattern40 to i8*
), i64 %tmp75) nounwind



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126044 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 19:56:44 +00:00
Chris Lattner
41bfbb0a87 Stores of null pointers should turn into memset, we weren't recognizing
them as splat values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126041 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 19:35:49 +00:00
Chris Lattner
3a393728a6 Implement rdar://9009151, transforming strided loop stores of
unsplatable values into memset_pattern16 when it is available
(recent darwins).  This transforms lots of strided loop stores
of ints for example, like 5 in vpr:

  Formed memset:   call void @memset_pattern16(i8* %4, i8* getelementptr inbounds ([16 x i8]* @.memset_pattern9, i32 0, i32 0), i64 %tmp25)
    from store to: {%3,+,4}<%11> at:   store i32 3, i32* %scevgep, align 4, !tbaa !4




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126040 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 19:31:39 +00:00
Eric Christopher
dd6e40a4f4 Fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126018 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 03:19:09 +00:00
Devang Patel
5bc9fec7ec Do not emit empty DW_TAG_lexical_block DIEs. In one test case, size of debug info reduced by almost 7%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126009 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 01:31:27 +00:00
Jakob Stoklund Olesen
1b847deb26 Give SplitAnalysis a VRM member to access VirtRegMap::getOriginal().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126005 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:53:42 +00:00
Joerg Sonnenberger
4b19c9865e Avoid dangling else warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126004 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:43:45 +00:00
Jakob Stoklund Olesen
0eeca44046 Missed member rename for naming convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126003 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:42:33 +00:00
Jakob Stoklund Olesen
fd38917d4d This method belonged in VirtRegMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:38:43 +00:00
Jakob Stoklund Olesen
a2ebf60ef2 Separate timers for local and global splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126001 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:38:40 +00:00
Devang Patel
29020a3b45 These tags are now covered by dwarf::TagString().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125987 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 23:13:40 +00:00
Devang Patel
98d9f5d90d Provide tag strings for llvm specific tags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125986 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 23:06:29 +00:00
Devang Patel
a778f5c798 Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
This time with a fix that avoids using invalidated DenseMap iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125984 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:43:42 +00:00
Jakob Stoklund Olesen
e324f6e05f Use VirtRegMap's Virt2SplitMap to keep track of the original live range before splitting.
All new virtual registers created for spilling or splitting point back to their original.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125980 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:35:20 +00:00
Chris Lattner
188a7e00e7 add a way to disable all builtins, wire it up to opt's -disable-simplifylibcalls flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:34:03 +00:00
Chris Lattner
c19175c9d8 Make loop-idiom use TargetLibraryInfo to determine whether it is allowed
to hack on memset, memcpy etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125974 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:22:15 +00:00
Oscar Fuentes
6d857ca4d7 Move library stuff out of the toplevel CMakeLists.txt file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:06:14 +00:00
Jakob Stoklund Olesen
ba05c01dab Add VirtRegMap::rewrite() and use it in the new register allocators.
The rewriter works almost identically to -rewriter=trivial, except it also
eliminates any identity copies.

This makes the new register allocators independent of VirtRegRewriter.cpp which
will be going away at the same time as RegAllocLinearScan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:03:18 +00:00
Chris Lattner
ce99120084 introduce a new TargetLibraryInfo pass, which transformations can use to
query about available library functions.  For now this just has 
memset_pattern16, which exists on darwin, but it can be extended for a 
bunch of other things in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125965 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 21:50:34 +00:00
Bill Wendling
5028249fab Reapply r114997 now that the buildbots have been updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 21:12:58 +00:00
Bruno Cardoso Lopes
8bba1a5ef0 Fix style and a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125949 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 19:49:06 +00:00
Bruno Cardoso Lopes
584bf7bb03 Add assembly parsing support for "msr" and also fix its encoding. Also add
testcases for the disassembler to make sure it still works for "msr".



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125948 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 19:45:59 +00:00
Chris Lattner
6309b3e9be improve support for OpenBSD, patch by Amit Kulkarni!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125943 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 17:04:56 +00:00
Rafael Espindola
1e09e5b979 Expose getTypeName to the C API. Patch by Patrick Walton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125845 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 16:35:37 +00:00
Duncan Sands
39a7de72c8 Add some transforms of the kind X-Y>X -> 0>Y which are valid when there is no
overflow.  These subsume some existing equality transforms, so zap those.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125843 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 16:25:37 +00:00
Chris Lattner
c1e4ce6044 add a poor division by constant case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125832 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 05:35:49 +00:00
Cameron Zwarich
1646953538 Roll out r125794 to help diagnose the llvm-gcc-i386-linux-selfhost failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:58:10 +00:00
Chris Lattner
78f7a25f98 prevent jump threading from merging blocks when their address is
taken (and used!).  This prevents merging the blocks (invalidating
the block addresses) in a case like this:

#define _THIS_IP_  ({ __label__ __here; __here: (unsigned long)&&__here; })

void foo() {
  printf("%p\n", _THIS_IP_);
  printf("%p\n", _THIS_IP_);
  printf("%p\n", _THIS_IP_);
}

which fixes PR4151.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:43:06 +00:00
Chris Lattner
13fb0db0c2 hoist GlobalValue::removeDeadConstantUsers up to being a method on Constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:41:42 +00:00
Chris Lattner
f5ebfb0d28 Don't unroll loops whose header block's address is taken.
This is part of a futile attempt to not "break" bizzaro
code like this:

 l1:
  printf("l1: %p\n", &&l1);
  ++x;

  if( x < 3 ) goto l1;


Previously we'd fold &&l1 to 1, which is fine per our semantics
but not helpful to the user.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125827 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:25:21 +00:00
Joerg Sonnenberger
5ad596f9d2 Recognize monitor/mwait with explicit register arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125805 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 00:48:11 +00:00
Argyrios Kyrtzidis
c788f44642 Check the errorcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 00:47:07 +00:00
Jakob Stoklund Olesen
febb0bd0b9 Trim debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125802 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 00:32:47 +00:00
Joerg Sonnenberger
97755a063e Recognize leavel and leaveq aliases for leave.
Validate encoding of leave in 64bit mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125795 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:36:39 +00:00
Devang Patel
a4defc00eb Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:33:27 +00:00
Chris Lattner
c8cb8ef9c2 have instcombine preserve nsw/nuw/exact when sinking
common operations through a phi. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125790 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:01:49 +00:00
Jakob Stoklund Olesen
0db841f9c2 Add basic register allocator statistics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125789 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 22:53:48 +00:00
Chris Lattner
1521e91fc4 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 22:32:54 +00:00
Chris Lattner
4bd8217af3 fix instcombine merging GEPs through a PHI to only make the
result inbounds if all of the inputs are inbounds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125785 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 22:21:26 +00:00
Nadav Rotem
093399cbf3 Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 21:22:27 +00:00
Chris Lattner
bd9f6bf5cd add is always integer, thanks to Frits for noticing this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125774 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 20:55:29 +00:00
David Greene
583b68f34f [AVX] Recorganize X86ShuffleDecode into its own library
(LLVMX86Utils.a) to break cyclic library dependencies between
LLVMX86CodeGen.a and LLVMX86AsmParser.a.  Previously this code was in
a header file and marked static but AVX requires some additional
functionality here that won't be used by all clients.  Since including
unused static functions causes a gcc compiler warning, keeping it as a
header would break builds that use -Werror.  Putting this in its own
library solves both problems at once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 19:18:59 +00:00
Jakob Stoklund Olesen
034a80d065 Split local live ranges.
A local live range is live in a single basic block. If such a range fails to
allocate, try to find a sub-range that would get a larger spill weight than its
interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125764 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 19:13:53 +00:00
Dan Gohman
64849ce66f The labyrinthine X86 backend no longer appears to require
these patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 18:50:19 +00:00