1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

192 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
2f0fbb4587 Revert "Use a simpler data structure to calculate the least recently used register in RegAllocLocal."
This reverts commit 101392. It broke a buildbot.

llvm-svn: 101595
2010-04-17 00:38:36 +00:00
Jakob Stoklund Olesen
51248b6cb4 Use a simpler data structure to calculate the least recently used register in RegAllocLocal.
This makes the local register allocator about 20% faster.

llvm-svn: 101574
2010-04-16 23:32:37 +00:00
Chris Lattner
80b41881bc rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Chris Lattner
d015147472 reduce indentation, fit in 80 cols and various other cosmetic cleanups.
llvm-svn: 99989
2010-03-31 05:15:22 +00:00
Dan Gohman
76da319f8f Add explicit braces to avoid ambiguous ‘else’.
llvm-svn: 98838
2010-03-18 18:07:13 +00:00
Bill Wendling
44b1fe3ee1 Use getFirstTerminator().
llvm-svn: 98604
2010-03-16 02:01:51 +00:00
Bill Wendling
5f6361464d When checking if something's killed, don't rely simply on whether it's marked as
"used outside of the block". If the block ends in a return, then it won't be
used outside of it.

llvm-svn: 98599
2010-03-16 01:05:35 +00:00
Dale Johannesen
b410c3010b Reapply 96294; now that I've gotten around to looking
at older buildbot messages, I see the failure predates
this patch.

llvm-svn: 96307
2010-02-16 01:27:47 +00:00
Dale Johannesen
df6f49fc2d Something broke. Hard to believe it was this patch
but it's harder to believe it's the other candidate,
so reverting.  Temporarily I hope.

llvm-svn: 96303
2010-02-16 00:43:58 +00:00
Dale Johannesen
16ec2c06bc More handling of DBG_VALUE.
llvm-svn: 96294
2010-02-15 23:05:03 +00:00
Dale Johannesen
c23d94e163 Ignore DBG_VALUE in a couple more places.
llvm-svn: 96207
2010-02-15 01:45:47 +00:00
Dale Johannesen
c9f253214e Fix comments to reflect renaming elsewhere.
llvm-svn: 95730
2010-02-10 00:11:11 +00:00
Chris Lattner
7acf9be6c4 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.

llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Dale Johannesen
1e9d147461 Reapply 95050 with a tweak to check the register class.
llvm-svn: 95183
2010-02-03 01:40:33 +00:00
Dale Johannesen
08ab638bdc Test revert 95050; there's a good chance it's causing
buildbot failure.

llvm-svn: 95103
2010-02-02 18:52:56 +00:00
Dale Johannesen
a20fc3d1a9 Make local RA smarter about reusing input register of a copy
as output.  Needed for (functional) correctness in inline asm,
and should be generally beneficial.  7361612.

llvm-svn: 95050
2010-02-02 02:08:02 +00:00
Dale Johannesen
9774a29dc0 Fix a case where debug_value could affect codegen.
llvm-svn: 94866
2010-01-30 00:57:47 +00:00
David Greene
9564dbcc2a Change errs() to dbgs().
llvm-svn: 92595
2010-01-05 01:26:05 +00:00
Dale Johannesen
365ae431a7 Do better with physical reg operands (typically, from inline asm)
in local register allocator.  If a reg-reg copy has a phys reg
input and a virt reg output, and this is the last use of the phys
reg, assign the phys reg to the virt reg.  If a reg-reg copy has
a phys reg output and we need to reload its spilled input, reload
it directly into the phys reg than passing it through another reg.

Following 76208, there is sometimes no dependency between the def of
a phys reg and its use; this creates a window where that phys reg
can be used for spilling (this is true in linear scan also).  This
is bad and needs to be fixed a better way, although 76208 works too
well in practice to be reverted.  However, there should normally be
no spilling within inline asm blocks.  The patch here goes a long way
towards making this actually be true.

llvm-svn: 91485
2009-12-16 00:29:41 +00:00
David Greene
58e7c6145b Add a bool flag to StackObjects telling whether they reference spill
slots.  The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values.  It's too easy to pass a wrong argument
value when multiple arguments have default values.  Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..

llvm-svn: 87022
2009-11-12 20:49:22 +00:00
Nick Lewycky
2b8400628d Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.

llvm-svn: 85043
2009-10-25 06:57:41 +00:00
Nick Lewycky
711c726c97 Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.

llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Evan Cheng
5ab1ccfaee Distinquish stack slots from other stack objects. They (and fixed objects) get FixedStack PseudoSourceValues.
llvm-svn: 84326
2009-10-17 09:20:14 +00:00
Bill Wendling
2e996850e3 Convert DOUT to DEBUG(errs()...).
llvm-svn: 79758
2009-08-22 20:38:09 +00:00
Dan Gohman
4529d71681 Use setPreservesAll and setPreservesCFG in CodeGen passes.
llvm-svn: 77754
2009-07-31 23:37:33 +00:00
Daniel Dunbar
8496064116 More migration to raw_ostream, the water has dried up around the iostream hole.
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
   "magic" DOUT behavior which avoided calling printing functions when the
   statement was disabled. In addition to being unnecessary magic, it had the
   downside of leaving code in -Asserts builds, and of hiding potentially
   unnecessary computations.

llvm-svn: 77019
2009-07-25 00:23:56 +00:00
Torok Edwin
9b41a5faf2 Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
and abort()/exit() -> llvm_report_error().

llvm-svn: 75363
2009-07-11 13:10:19 +00:00
Bob Wilson
d61f4e70d8 Fix pr4100. Do not remove no-op copies when they are dead. The register
scavenger gets confused about register liveness if it doesn't see them.
I'm not thrilled with this solution, but it only comes up when there are dead
copies in the code, which is something that hopefully doesn't happen much.

Here is what happens in pr4100: As shown in the following excerpt from the
debug output of llc, the source of a move gets reloaded from the stack,
inserting a new load instruction before the move.  Since that source operand
is a kill, the physical register is free to be reused for the destination
of the move.  The move ends up being a no-op, copying R3 to R3, so it is
deleted.  But, it leaves behind the load to reload %reg1028 into R3, and
that load is not updated to show that it's destination operand (R3) is dead.
The scavenger gets confused by that load because it thinks that R3 is live.

Starting RegAlloc of: %reg1025<def,dead> = MOVr %reg1028<kill>, 14, %reg0, %reg0
  Regs have values: 
  Reloading %reg1028 into R3
  Last use of R3[%reg1028], removing it from live set
  Assigning R3 to %reg1025
  Register R3 [%reg1025] is never used, removing it from live set

Alternative solutions might be either marking the load as dead, or zapping
the load along with the no-op copy.  I couldn't see an easy way to do
either of those, though.

llvm-svn: 71196
2009-05-07 23:47:03 +00:00
Bob Wilson
a46384485b Fix a comment (again).
llvm-svn: 71180
2009-05-07 21:20:42 +00:00
Bob Wilson
8028930294 Fix a comment.
llvm-svn: 71179
2009-05-07 21:19:45 +00:00
Bob Wilson
c53238dff1 Fix pr3954. The register scavenger asserts for inline assembly with
register destinations that are tied to source operands.  The
TargetInstrDescr::findTiedToSrcOperand method silently fails for inline
assembly.  The existing MachineInstr::isRegReDefinedByTwoAddr was very
close to doing what is needed, so this revision makes a few changes to
that method and also renames it to isRegTiedToUseOperand (for consistency
with the very similar isRegTiedToDefOperand and because it handles both
two-address instructions and inline assembly with tied registers).

llvm-svn: 68714
2009-04-09 17:16:43 +00:00
Evan Cheng
f47c144bff Added MachineInstr::isRegTiedToDefOperand to check for two-addressness.
llvm-svn: 67335
2009-03-19 20:30:06 +00:00
Evan Cheng
1ffb8d20e8 Local register allocator shouldn't assume only the entry and landing pad basic blocks have live-ins.
llvm-svn: 63323
2009-01-29 18:37:30 +00:00
Evan Cheng
1346d22223 Exit with nice warnings when register allocator run out of registers.
llvm-svn: 63267
2009-01-29 02:20:59 +00:00
Evan Cheng
71bbbe44d8 A slight compile time optimization. If the caller knows there isn't a free register getReg() should not call getFreeReg().
llvm-svn: 63263
2009-01-29 01:13:00 +00:00
Evan Cheng
b3c82db63d Change TargetInstrInfo::isMoveInstr to return source and destination sub-register indices as well.
llvm-svn: 62600
2009-01-20 19:12:24 +00:00
Dan Gohman
1e7dff35a6 Drop the reg argument to isRegReDefinedByTwoAddr, which was redundant.
llvm-svn: 60586
2008-12-05 05:45:42 +00:00
Matthijs Kooijman
b316bd9e62 Minor fix debug for register allocation debug output.
llvm-svn: 59961
2008-11-24 16:01:21 +00:00
Dan Gohman
9543edc4ef Fix command-line option printing to print two spaces where needed,
instead of requiring all "short description" strings to begin with
two spaces. This makes these strings less mysterious, and it fixes
some cases where short description strings mistakenly did not
begin with two spaces.

llvm-svn: 57521
2008-10-14 20:25:08 +00:00
Owen Anderson
7f99714393 Fix the case where an instruction is not properly marked as using all registers that alias its inputs.
llvm-svn: 57286
2008-10-08 04:30:51 +00:00
Dan Gohman
638a8001c8 Fix a bug in the local allocator's liveness computation where it
was setting kill flags on tied uses in two-address instructions.
The kill flags were causing the allocator to think it could
allocate the use and its tied def in different registers.

llvm-svn: 57039
2008-10-04 00:31:14 +00:00
Dan Gohman
30c5ce1b7d Switch the MachineOperand accessors back to the short names like
isReg, etc., from isRegister, etc.

llvm-svn: 57006
2008-10-03 15:45:36 +00:00
Dale Johannesen
4184c23365 Remove SelectionDag early allocation of registers
for earlyclobbers.  Teach Local RA about earlyclobber,
and add some tests for it.

llvm-svn: 56592
2008-09-24 23:13:09 +00:00
Dan Gohman
fa32c7c6d9 Remove isImm(), isReg(), and friends, in favor of
isImmediate(), isRegister(), and friends, to avoid confusion
about having two different names with the same meaning. I'm
not attached to the longer names, and would be ok with
changing to the shorter names if others prefer it.

llvm-svn: 56189
2008-09-13 17:58:21 +00:00
Dan Gohman
e1f9be27bc Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Chris Lattner
fd64cbf22d consolidate DenseMapInfo implementations, and add one for std::pair.
Patch contributed by m-s.

llvm-svn: 55167
2008-08-22 05:08:25 +00:00
Evan Cheng
d7023b66ea Change StackSlotForVirtReg (which maps vregs to frame indices) from std::map to IndexedMap.
llvm-svn: 53414
2008-07-10 18:23:23 +00:00
Evan Cheng
3ec3113431 - Change the horrible N^2 isRegReDefinedByTwoAddr. Now callers must supply the operand index of def machineoperand and at most one full scan of non-implicit operands is needed.
- Change local register allocator to use the new isRegReDefinedByTwoAddr instead of reinventing the wheel.

llvm-svn: 53394
2008-07-10 07:35:43 +00:00
Owen Anderson
65e43ae1e8 Use DenseMap instead of std::map in local register allocation. This improves the time on instcombine from .31s to .22s
llvm-svn: 53390
2008-07-10 01:56:35 +00:00
Owen Anderson
189609bb36 Fix 403.gcc. Finally got the check for two-address-ness correct.
llvm-svn: 53389
2008-07-10 01:53:01 +00:00