1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

41118 Commits

Author SHA1 Message Date
Duncan Sands
6aa2784156 Use the SSAUpdator to turn calls to eh.exception that are not in a
landing pad into uses of registers rather than loads from a stack
slot.  Doesn't touch the 'orrible hack code - Bill needs to persuade
me harder :)

llvm-svn: 112702
2010-09-01 14:07:47 +00:00
Duncan Sands
f7e2f45e1a If PrototypeValue is erased in the middle of using the SSAUpdator
then the SSAUpdator may access freed memory.  Instead, simply pass
in the type and name explicitly, which is all that was used anyway.

llvm-svn: 112699
2010-09-01 10:29:33 +00:00
Chris Lattner
9759e898f0 add a gross hack to work around a problem that Argiris reported
on llvmdev: SRoA is introducing MMX datatypes like <1 x i64>,
which then cause random problems because the X86 backend is
producing mmx stuff without inserting proper emms calls.

In the short term, force off MMX datatypes.  In the long term,
the X86 backend should not select generic vector types to MMX
registers.  This is being worked on, but won't be done in time
for 2.8.  rdar://8380055

llvm-svn: 112696
2010-09-01 05:14:33 +00:00
Bruno Cardoso Lopes
9375b2f67d Use movlps, movlpd, movss and movsd specific nodes instead of pattern matching with movlp pattern fragment
llvm-svn: 112694
2010-09-01 05:08:25 +00:00
Dan Gohman
ad593f9d93 Revert 112442 and 112440 until the compile time problems introduced
by 112440 are resolved.

llvm-svn: 112692
2010-09-01 01:45:53 +00:00
Bruno Cardoso Lopes
b69568ab33 minor change, simplify some logic
llvm-svn: 112689
2010-09-01 00:57:08 +00:00
Bruno Cardoso Lopes
c31697f68c Move some functions around so they can be used for some other to come function
llvm-svn: 112687
2010-09-01 00:51:36 +00:00
Devang Patel
9e8ee9242f Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
This patch was developed on top of original patch by Artur Pietrek.

llvm-svn: 112678
2010-08-31 23:50:19 +00:00
Chris Lattner
5ed5e29575 licm is wasting time hoisting constant foldable operations,
instead of hoisting them, just fold them away.  This occurs in the
testcase for PR8041, for example.

llvm-svn: 112669
2010-08-31 23:00:16 +00:00
Kevin Enderby
cc1c9257f6 This is the second of three patches to implement support for the .loc directive
and output the dwarf line number tables.  This takes the current loc info after
an instruction is assembled and saves the needed info into an object that has
vector and for each section.  These objects will be used for the final patch to 
build and emit the encoded dwarf line number tables.  Again for now this is only
in the Mach-O streamer but at some point will move to a more generic place.

llvm-svn: 112668
2010-08-31 22:55:11 +00:00
Dan Gohman
fb64948296 Reapply r112432, now that the real problem is addressed.
llvm-svn: 112667
2010-08-31 22:53:17 +00:00
Dan Gohman
cadc463790 Reapply r112433, now that the real problem is addressed.
llvm-svn: 112666
2010-08-31 22:52:12 +00:00
Dan Gohman
a9b5b6bd36 Revert r110916. This patch is buggy because the code inside the
inner loop doesn't update all the variables in the outer loop.

llvm-svn: 112665
2010-08-31 22:50:31 +00:00
Bill Wendling
bb6052cfd6 We have a chance for an optimization. Consider this code:
int x(int t) {
  if (t & 256)
    return -26;
  return 0;
}

We generate this:

     tst.w   r0, #256
     mvn     r0, #25
     it      eq
     moveq   r0, #0

while gcc generates this:

     ands    r0, r0, #256
     it      ne
     mvnne   r0, #25
     bx      lr

Scandalous really!

During ISel time, we can look for this particular pattern. One where we have a
"MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND
instruction to 0. Something like this (greatly simplified):

  %r0 = ISD::AND ...
  ARMISD::CMPZ %r0, 0         @ sets [CPSR]
  %r0 = ARMISD::MOVCC 0, -26  @ reads [CPSR]

All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR]
when it's zero. The zero value will all ready be in the %r0 register and we only
need to change it if the AND wasn't zero. Easy!

llvm-svn: 112664
2010-08-31 22:41:22 +00:00
Anton Korobeynikov
1fa6799edc Some fixes for NetBSD
llvm-svn: 112662
2010-08-31 22:38:00 +00:00
Bruno Cardoso Lopes
80613a070e Use x86 specific MOVSLDUP node, add more patterns to match it and remove useless load nodes
llvm-svn: 112661
2010-08-31 22:35:05 +00:00
Devang Patel
46570e6783 Reapply r112623. Included additional check for unused byval argument.
llvm-svn: 112659
2010-08-31 22:22:42 +00:00
Bruno Cardoso Lopes
8fc83b1960 Use x86 specific MOVSHDUP node and add more patterns to match it
llvm-svn: 112657
2010-08-31 22:22:11 +00:00
Bill Wendling
4a52e8fec0 And ANDS pattern to match the t2ANDS pattern.
llvm-svn: 112654
2010-08-31 22:05:37 +00:00
Jakob Stoklund Olesen
7ffcddc113 Make %EFLAGS unallocatable.
No CCR virtual registers should exist, and %EFLAGS is used in ways that can
surprise RegAllocFast.

llvm-svn: 112650
2010-08-31 21:51:07 +00:00
Jakob Stoklund Olesen
9fe6b84fb2 Track liveness of unallocatable, unreserved registers in machine DCE.
Reserved registers are unpredictable, and are treated as always live by machine
DCE.

Allocatable registers are never reserved, and can be used for virtual registers.

Unreserved, unallocatable registers can not be used for virtual registers, but
otherwise behave like a normal allocatable register. Most targets only have
the flag register in this set.

llvm-svn: 112649
2010-08-31 21:51:05 +00:00
Bruno Cardoso Lopes
dfa177cf81 Use MOVHLPS node instead of matching using movhlps and movhlps_undef pattern fragments
llvm-svn: 112644
2010-08-31 21:38:49 +00:00
Chris Lattner
f2ee739a2b tidy up
llvm-svn: 112643
2010-08-31 21:21:25 +00:00
Bruno Cardoso Lopes
6fbe7b9ddd Use MOVLHPS and MOVHLPS x86 nodes whenever possible. Also remove some useless nodes
llvm-svn: 112642
2010-08-31 21:15:21 +00:00
Dan Gohman
6822b9d177 Revert r112432. It appears to be exposing a problem in the emacs build.
llvm-svn: 112638
2010-08-31 20:58:44 +00:00
Owen Anderson
233463074b More cleanups of my JumpThreading transforms, including extracting some duplicated code into a helper function.
llvm-svn: 112634
2010-08-31 20:26:04 +00:00
Jakob Stoklund Olesen
d76e5132e7 Ignore unallocatable registers in RegAllocFast.
llvm-svn: 112632
2010-08-31 19:54:25 +00:00
Devang Patel
b94251aea0 Revert r112623. It is causing self host build failures.
llvm-svn: 112631
2010-08-31 19:41:03 +00:00
Owen Anderson
66b51ff843 Add an RAII helper to make cleanup of the RecursionSet more fool-proof.
llvm-svn: 112628
2010-08-31 19:24:27 +00:00
Owen Anderson
5e2c04e417 Only try to clean up the current block if we changed that block already.
llvm-svn: 112625
2010-08-31 18:55:52 +00:00
Jim Grosbach
9cc0a6397a SP relative offsets need to be adjusted by the local allocation size when
determining if they're likely to be in range of the SP when resolving
frame references.

llvm-svn: 112624
2010-08-31 18:52:31 +00:00
Devang Patel
414cbc940a Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.

llvm-svn: 112623
2010-08-31 18:50:09 +00:00
Jim Grosbach
d0ebe535e9 this assert should just be a condition, since this function is just asking if
the offset is legally encodable, not actually trying to do the encoding.

llvm-svn: 112622
2010-08-31 18:49:31 +00:00
Owen Anderson
e2b5bd3a7f Refactor my fix for PR5652 to terminate the predecessor lookups after the first failure.
llvm-svn: 112620
2010-08-31 18:48:48 +00:00
Jim Grosbach
ddc265a982 Improve virtual frame base register allocation heuristics.
1. Allocate them in the entry block of the function to enable function-wide
     re-use. The instructions to create them should be re-materializable, so
     there shouldn't be additional cost compared to creating them local
     to the basic blocks where they are used.
  2. Collect all of the frame index references for the function and sort them
     by the local offset referenced. Iterate over the sorted list to
     allocate the virtual base registers. This enables creation of base
     registers optimized for positive-offset access of frame references.
     (Note: This may be appropriate to later be a target hook to do the
     sorting in a target appropriate manner. For now it's done here for
     simplicity.)

llvm-svn: 112609
2010-08-31 17:58:19 +00:00
Dan Gohman
47865eb626 Speculatively revert r112433.
llvm-svn: 112608
2010-08-31 17:56:47 +00:00
Benjamin Kramer
3f8b8c1f5b Allow creation of SHT_NULL sections, from Roman Divacky.
llvm-svn: 112605
2010-08-31 17:03:33 +00:00
Duncan Sands
2a1c11e104 Stop using the dom frontier in DwarfEHPrepare by not promoting alloca's
any more.  I plan to reimplement alloca promotion using SSAUpdater later.
It looks like Bill's URoR logic really always needs domtree, so the pass
now always asks for domtree info.

llvm-svn: 112597
2010-08-31 09:05:06 +00:00
Nick Lewycky
66fe124a92 Fix an infinite loop; merging two functions will create a new function (if the
two are weak, we make them thunks to a new strong function) so don't iterate
through the function list as we're modifying it.

Also add back the outermost loop which got removed during the cleanups.

llvm-svn: 112595
2010-08-31 08:29:37 +00:00
Owen Anderson
bf12defee5 Don't perform an extra traversal of the function just to do cleanup. We can safely simplify instructions after each block has been processed without worrying about iterator invalidation.
llvm-svn: 112594
2010-08-31 07:55:56 +00:00
Bill Wendling
0409e77e99 - Cleanup some whitespaces.
- Convert {0,1} and friends into 0b01, which is identical and more consistent.

llvm-svn: 112593
2010-08-31 07:50:46 +00:00
Owen Anderson
ccaee65189 Rename ValuePropagation to a more descriptive CorrelatedValuePropagation.
llvm-svn: 112591
2010-08-31 07:48:34 +00:00
Owen Anderson
6853ce863c Rename file to something more descriptive.
llvm-svn: 112590
2010-08-31 07:41:39 +00:00
Owen Anderson
ba28fe3dcb More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly constant-fold undef, and be more careful with its return value.
This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's
handling of and/or of i1's), but never manifested before.  This patch adds a tracking set to prevent this case.

llvm-svn: 112589
2010-08-31 07:36:34 +00:00
Michael J. Spencer
ab565264fa Cleanup Whitespace.
llvm-svn: 112587
2010-08-31 06:36:46 +00:00
Michael J. Spencer
3bca7bf84d System: Fix getMagicNumber on windows.
getMagicNumber was treating the _binary_ data it read in as a
null terminated string. This resulted in the std::string
calculating the length, and causing an assert in other code that
assumed that the length it passed was the same as the length of
the string it would get back.

llvm-svn: 112586
2010-08-31 06:36:33 +00:00
Devang Patel
a1ff33906b Offset is not always unsigned number.
llvm-svn: 112584
2010-08-31 06:12:08 +00:00
Devang Patel
2eeab37306 Simplify.
llvm-svn: 112583
2010-08-31 06:11:28 +00:00
Nick Lewycky
75dfadbaf9 Switch to DenseSet, simplifying much more code. We now have a single iteration
where we hash, compare and fold, instead of one iteration where we build up
the hash buckets and a second one to fold.

llvm-svn: 112582
2010-08-31 05:53:05 +00:00
Owen Anderson
bd9edea8a3 Remove r111665, which implemented store-narrowing in InstCombine. Chris discovered a miscompilation in it, and it's not easily
fixable at the optimizer level. I'll investigate reimplementing it in DAGCombine.

llvm-svn: 112575
2010-08-31 04:41:06 +00:00