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

11689 Commits

Author SHA1 Message Date
Rafael Espindola
16b23d9ff7 Factor some code to needsCFIMoves. Avoid printing moves when we don't have to.
llvm-svn: 130501
2011-04-29 14:14:06 +00:00
Devang Patel
900ceb725b Teach dwarf writer to handle complex address expression for .debug_loc entries.
This fixes clang generated blocks' variables' debug info.
Radar 9279956.

llvm-svn: 130373
2011-04-28 02:22:40 +00:00
Eli Friedman
86181251f3 Fix a silly mistake in r130338.
llvm-svn: 130360
2011-04-28 00:42:03 +00:00
Rafael Espindola
36e419b524 Remove unnecessary argument.
llvm-svn: 130343
2011-04-27 23:17:57 +00:00
Rafael Espindola
0525497a16 Rename getPersonalityPICSymbol to getCFIPersonalitySymbol, document it, and
give it a bit more responsibility. Also implement it for MachO.

If hacked to use cfi, 32 bit MachO will produce

.cfi_personality 155, L___gxx_personality_v0$non_lazy_ptr

and 64 bit will produce

.cfi_presonality ___gxx_personality_v0

The general idea is that .cfi_personality gets passed the final symbol. It is
up to codegen to produce it if using indirect representation (like 32 bit
MachO), but it is up to MC to decide which relocations to create.

llvm-svn: 130341
2011-04-27 23:08:15 +00:00
Devang Patel
42736cb058 Simplify handling of variables with complex address (i.e. blocks variables)
llvm-svn: 130339
2011-04-27 22:45:24 +00:00
Eli Friedman
c5406cdb50 Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common. rdar://problem/9303592 .
llvm-svn: 130338
2011-04-27 22:41:55 +00:00
Eli Friedman
fc1152d772 Remove unused function.
llvm-svn: 130337
2011-04-27 22:21:02 +00:00
Rafael Espindola
6bf5acb38d Fix indentation.
llvm-svn: 130331
2011-04-27 21:29:52 +00:00
Devang Patel
42f4a7ff92 Revert r130178. It turned out to be not the optimal path to emit complex location expressions.
llvm-svn: 130326
2011-04-27 20:29:27 +00:00
Evan Cheng
fa34d31aa4 If converter was being too cute. It look for root BBs (which don't have
successors) and use inverse depth first search to traverse the BBs. However
that doesn't work when the CFG has infinite loops. Simply do a linear
traversal of all BBs work just fine.

rdar://9344645

llvm-svn: 130324
2011-04-27 19:32:43 +00:00
Jakob Stoklund Olesen
adb564f3cd Also add <imp-def> operands for defined and dead super-registers when rewriting.
We cannot rely on the <imp-def> operands added by LiveIntervals in all cases as
demonstrated by the test case.

llvm-svn: 130313
2011-04-27 17:42:31 +00:00
Jakob Stoklund Olesen
2fa051f068 Add a safe-guard against repeated splitting for some rare cases.
The number of blocks covered by a live range must be strictly decreasing when
splitting, otherwise we can't allow repeated splitting.

llvm-svn: 130249
2011-04-26 22:33:12 +00:00
Evan Cheng
dea3347167 Be careful about scheduling nodes above previous calls. It increase usages of
more callee-saved registers and introduce copies. Only allows it if scheduling
a node above calls would end up lessen register pressure.

Call operands also has added ABI restrictions for register allocation, so be
extra careful with hoisting them above calls.

rdar://9329627

llvm-svn: 130245
2011-04-26 21:31:35 +00:00
Rafael Espindola
e238ffe4ba Print the label if we will use it in debug_frame.
llvm-svn: 130232
2011-04-26 19:26:53 +00:00
Devang Patel
09b1585aac Refactor code. Keep dwarf register operation selection logic at one place.
llvm-svn: 130231
2011-04-26 19:06:18 +00:00
Jakob Stoklund Olesen
c9cf507d93 Use the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.
This has two effects: 1. We never inflate to a larger register class than what
the sub-target can handle. 2. Completely unconstrained virtual registers get the
largest possible register class.

llvm-svn: 130229
2011-04-26 18:52:36 +00:00
Dan Gohman
fbb7ade7ae Fast-isel support for simple inline asms.
llvm-svn: 130205
2011-04-26 17:18:34 +00:00
Chris Lattner
37fec9f729 don't emit the symbol name twice for local bss and common
symbols.  For example, don't emit:
        .comm   _i,4,2                  ## @i
                                        ## @i

instead emit:
        .comm   _i,4,2                  ## @i

llvm-svn: 130192
2011-04-26 06:14:13 +00:00
Evan Cheng
73a9ae3388 Fix typo
llvm-svn: 130190
2011-04-26 04:57:37 +00:00
Rafael Espindola
59c3a084c6 Print all the moves at a given label instead of just the first one.
Remove previous DwarfCFI hack.

llvm-svn: 130187
2011-04-26 03:58:56 +00:00
Devang Patel
4969322bc4 Let dwarf writer allocate extra space in the debug location expression. This space, if requested, will be used for complex addresses of the Blocks' variables.
llvm-svn: 130178
2011-04-26 00:12:46 +00:00
Devang Patel
3da97b7d34 Rename a local variable.
llvm-svn: 130171
2011-04-25 23:05:21 +00:00
Devang Patel
e28211b031 Rename a method to match what it really does.
s/addVariableAddress/addFrameVariableAddress/g

llvm-svn: 130170
2011-04-25 23:02:17 +00:00
Devang Patel
b1b33d6569 Do not drop a variable's complex address if it is not based on frame base.
Observed this while reading code, so I do not have a test case handy here.

llvm-svn: 130167
2011-04-25 22:52:55 +00:00
Devang Patel
83eac5e134 A dbg.declare may not be in entry block, even if it is referring to an incoming argument. However, It is appropriate to emit DBG_VALUE referring to this incoming argument in entry block in MachineFunction.
llvm-svn: 130129
2011-04-25 16:33:52 +00:00
Rafael Espindola
a14f5303dd Simplify the logic. Noticed by aKor.
llvm-svn: 130116
2011-04-24 19:55:34 +00:00
Rafael Espindola
8c824c73b6 Synchronize the conditions for producing a .cfi_startproc and a .cfi_endproc.
Fixes PR9787.

llvm-svn: 130115
2011-04-24 19:00:34 +00:00
Sebastian Redl
5fea40be23 Give SplitKit.h a header guard.
llvm-svn: 130095
2011-04-24 15:46:51 +00:00
Jay Foad
c146569beb Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Owen Anderson
e1b33b92a3 Teach FastISel to deal with instructions that have two immediate operands.
llvm-svn: 130033
2011-04-22 23:38:06 +00:00
Devang Patel
929bbb6bf9 Let front-end tie subprogram declaration with subprogram definition directly.
llvm-svn: 130028
2011-04-22 23:10:17 +00:00
Jakob Stoklund Olesen
0dcf650f0a Always compare the cost of region splitting with the cost of per-block splitting.
Sometimes it is better to split per block, and we missed those cases.

llvm-svn: 130025
2011-04-22 22:47:40 +00:00
Chris Lattner
d9c0db9bd7 Recommit the fix for rdar://9289512 with a couple tweaks to
fix bugs exposed by the gcc dejagnu testsuite:
1. The load may actually be used by a dead instruction, which
   would cause an assert.
2. The load may not be used by the current chain of instructions,
   and we could move it past a side-effecting instruction. Change
   how we process uses to define the problem away.

llvm-svn: 130018
2011-04-22 21:59:37 +00:00
Benjamin Kramer
f6eab5f86e DAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.
On x86 this allows to fold a load into the cmp, greatly reducing register pressure.
  movzbl	(%rdi), %eax
  cmpl	$47, %eax
->
  cmpb	$47, (%rdi)

This shaves 8k off gcc.o on i386. I'll leave applying the patch in README.txt to Chris :)

llvm-svn: 130005
2011-04-22 18:47:44 +00:00
Devang Patel
6aac901f77 Do not leak argument's DbgVariables.
llvm-svn: 130004
2011-04-22 18:09:57 +00:00
Evan Cheng
1f353e2438 Typo
llvm-svn: 129970
2011-04-22 01:40:20 +00:00
Bill Wendling
b0df282414 Branch folding is folding a landing pad into a regular BB.
An exception is thrown via a call to _cxa_throw, which we don't expect to
return. Therefore, the "true" part of the invoke goes to a BB that has
'unreachable' as its only instruction. This is lowered into an empty MachineBB.
The landing pad for this invoke, however, is directly after the "true" MBB.
When the empty MBB is removed, the landing pad is directly below the BB with the
invoke call. The unconditional branch is removed and then the two blocks are
merged together.

The testcase is too big for a regression test.
<rdar://problem/9305728>

llvm-svn: 129965
2011-04-22 01:07:09 +00:00
Devang Patel
4f25432e4e Refactor.
llvm-svn: 129938
2011-04-21 21:07:35 +00:00
Matt Beaumont-Gay
eb07568f1b Don't recycle loop variables.
llvm-svn: 129928
2011-04-21 19:46:23 +00:00
Jakob Stoklund Olesen
5053b8795b Allow allocatable ranges from global live range splitting to be split again.
These intervals are allocatable immediately after splitting, but they may be
evicted because of later splitting. This is rare, but when it happens they
should be split again.

The remainder intervals that cannot be allocated after splitting still move
directly to spilling.

SplitEditor::finish can optionally provide a mapping from new live intervals
back to the original interval indexes returned by openIntv().

Each original interval index can map to multiple new intervals after connected
components have been separated. Dead code elimination may also add existing
intervals to the list.

The reverse mapping allows the SplitEditor client to treat the new intervals
differently depending on the split region they came from.

llvm-svn: 129925
2011-04-21 18:38:15 +00:00
Devang Patel
a31b73427e Add comment in output stream.
llvm-svn: 129921
2011-04-21 17:50:24 +00:00
Daniel Dunbar
3a96439b36 Revert r1296656, "Fix rdar://9289512 - not folding load into compare at -O0...",
which broke a couple GCC test suite tests at -O0.

llvm-svn: 129914
2011-04-21 16:14:46 +00:00
Jakob Stoklund Olesen
22089a66fb Add debug output for rematerializable instructions.
llvm-svn: 129883
2011-04-20 22:14:20 +00:00
Jakob Stoklund Olesen
266de7e1e1 Permit remat when a virtual register has multiple defs.
TII::isTriviallyReMaterializable() shouldn't depend on any properties of the
register being defined by the instruction. Rematerialization is going to create
a new virtual register anyway.

llvm-svn: 129882
2011-04-20 22:14:17 +00:00
Jakob Stoklund Olesen
6501ea2557 Prefer cheap registers for busy live ranges.
On the x86-64 and thumb2 targets, some registers are more expensive to encode
than others in the same register class.

Add a CostPerUse field to the TableGen register description, and make it
available from TRI->getCostPerUse. This represents the cost of a REX prefix or a
32-bit instruction encoding required by choosing a high register.

Teach the greedy register allocator to prefer cheap registers for busy live
ranges (as indicated by spill weight).

llvm-svn: 129864
2011-04-20 18:19:48 +00:00
Stuart Hastings
a552942e02 ARM byval support. Will be enabled by another patch to the FE. <rdar://problem/7662569>
llvm-svn: 129858
2011-04-20 16:47:52 +00:00
Rafael Espindola
09e9797728 Remove unused arguments.
llvm-svn: 129844
2011-04-20 03:08:09 +00:00
Eric Christopher
4c3c7c8211 Rewrite the expander for umulo/smulo to remember to sign extend the input
manually and pass all (now) 4 arguments to the mul libcall. Add a new
ExpandLibCall for just this (copied gratuitously from type legalization).

Fixes rdar://9292577

llvm-svn: 129842
2011-04-20 01:19:45 +00:00
Daniel Dunbar
82a4062a4e ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OS
triple component.

llvm-svn: 129838
2011-04-20 00:14:25 +00:00