Commit Graph

45738 Commits

Author SHA1 Message Date
Tilmann Scheller
49d7999b89 Use X86_thiscall calling convention for Win64 as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126934 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 07:49:07 +00:00
Eli Friedman
78c1e1781c PR9352: Always emit a relocation for weak symbols. Not emitting relocations
for calls to weak symbols with a definition has the appearance of working
with LLVM-generated code because weak symbol definitions are put in their
own sections.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 07:24:36 +00:00
Bob Wilson
acc9e7315c Add a readme entry for the redundant movw issue for pr9370.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126930 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 06:39:09 +00:00
Jakob Stoklund Olesen
2c11eb333c Renumber slot indexes uniformly instead of spacing according to the number of defs.
There are probably much larger speedups to be had by renumbering locally instead
of looping over the whole function. For now, the greedy register allocator is
25% faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 06:29:01 +00:00
Jakob Stoklund Olesen
f37712f486 Represent sentinel slot indexes with a null pointer.
This is much faster than using a pointer to a ManagedStatic object accessed with
a function call. The greedy register allocator is 5% faster overall just from
the SlotIndex default constructor savings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126925 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 05:40:04 +00:00
Jakob Stoklund Olesen
a97ff8a027 Avoid comparing invalid slot indexes, and assert that it doesn't happen.
The SlotIndex created by the default construction does not represent a position
in the function, and it doesn't make sense to compare it to other indexes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126924 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 05:18:19 +00:00
Jakob Stoklund Olesen
b64f669b66 Avoid comparing invalid slot indexes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126922 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 04:23:52 +00:00
Jakob Stoklund Olesen
36d61863bc Cache basic block bounds instead of asking SlotIndexes::getMBBRange all the time.
This speeds up the greedy register allocator by 15%.
DenseMap is not as fast as one might hope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126921 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 03:41:29 +00:00
Bob Wilson
181d3fe727 pr9367: Add missing predicated BLX instructions.
Patch by Jyun-Yan You, with some minor adjustments and a testcase from me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 01:41:01 +00:00
Jakob Stoklund Olesen
bece06f0c6 Change the SplitEditor interface to a single instance can be shared for multiple splits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126912 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 01:29:13 +00:00
Jakob Stoklund Olesen
8701768ae2 Only run the updateSSA loop when we have actually seen multiple values.
When only a single value has been seen, new PHIDefs are never needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126911 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 01:29:10 +00:00
Jakob Stoklund Olesen
c29d9b3495 Fix PHI handling in LiveIntervals::shrinkToUses().
We need to wait until we meet a PHIDef in its defining block before resurrecting
PHIKills in the predecessors.

This should unbreak the llvm-gcc-build-x86_64-darwin10-x-mingw32-x-armeabi bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 00:20:51 +00:00
Bob Wilson
254c63e336 Avoid exponential blow-up when printing DAGs.
David Greene changed CannotYetSelect() to print the full DAG including multiple
copies of operands reached through different paths in the DAG.  Unfortunately
this blows up exponentially in some cases.  The depth limit of 100 is way too
high to prevent this -- I'm seeing a message string of 150MB with a depth of
only 40 in one particularly bad case, even though the DAG has less than 200
nodes.  Part of the problem is that the printing code is following chain
operands, so if you fail to select an operation with a chain, the printer will
follow all the chained operations back to the entry node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126899 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:38:06 +00:00
Jakob Stoklund Olesen
a2cae58411 Turn the Edit member into a pointer so it can change dynamically.
No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126898 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:31:50 +00:00
Kevin Enderby
d39647d913 Fixes an assertion failure while disassembling ARM rsbs reg/reg form.
Patch by Ted Kremenek!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126895 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:08:33 +00:00
Jakob Stoklund Olesen
4670353a21 Transfer simply defined values directly without recomputing liveness and SSA.
Values that map to a single new value in a new interval after splitting don't
need new PHIDefs, and if the parent value was never rematerialized the live
range will be the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:05:19 +00:00
Jakob Stoklund Olesen
e2dc0c978e Extract a method. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 23:05:16 +00:00
Renato Golin
e89a05337a Fixing a bug when printing fpu text to object file. Patch by Mans Rullgard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126882 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 21:20:09 +00:00
Duncan Sands
291bb70d93 Remove DIFactory. Patch by Devang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126871 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 20:30:37 +00:00
Stuart Hastings
7e33418671 Can't introduce floating-point immediate constants after legalization.
Radar 9056407.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126864 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 19:36:30 +00:00
Tilmann Scheller
f1cc70ca93 Add Win64 thiscall calling convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 19:29:22 +00:00
David Greene
a20244d1ba [AVX] Fix mask predicates for 256-bit UNPCKLPS/D and implement
missing patterns for them.

      Add a SIMD test subdirectory to hold tests for SIMD instruction
      selection correctness and quality.
'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126845 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 17:23:43 +00:00
Che-Liang Chiou
31c488c8bd ptx: fix lint and compiler warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126838 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 07:58:46 +00:00
Che-Liang Chiou
f48817cbf9 Add 64-bit addressing to PTX backend
- Add '64bit' sub-target option.
- Select 32-bit/64-bit loads/stores based on '64bit' option.
- Fix function parameter order.

Patch by Justin Holewinski



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126837 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 07:36:48 +00:00
Rafael Espindola
38c4e53549 Add a special streamer to libLTO that just records symbols definitions and
uses.

The result produced by the streamer is used to give the linker more accurate
information and to add to llvm.compiler.used. The second improvement removes
the need for the user to add __attribute__((used)) to functions only used in
inline asm. The first one lets us build firefox with LTO on Darwin :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 04:14:42 +00:00
Cameron Zwarich
f7af396c95 Fix some typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 04:03:46 +00:00
Cameron Zwarich
3ccfbc2012 Remove some more unused code that I missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126826 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 03:48:29 +00:00
Cameron Zwarich
56e3793acf Eliminate the unused CodeGenPrepare option to split critical edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126825 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 03:31:46 +00:00
Che-Liang Chiou
fd8978b021 Extend initial support for primitive types in PTX backend
- Allow i16, i32, i64, float, and double types, using the native .u16,
  .u32, .u64, .f32, and .f64 PTX types.
- Allow loading/storing of all primitive types.
- Allow primitive types to be passed as parameters.
- Allow selection of PTX Version and Shader Model as sub-target attributes.
- Merge integer/floating-point test cases for load/store.
- Use .u32 instead of .s32 to conform to output from NVidia nvcc compiler.

Patch by Justin Holewinski



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126824 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 03:20:28 +00:00
Jakob Stoklund Olesen
1c38ba6355 Move extendRange() into SplitEditor and delete the LiveRangeMap class.
Extract the updateSSA() method from the too long extendRange().

LiveOutCache can be shared among all the new intervals since there is at most
one of the new ranges live out from each basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126818 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 01:59:34 +00:00
Nick Lewycky
4b11a70f7a Quiet a compiler warning about unused variable 'ExtVNI'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 01:43:30 +00:00
Dan Gohman
0cbe91ba3b Don't re-use existing addrec expansions if they contain casts.
This fixes PR9259.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126812 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 01:34:10 +00:00
Evan Cheng
f06e6c2ba7 Catch more cases where 2-address pass should 3-addressify instructions. rdar://9002648.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126811 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 01:08:17 +00:00
Jakob Stoklund Olesen
d3fdaeb69a Rename mapValue to extendRange because that is its function now.
Simplify the signature - The return value and ParentVNI are no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126809 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 00:49:28 +00:00
Jakob Stoklund Olesen
e0ab24532c Simplify LiveIntervals::shrinkToUses() a bit by using the new extendInBlock().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126806 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 00:33:03 +00:00
Jakob Stoklund Olesen
a4d347357c Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126805 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 00:33:01 +00:00
Jakob Stoklund Olesen
9763e2bf39 Move LiveIntervalMap::extendTo into LiveInterval itself.
This method could probably be used by LiveIntervalAnalysis::shrinkToUses, and
now it can use extendIntervalEndTo() which coalesces ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126803 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 00:06:15 +00:00
Jakob Stoklund Olesen
edb87555e4 Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126801 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 23:24:19 +00:00
Jakob Stoklund Olesen
670ccd18ae Move the value map from LiveIntervalMap to SplitEditor.
The value map is currently not used, all values are 'complex mapped' and
LiveIntervalMap::mapValue is used to dig them out.

This is the first step in a series changes leading to the removal of
LiveIntervalMap. Its data structures can be shared among all the live intervals
created by a split, so it is wasteful to create a copy for each.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126800 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 23:14:53 +00:00
Jakob Stoklund Olesen
3afab9c57e Delete dead code.
Local live range splitting is better driven by interference. This code was just
guessing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 23:14:50 +00:00
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