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

12510 Commits

Author SHA1 Message Date
Chad Rosier
57b5189638 Removed set, but unused variable.
Patch by Joe Abbey <jabbey@arxan.com>.

llvm-svn: 142206
2011-10-17 18:01:59 +00:00
Devang Patel
0b8b4b4a5c It is safe to speculate load from GOT. This fixes performance regression caused by r141689.
Radar 10281206.

llvm-svn: 142202
2011-10-17 17:35:01 +00:00
Nadav Rotem
8ed6f090ef Enable element promotion type legalization by deafault.
Changed tests which assumed that vectors are legalized by widening them.

llvm-svn: 142152
2011-10-16 20:31:33 +00:00
Benjamin Kramer
6009b2df99 Let printf do the formatting instead aligning strings ourselves.
While at it, merge some format strings.

llvm-svn: 142140
2011-10-16 16:30:34 +00:00
Benjamin Kramer
55511d0bfe Twinify better.
llvm-svn: 142139
2011-10-16 15:46:29 +00:00
Nadav Rotem
f20613916b Move the legalization of vector loads and stores into LegalizeVectorOps. In some
cases we need the second type-legalization pass in order to support all cases.

llvm-svn: 142060
2011-10-15 07:41:10 +00:00
Bill Wendling
0dd89843fc Clear out the landing pad to call site map for each function.
This isn't put into the 'clear()' method because the information needs to stick
around (at least for a little bit) after the selection DAG is built.

llvm-svn: 142032
2011-10-15 01:00:26 +00:00
Evan Cheng
15ab434f80 A few 80-col violations.
llvm-svn: 141988
2011-10-14 20:36:23 +00:00
Jakob Stoklund Olesen
6f0c76740b Update live-in lists when splitting critical edges.
Fixes PR10814. Patch by Jan Sjödin!

llvm-svn: 141960
2011-10-14 17:25:46 +00:00
Jim Grosbach
b06728a837 Fix typo. "__sync_fetch_and-xor_4" should be "__sync_fetch_and_xor_4".
Pointed out by George Russell.

llvm-svn: 141956
2011-10-14 15:53:48 +00:00
Jakob Stoklund Olesen
98e48aef6f Add value numbers when spilling dead defs.
When spilling around an instruction with a dead def, remember to add a
value number for the def.

The missing value number wouldn't normally create problems since there
would be an incoming live range as well.  However, due to another bug
we could spill a dead V_SET0 instruction which doesn't read any values.

The missing value number caused an empty live range to be created which
is dangerous since it doesn't interfere with anything.

This fixes part of PR11125.

llvm-svn: 141923
2011-10-14 00:34:31 +00:00
Eric Christopher
0ffa8593b3 Don't forget to reconstruct D after changing the scope that we're
looking at.

llvm-svn: 141892
2011-10-13 21:43:44 +00:00
Cameron Zwarich
fcbdff2af3 Use an existing method.
llvm-svn: 141855
2011-10-13 07:36:41 +00:00
Nick Lewycky
714cb9cf31 If MI is deleted then remove it from the set. If a new MI is created, it could
have the same address as the one we deleted, and we don't want that in the set
yet. Noticed by inspection.

llvm-svn: 141849
2011-10-13 02:16:18 +00:00
Nick Lewycky
f4037f6420 Tabs to spaces.
llvm-svn: 141844
2011-10-13 01:09:50 +00:00
Nick Lewycky
157477efa7 Add missing braces to pacify GCC's -Wparentheses.
llvm-svn: 141842
2011-10-13 00:54:59 +00:00
Jakob Stoklund Olesen
f38db50fed Also inflate register classes around inline asm.
Now that MI->getRegClassConstraint() can also handle inline assembly,
don't bail when recomputing the register class of a virtual register
used by inline asm.

This fixes PR11078.

llvm-svn: 141836
2011-10-12 23:37:40 +00:00
Jakob Stoklund Olesen
9349890ed8 Add MachineInstr::getRegClassConstraint().
Most instructions have some requirements for their register operands.
Usually, this is expressed as register class constraints in the
MCInstrDesc, but for inline assembly the constraints are encoded in the
flag words.

llvm-svn: 141835
2011-10-12 23:37:36 +00:00
Jakob Stoklund Olesen
d406c95461 Extract a method for finding the inline asm flag operand.
llvm-svn: 141834
2011-10-12 23:37:33 +00:00
Jakob Stoklund Olesen
3d62f52b22 Encode register class constreaints in inline asm instructions.
The inline asm operand constraint is initially encoded in the virtual
register for the operand, but that register class may change during
coalescing, and the original constraint is lost.

Encode the original register class as part of the flag word for each
inline asm operand.  This makes it possible to recover the actual
constraint required by inline asm, just like we can for normal
instructions.

llvm-svn: 141833
2011-10-12 23:37:29 +00:00
Bill Wendling
60bfb5d707 We need to verify that the machine instruction we're using as a replacement for
our current machine instruction defines a register with the same register class
as what's being replaced. This showed up in the SPEC 403.gcc benchmark, where it
would ICE because a tail call was expecting one register class but was given
another. (The machine instruction verifier catches this situation.)
<rdar://problem/10270968>

llvm-svn: 141830
2011-10-12 23:03:40 +00:00
Eli Friedman
f6209d7abe Use a utility from MathExtras to clarify a check and avoid undefined behavior. Based on patch by Ahmed Charles.
llvm-svn: 141829
2011-10-12 22:46:45 +00:00
Evan Cheng
6ffc02582e Disable machine LICM speculation check (for profitability) until I have time to investigate the regressions.
llvm-svn: 141813
2011-10-12 21:33:49 +00:00
Cameron Zwarich
19d2ebc9a4 To find the exiting VN of a LiveInterval from a block, use the previous slot
rather than the previous index. If a block has a single instruction, the
previous index may be in a different basic block.

I have no clue how this used to work on all of test-suite, because now this
failure is seen quite often when trying to compile code with -strong-phi-elim.
This fixes PR10252.

llvm-svn: 141812
2011-10-12 21:24:54 +00:00
Dan Gohman
5acb47274d Fix a thinko that Nick noticed. The previous code actually worked as
intended, but only by accident.

llvm-svn: 141779
2011-10-12 15:56:56 +00:00
Bill Wendling
bec4f3b9f3 Expand the check for a landing pad so that it looks at the basic block's
containing loop's header to see if that's a landing pad. If it is, then we don't
want to hoist instructions out of the loop and above the header.

llvm-svn: 141767
2011-10-12 02:58:01 +00:00
Jakob Stoklund Olesen
0f662145ef Use an existing function.
llvm-svn: 141763
2011-10-12 01:24:51 +00:00
Evan Cheng
a4ac173a22 Fix r141744.
1. The speculation check may not have been performed if the BB hasn't had a load
   LICM candidate.
2. If the candidate would be CSE'ed, then go ahead and speculatively LICM the
   instruction even if it's in high register pressure situation.

llvm-svn: 141747
2011-10-12 00:09:14 +00:00
Evan Cheng
5b4ab71b44 Refine r141689 with a tri-state variable.
Also teach MachineLICM to avoid "speculation" when register pressure is high.

llvm-svn: 141744
2011-10-11 23:48:44 +00:00
Eric Christopher
57c57a3260 Add a new wrapper node for a DILexicalBlock that encapsulates it and a
file. Since it should only be used when necessary propagate it through
the backend code generation and tweak testcases accordingly.

This helps with code like in clang's test/CodeGen/debug-info-line.c where
we have multiple #line directives within a single lexical block and want
to generate only a single block that contains each file change.

Part of rdar://10246360

llvm-svn: 141729
2011-10-11 22:59:11 +00:00
Eric Christopher
22773143e0 Formatting.
llvm-svn: 141728
2011-10-11 22:59:04 +00:00
Bill Wendling
f8cd4fcba7 N.B. This is with the new EH scheme:
The blocks with invokes have branches to the dispatch block, because that more
correctly models the behavior of the CFG. The dispatch of course has edges to
the landing pads. Those landing pads could contain invokes, which then have
branches back to the dispatch. This creates a loop. The machine LICM pass looks
at this loop and thinks it can hoist elements out of it. But because the
dispatch is an alternate entry point into the program, the hoisted instructions
won't be executed.

I wasn't able to get a testcase which was small and could reproduce all of the
time. The function_try_block.cpp in llvm-test was where this showed up.

llvm-svn: 141726
2011-10-11 22:42:31 +00:00
Devang Patel
3811b42be0 Add dominance check for the instruction being hoisted.
For example, MachineLICM should not hoist a load that is not guaranteed to be executed.
Radar 10254254.

llvm-svn: 141689
2011-10-11 18:09:58 +00:00
Nadav Rotem
6ddbd1308b Add support for legalization of vector SHL/SRA/SRL instructions
llvm-svn: 141667
2011-10-11 14:36:35 +00:00
Nadav Rotem
451cacafa0 Add support for legalization of vector trunc-store where the saved scalar type is illegal (for example, v2i16 on systems where the smallest store size is i32)
llvm-svn: 141661
2011-10-11 11:25:16 +00:00
Nadav Rotem
45b5fc0012 Cleanup the trunc-store legalization code and add asserts.
llvm-svn: 141659
2011-10-11 10:04:25 +00:00
Devang Patel
e6091c61c7 Revert r141569 and r141576.
llvm-svn: 141594
2011-10-10 23:18:02 +00:00
Jakob Stoklund Olesen
0d908f3a85 Give targets a chance to expand even standard pseudos.
Allow targets to expand COPY and other standard pseudo-instructions
before they are expanded with copyPhysReg().

This allows the target to examine the COPY instruction for extra
operands indicating it can be widened to a preferable super-register
copy.  See the ARM -widen-vmovs option.

llvm-svn: 141578
2011-10-10 20:34:28 +00:00
Devang Patel
d6f05a47c1 If loop header is also loop exiting block then it may not be safe to hoist instructions.
llvm-svn: 141576
2011-10-10 20:32:03 +00:00
Devang Patel
c149f390c6 Add dominance check for the instruction being hoisted.
For example, MachineLICM should not hoist a load that is not guaranteed to be executed.
Radar 10254254.

llvm-svn: 141569
2011-10-10 19:09:20 +00:00
Bill Wendling
a2a555b0fc Use the code that lowers the arguments and spills any values which are alive
across unwind edges. This is for the back-end which expects such things.

The code is from the original SjLj EH pass.

llvm-svn: 141463
2011-10-08 00:56:47 +00:00
Bill Wendling
0f5b533c48 Thread the chain through the eh.sjlj.setjmp intrinsic, like it's documented to
do. This will be useful later on with the new SJLJ stuff.

llvm-svn: 141416
2011-10-07 21:25:38 +00:00
Andrew Trick
276ecf218a PostRA scheduler fix. Clear stale loop dependencies.
Fixes <rdar://problem/10235725>

llvm-svn: 141357
2011-10-07 06:33:09 +00:00
Andrew Trick
7eeb88cd98 whitespace
llvm-svn: 141356
2011-10-07 06:27:02 +00:00
Eli Friedman
4d63ca106a Remove the old atomic instrinsics. autoupgrade functionality is included with this patch.
llvm-svn: 141333
2011-10-06 23:20:49 +00:00
Bill Wendling
7a40520a37 Modify the mapping from landing pad to call sites to accept more than one call
site.

llvm-svn: 141226
2011-10-05 22:24:35 +00:00
Bill Wendling
94f80818c1 Add an ivar that maps a landing pad's EH symbol to the call sites that may jump
to the landing pad. This will be used by the back-end to generate the jump
tables for dispatching the arriving longjmp in sjlj eh.

llvm-svn: 141224
2011-10-05 22:20:38 +00:00
Bill Wendling
dfda32ab43 Small refactoring. Cache the FunctionInfo->MBB into a local variable.
llvm-svn: 141221
2011-10-05 22:16:11 +00:00
Jakob Stoklund Olesen
153f593870 Fix sub-register operand verification.
PhysReg operands are not allowed to have sub-register indices at all.

For virtual registers with sub-reg indices, check that all registers in
the register class support the sub-reg index.

llvm-svn: 141220
2011-10-05 22:12:57 +00:00
Bill Wendling
79111c4a48 Fix comment to reflect the new EH stuff.
llvm-svn: 141218
2011-10-05 22:04:08 +00:00