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

44103 Commits

Author SHA1 Message Date
Evan Cheng
7e96e67d98 Fix a minor bug in two-address pass. It was missing a commute opportunity.
regB = move RCX
regA = op regB, regC
RAX  = move regA
where both regB and regC are killed. If regB is constrainted to non-compatible
physical registers but regC is not constrainted at all, then it's better to
commute the instruction.
       movl    %edi, %eax
       shlq    $32, %rcx
       leaq    (%rcx,%rax), %rax
=>
       movl    %edi, %eax
       shlq    $32, %rcx
       orq     %rcx, %rax
rdar://8762995

llvm-svn: 121793
2010-12-14 21:34:53 +00:00
Jim Grosbach
70721628b4 trailing whitespace
llvm-svn: 121792
2010-12-14 21:28:29 +00:00
Matt Beaumont-Gay
01264443a8 Move debugging code entirely within DEBUG(). Silences an unused variable
warning in the opt build.

llvm-svn: 121791
2010-12-14 21:14:55 +00:00
Jim Grosbach
e84e95e6d2 Refactor a bit for legibility.
llvm-svn: 121790
2010-12-14 21:10:47 +00:00
Jim Grosbach
ef58d5968e trailing whitespace.
llvm-svn: 121789
2010-12-14 20:46:39 +00:00
Jim Grosbach
13d82ea2b1 Make sure to propagate the predicate operands for LEApcrel to ADR.
llvm-svn: 121788
2010-12-14 20:45:47 +00:00
Owen Anderson
4ce4ce2f60 Fix a small bug (typo?) in the fixup for Thumb1 CBZ/CBNZ instructions.
llvm-svn: 121784
2010-12-14 19:42:53 +00:00
Jakob Stoklund Olesen
c13ce4748e Add LiveIntervalUnion print methods, RegAllocGreedy::trySplit debug spew.
llvm-svn: 121783
2010-12-14 19:38:49 +00:00
Jakob Stoklund Olesen
c5ad05ca30 Use TRI::printReg instead of AbstractRegisterDescription when printing
LiveIntervalUnions.

llvm-svn: 121781
2010-12-14 18:53:47 +00:00
Jakob Stoklund Olesen
d0b2397aaa Add TargetRegisterInfo::printReg() to pretty-print registers.
llvm-svn: 121780
2010-12-14 18:53:39 +00:00
Jim Grosbach
25d3e79b23 ARM Fixups relative to thumb functions need to have the low bit of the value
set for interworking to work properly. rdar://8755956

llvm-svn: 121778
2010-12-14 18:46:57 +00:00
Jakob Stoklund Olesen
74ba8b77e6 Q.seenAllInterferences() must be called after Q.collectInterferingVRegs().
llvm-svn: 121774
2010-12-14 17:47:36 +00:00
Daniel Dunbar
3f9b9dc852 MC/ARM: Fix-up fixup offset for fixup_arm_branch target specific fixup.
llvm-svn: 121772
2010-12-14 17:37:16 +00:00
Jim Grosbach
88727a93a8 Trailing whitespace
llvm-svn: 121769
2010-12-14 16:25:15 +00:00
Bill Wendling
4fe39bae17 Use the integer scheduling intrinsic for integer loads and stores.
llvm-svn: 121765
2010-12-14 12:33:05 +00:00
Chris Lattner
c1aaf52608 - Insert new instructions before DomBlock's terminator,
which is simpler than finding a place to insert in BB.
 - Don't perform the 'if condition hoisting' xform on certain
   i1 PHIs, as it interferes with switch formation.

This re-fixes "example 7", without breaking the world hopefully.

llvm-svn: 121764
2010-12-14 08:46:09 +00:00
Chris Lattner
22d4dc5a4d fix two significant issues with FoldTwoEntryPHINode:
first, it can kick in on blocks whose conditions have been
folded to a constant, even though one of the edges will be
trivially folded.

second, it doesn't clean up the "if diamond" that it just 
eliminated away.  This is a problem because other simplifycfg
xforms kick in depending on the order of block visitation,
causing pointless work.

llvm-svn: 121762
2010-12-14 08:01:53 +00:00
Chris Lattner
362f9a82c0 remove the instsimplify logic I added in r121754. It is apparently
breaking the selfhost builds, though I can't fathom how.

llvm-svn: 121761
2010-12-14 07:53:03 +00:00
Chris Lattner
c2e42269ae clean up logic, convert std::set to SmallPtrSet, handle the case
when all 2-entry phis are simplified away.

llvm-svn: 121760
2010-12-14 07:41:39 +00:00
Chris Lattner
8e4194276b tidy up a bit, move DEBUG down to when we commit to doing the transform so we
don't print it unless the xform happens.

llvm-svn: 121758
2010-12-14 07:23:10 +00:00
Chris Lattner
811462b2f4 use SimplifyInstruction instead of reimplementing part of it.
llvm-svn: 121757
2010-12-14 07:20:29 +00:00
Chris Lattner
e2400eb801 simplify GetIfCondition by using getSinglePredecessor.
llvm-svn: 121756
2010-12-14 07:15:21 +00:00
Chris Lattner
8ea88e66dd use AddPredecessorToBlock in 3 places instead of a manual loop.
llvm-svn: 121755
2010-12-14 07:09:42 +00:00
Chris Lattner
a87ac36a54 make FoldTwoEntryPHINode use instsimplify a bit, make
GetIfCondition faster by avoiding pred_iterator.  No
really interesting change.

llvm-svn: 121754
2010-12-14 07:00:00 +00:00
Chris Lattner
027d572664 remove the dead (and terrible) llvm::RemoveSuccessor function.
llvm-svn: 121753
2010-12-14 06:51:55 +00:00
Chris Lattner
d9436ab7d7 improve DEBUG's a bit, switch to eraseFromParent() to simplify
code a bit, switch from constant folding to instsimplify.

llvm-svn: 121751
2010-12-14 06:17:25 +00:00
Chris Lattner
093b5b256d reapply my recent change that disables a piece of the switch formation
work, but fixes 400.perlbmk.

llvm-svn: 121749
2010-12-14 05:57:30 +00:00
Bill Wendling
61720b79f9 The tLDR et al instructions were emitting either a reg/reg or reg/imm
instruction based on the t_addrmode_s# mode and what it returned. There is some
obvious badness to this. In particular, it's hard to do MC-encoding when the
instruction may change out from underneath you after the t_addrmode_s# variable
is finally resolved.

The solution is to revert a long-ago change that merged the reg/reg and reg/imm
versions. There is the addition of several new addressing modes. They no longer
have extraneous operands associated with them. I.e., if it's reg/reg we don't
have to have a dummy zero immediate tacked on to the SDNode.

There are some obvious cleanups here, which will happen shortly.

llvm-svn: 121747
2010-12-14 03:36:38 +00:00
Evan Cheng
6a2bed92f5 bfi A, (and B, C1), C2) -> bfi A, B, C2 iff C1 & C2 == C1. rdar://8458663
llvm-svn: 121746
2010-12-14 03:22:07 +00:00
Jakob Stoklund Olesen
d4d3c5dd1e Remove unused vector.
llvm-svn: 121741
2010-12-14 00:58:47 +00:00
Jakob Stoklund Olesen
00d6ac22d0 Try reassigning all virtual register interferences, not just those with lower
spill weight. Filter out fixed registers instead.

Add support for reassigning an interference that was assigned to an alias.

llvm-svn: 121737
2010-12-14 00:37:49 +00:00
Jakob Stoklund Olesen
ffefd5bd4e Add stub for RAGreedy::trySplit.
llvm-svn: 121736
2010-12-14 00:37:44 +00:00
Owen Anderson
c84f8c23b3 Second attempt at make Thumb2 LEAs pseudos. This time, perform the lowering much later, which makes the entire
process cleaner.

llvm-svn: 121735
2010-12-14 00:36:49 +00:00
Owen Anderson
5536134dc4 Fix recent buildbot breakage by pulling SimplifyCFG back to its state as of r121694, the most recent state
where I'm confident there were no crashes or miscompilations.  XFAIL the test added since then for now.

llvm-svn: 121733
2010-12-13 23:49:28 +00:00
Jason W Kim
b5cc5dad79 First cut of ARM/MC/ELF PIC relocations.
Test has fixme, to move to .s -> .o test when AsmParser works better.

llvm-svn: 121732
2010-12-13 23:16:07 +00:00
Bob Wilson
33e5e902b0 Remove the rest of the *_sfp Neon instruction patterns.
Use the same COPY_TO_REGCLASS approach as for the 2-register *_sfp instructions.
This change made a big difference in the code generated for the
CodeGen/Thumb2/cross-rc-coalescing-2.ll test: The coalescer is still doing
a fine job, but some instructions that were previously moved outside the loop
are not moved now.  It's using fewer VFP registers now, which is generally
a good thing, so I think the estimates for register pressure changed and that
affected the LICM behavior.  Since that isn't obviously wrong, I've just
changed the test file.  This completes the work for Radar 8711675.

llvm-svn: 121730
2010-12-13 23:02:37 +00:00
Bob Wilson
b189b77d9b Simplify N2VSPat, removing some unnecessary type arguments.
llvm-svn: 121729
2010-12-13 23:02:31 +00:00
Chris Lattner
dcba81d96f temporarily disable part of my previous patch, which causes an iterator invalidation issue, causing a crash on some versions of perlbmk.
llvm-svn: 121728
2010-12-13 23:02:19 +00:00
Dan Gohman
1baada041e Update a comment.
llvm-svn: 121727
2010-12-13 22:53:18 +00:00
Owen Anderson
af1dde2673 Revert r121721, which broke buildbots.
llvm-svn: 121726
2010-12-13 22:51:08 +00:00
Dan Gohman
b187cce266 Reapply r121520, PartialAlias implementation for BasicAA, now that
memdep is updated to handle it.

llvm-svn: 121725
2010-12-13 22:50:24 +00:00
Dan Gohman
f4e1d91b8e Update memdep to handle PartialAlias as MayAlias.
llvm-svn: 121723
2010-12-13 22:47:57 +00:00
Owen Anderson
c298c8ed4d Make Thumb2 LEA-like instruction into pseudos, which map down to ADR. Provide correct fixups for Thumb2 ADR,
which is _of course_ different from ARM ADR fixups, or any other Thumb2 fixup.

llvm-svn: 121721
2010-12-13 22:29:52 +00:00
Bob Wilson
203303291f Delete a line that I forgot to revert previously.
llvm-svn: 121719
2010-12-13 22:05:55 +00:00
Bob Wilson
074095ddf2 Use COPY_TO_REGCLASS instead of pseudo instructions for Neon FP patterns.
Jakob Olesen suggested that we can avoid the need for separate pseudo
instructions here by using COPY_TO_REGCLASS in the patterns.  The pattern
gets pretty ugly but it seems to work well.  Partial fix for Radar 8711675.

llvm-svn: 121718
2010-12-13 21:58:05 +00:00
Bob Wilson
56b41f8b81 Use pseudo instructions for 2-register Neon instructions for scalar FP.
Partial fix for Radar 8711675.

llvm-svn: 121716
2010-12-13 21:05:52 +00:00
Bob Wilson
9a6d75a499 Remove unused instruction class arguments.
llvm-svn: 121715
2010-12-13 21:05:44 +00:00
Evan Cheng
c90b20fb74 Generalize BFI isel lowering a bit.
llvm-svn: 121714
2010-12-13 20:32:54 +00:00
Chris Lattner
759d8aa712 add some DEBUG's.
llvm-svn: 121711
2010-12-13 19:55:30 +00:00
Owen Anderson
4ec912b842 In Thumb2, direct branches can be encoded as either a "short" conditional branch with a null predicate, or
as a "long" direct branch.  While the mnemonics are the same, they encode the branch offset differently, and
the Darwin assembler appears to prefer the "long" form for direct branches.  Thus, in the name of bitwise
equivalence, provide encoding and fixup support for it.

llvm-svn: 121710
2010-12-13 19:31:11 +00:00