1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

74722 Commits

Author SHA1 Message Date
Eli Friedman
7a34419c6f Fix up the patterns for SXTB, SXTH, UXTB, and UXTH so that they are correctly active without HasT2ExtractPack. PR10611.
llvm-svn: 137061
2011-08-08 19:49:37 +00:00
Benjamin Kramer
3490c59cda Pacify virtual dtor warnings and cmake buildbots.
llvm-svn: 137060
2011-08-08 19:09:02 +00:00
Benjamin Kramer
8c3f23ec80 Add MCInstrAnalysis class. This allows the targets to specify own versions of MCInstrDescs functions.
- Add overrides for ARM.
- Teach llvm-objdump to use this instead of plain MCInstrDesc.

llvm-svn: 137059
2011-08-08 18:56:44 +00:00
Benjamin Kramer
d4dc8d86f4 llvm-objdump: disassembly enhancements
- Indent simple loops
- Print unreachable blocks as .byte directives

llvm-svn: 137058
2011-08-08 18:41:34 +00:00
Benjamin Kramer
26d5603f54 llvm-objdump: Use help of CFG to print assembly when --cfg is passed.
This way we can avoid printing unreachable code (data).

llvm-svn: 137057
2011-08-08 18:32:12 +00:00
Devang Patel
bc9a3e12d9 Simplify by creating parent first.
llvm-svn: 137056
2011-08-08 18:22:10 +00:00
Jakob Stoklund Olesen
85931574b0 Don't clobber pending ST regs when FP regs are killed.
X86FloatingPoint keeps track of pending ST registers for an upcoming
inline asm instruction with fixed stack register constraints.  It does
this by remembering which FP register holds the value that should appear
at a fixed stack position for the inline asm.

When that FP register is killed before the inline asm, make sure to
duplicate it to a scratch register, so the ST register still has a live
FP reference.

This could happen when the same FP register was copied to two ST
registers, or when a spill instruction is inserted between the ST copy
and the inline asm.

This fixes PR10602.

llvm-svn: 137050
2011-08-08 17:15:43 +00:00
Bill Wendling
0f2208f619 Clean up the grammar for the landingpad instruction.
llvm-svn: 137042
2011-08-08 08:06:05 +00:00
Bill Wendling
ee869ce6c1 Remove unnecessary space.
llvm-svn: 137041
2011-08-08 08:02:48 +00:00
Bill Wendling
83c0ada603 Fix typo found by John.
llvm-svn: 137040
2011-08-08 07:58:58 +00:00
Chris Lattner
5099413082 strengthen up an assertion: you can't create a constant struct
with an opaque struct type, it doesn't make sense.  This should
resolve PR10473.

llvm-svn: 137028
2011-08-07 04:18:48 +00:00
Jakob Stoklund Olesen
32649cbc65 Fix typo. Thanks, Andy!
llvm-svn: 137023
2011-08-06 18:20:24 +00:00
Andrew Trick
a7fc7983d4 Made SCEV's UDiv expressions more canonical. When dividing a
recurrence, the initial values low bits can sometimes be ignored.

To take advantage of this, added FoldIVUser to IndVarSimplify to fold
an IV operand into a udiv/lshr if the operator doesn't affect the
result.

-indvars -disable-iv-rewrite now transforms

i = phi i4
i1 = i0 + 1
idx = i1 >> (2 or more)
i4 = i + 4

into

i = phi i4
idx = i0 >> ...
i4 = i + 4

llvm-svn: 137013
2011-08-06 07:00:37 +00:00
Jakob Stoklund Olesen
a8eabeb2b3 Reject RS_Spill ranges from local splitting as well.
All new local ranges are marked as RS_New now, so there is no need to
attempt splitting of RS_Spill ranges any more.

llvm-svn: 137002
2011-08-05 23:50:33 +00:00
Jakob Stoklund Olesen
af4cd7e67f Only mark remainder intervals as RS_Spill after per-block splitting.
The local ranges created get to stay in the RS_New stage, just like for
local and region splitting.

This gives tryLocalSplit a bit more freedom the first time it sees one
of these new local ranges.

llvm-svn: 137001
2011-08-05 23:50:31 +00:00
Jakob Stoklund Olesen
3f2f3056e5 Remember to update LiveDebugVariables after per-block splitting.
llvm-svn: 136996
2011-08-05 23:10:40 +00:00
Jakob Stoklund Olesen
6225dc24a6 Extract per-block splitting into its own method.
No functional change.

llvm-svn: 136994
2011-08-05 23:04:18 +00:00
Jakob Stoklund Olesen
71678baebd Delete getMultiUseBlocks and splitSingleBlocks.
These functions are no longer used, and they are easily replaced with a
loop calling shouldSplitSingleBlock and splitSingleBlock.

llvm-svn: 136993
2011-08-05 22:52:17 +00:00
Jakob Stoklund Olesen
d352ade356 Also use shouldSplitSingleBlock() in the fallback splitting mode.
Drop the use of SplitAnalysis::getMultiUseBlocks, there is no need to go
through a SmallPtrSet any more.

llvm-svn: 136992
2011-08-05 22:43:23 +00:00
Jakob Stoklund Olesen
83a365a416 Split around single instructions to enable register class inflation.
Normally, we don't create a live range for a single instruction in a
basic block, the spiller does that anyway. However, when splitting a
live range that belongs to a proper register sub-class, inserting these
extra COPY instructions completely remove the constraints from the
remainder interval, and it may be allocated from the larger super-class.

The spiller will mop up these small live ranges if we end up spilling
anyway. It calls them snippets.

llvm-svn: 136989
2011-08-05 22:20:45 +00:00
Jim Grosbach
00c4316907 ARM load instruction shifted register index operands.
Parsing and encoding for shifted index operands for load instructions.

llvm-svn: 136986
2011-08-05 22:03:36 +00:00
Jim Grosbach
40a7e379c4 ARM indexed load assembly parsing and encoding.
More parsing support for indexed loads. Fix pre-indexed with writeback
parsing for register offsets and handle basic post-indexed offsets.

llvm-svn: 136982
2011-08-05 21:28:30 +00:00
Jakob Stoklund Olesen
416d8246b3 Detect proper register sub-classes.
Some instructions require restricted register classes, but most of the
time that doesn't affect register allocation. For example, some
instructions don't work with the stack pointer, but that is a reserved
register anyway.

Sometimes it matters, GR32_ABCD only has 4 allocatable registers. For
such a proper sub-class, the register allocator should try to enable
register class inflation since that makes more registers available for
allocation.

Make sure only legal super-classes are considered. For example, tGPR is
not a proper sub-class in Thumb mode, but in ARM mode it is.

llvm-svn: 136981
2011-08-05 21:28:14 +00:00
Jim Grosbach
182acb7018 ARM refactor indexed store instructions.
Refactor STR[B] pre and post indexed instructions to use addressing modes for
memory operands, which is necessary for assembly parsing and is more consistent
with the rest of the memory instruction definitions. Make some incremental
progress on refactoring away the mega-operand addrmode2 along the way, which
is nice.

llvm-svn: 136978
2011-08-05 20:35:44 +00:00
Jim Grosbach
861430e0bb Add ARM LDR parsing tests.
llvm-svn: 136977
2011-08-05 20:33:39 +00:00
Jakob Stoklund Olesen
640f65cbda Fix liveness computations in BranchFolding.
The old code would look at kills and defs in one pass over the
instruction operands, causing problems with this code:

  %R0<def>, %CPSR<def,dead> = tLSLri %R5<kill>, 2, pred:14, pred:%noreg
  %R0<def>, %CPSR<def,dead> = tADDrr %R4<kill>, %R0<kill>, pred:14, %pred:%noreg

The last instruction kills and redefines %R0, so it is still live after
the instruction.

This caused a register scavenger crash when compiling 483.xalancbmk for
armv6. I am not including a test case because it requires too much bad
luck to expose this old bug.

First you need to convince the register allocator to use %R0 twice on
the tADDrr instruction, then you have to convince BranchFolding to do
something that causes it to run the register scavenger on he bad block.

<rdar://problem/9898200>

llvm-svn: 136973
2011-08-05 18:47:07 +00:00
Jim Grosbach
67621a1af4 ARM simplify the postidx_reg operand encoding.
The immediate portion of the operand is just a boolean (the 'U' bit indicating
add vs. subtract). Treat it as such.

llvm-svn: 136969
2011-08-05 16:11:38 +00:00
Jim Grosbach
e89ee8ab6e ARM use a dedicated printer for postidx_reg operands.
llvm-svn: 136968
2011-08-05 15:48:21 +00:00
Bob Wilson
e241d2cd04 Add missing register constraint for some VLD3/VLD4 pseudo instructions.
<rdar://problem/9878189>

llvm-svn: 136962
2011-08-05 07:24:09 +00:00
Chandler Carruth
520ba0fe44 Silence unused variable warnings in release builds.
llvm-svn: 136956
2011-08-05 01:08:21 +00:00
Jason W Kim
82c4669079 Fix http://llvm.org/bugs/show_bug.cgi?id=10583\n - test for 1 and 2 byte fixups to be added
llvm-svn: 136954
2011-08-05 00:53:03 +00:00
Chandler Carruth
e833bbd11e Temporarily revert r135528 which distinguishes between two copies of one
inlined variable, based on the discussion in PR10542.

This explodes the runtime of several passes down the pipeline due to
a large number of "copies" remaining live across a large function. This
only shows up with both debug and opt, but when it does it creates
a many-minute compile when self-hosting LLVM+Clang. There are several
other cases that show these types of regressions.

All of this is tracked in PR10542, and progress is being made on fixing
the issue. Once its addressed, the re-instated, but until then this
restores the performance for self-hosting and other opt+debug builds.

Devang, let me know if this causes any trouble, or impedes fixing it in
any way, and thanks for working on this!

llvm-svn: 136953
2011-08-05 00:51:31 +00:00
Owen Anderson
11e2000c8c Fix broken encodings for the Thumb2 LDRD/STRD instructions.
llvm-svn: 136942
2011-08-04 23:18:05 +00:00
Jim Grosbach
3956112276 ARM assembly parsing and encoding for LDR instructions.
Enhance support for LDR instruction assembly parsing for post-indexed
addressing with immediate values. Add tests.

llvm-svn: 136940
2011-08-04 23:01:30 +00:00
Jakob Stoklund Olesen
633d15e468 Count the total amount of stack space used in compiled functions.
Patch by Ivan Krasin!

llvm-svn: 136921
2011-08-04 21:06:09 +00:00
Devang Patel
edf90c3ad7 Print DBG_VALUE variable's location info as a comment.
llvm-svn: 136916
2011-08-04 20:44:26 +00:00
Devang Patel
1451dd30c0 Increment counter inside insertDebugValue().
llvm-svn: 136915
2011-08-04 20:42:11 +00:00
Devang Patel
e5379a1a5d We need to map DebugLoc. It leads to Fuction * (through subprogram entry node) which should be appropriately mapped.
llvm-svn: 136910
2011-08-04 20:02:18 +00:00
Devang Patel
17d9346546 Linke NamedMDNodes after linking global values as comment suggests.
llvm-svn: 136909
2011-08-04 19:44:28 +00:00
Chris Lattner
e34bef3d5e allow \r's in .s files.
llvm-svn: 136908
2011-08-04 19:31:26 +00:00
Roman Divacky
23593046fc Introduce adjustFixupOffset that adjusts the fixup offset of a relocation.
This is meant to be overriden by backends. Implement an override on PowerPC
which adjusts the offset by 2 for ha16/lo16 relocation kinds. This removes
a commented out hack and enables hello world to be compiled on PowerPC.

llvm-svn: 136905
2011-08-04 19:08:19 +00:00
Devang Patel
3c27eeff00 Add counter.
llvm-svn: 136901
2011-08-04 18:45:38 +00:00
Evan Cheng
b5b42f6869 Fix an obvious type. Patch by Ivan Krasin.
llvm-svn: 136900
2011-08-04 18:40:26 +00:00
Evan Cheng
12fbbde46a Fix an obvious type. Patch by Ivan Krasin.
llvm-svn: 136899
2011-08-04 18:38:15 +00:00
Owen Anderson
1136bcc11e LDCL_POST and STCL_POST need one's-complement offsets, rather than two's complement offsets. Add an appropriate immediate type for them.
llvm-svn: 136896
2011-08-04 18:24:14 +00:00
Rafael Espindola
b16f4e78a4 Fix the bitwidth of the remaining fields.
llvm-svn: 136884
2011-08-04 17:00:11 +00:00
Duncan Sands
b034709948 Fix a place that was clearly forgotten when the type legalization
logic moved over to its own enum.  Noticed by Andrey Karpov with
the PVS-studio tool.

llvm-svn: 136881
2011-08-04 16:01:54 +00:00
Rafael Espindola
2da6e6a1d8 print st_shndx with the correct number of bits.
llvm-svn: 136880
2011-08-04 15:50:13 +00:00
Duncan Sands
c7008b3610 Add obviously missing "break". Noticed by Andrey Karpov with
the PVS-studio tool.

llvm-svn: 136878
2011-08-04 15:45:59 +00:00
Rafael Espindola
c1a076eeb1 print st_other with the correct number of bits.
llvm-svn: 136877
2011-08-04 15:38:19 +00:00