oota-llvm.git
13 years agoStrengthen GetUnderlyingObject using InstructionSimplify.
Dan Gohman [Wed, 15 Dec 2010 20:10:26 +0000 (20:10 +0000)]
Strengthen GetUnderlyingObject using InstructionSimplify.

While LLVM's main design is that analysis code shouldn't
go out of its way to understand code which hasn't been
InstCombined, analysis utility routines like this can
find themselves being called in the middle of transform
passes when instcombine hasn't had a chance to run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121886 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove Value::getUnderlyingObject to be a standalone
Dan Gohman [Wed, 15 Dec 2010 20:02:24 +0000 (20:02 +0000)]
Move Value::getUnderlyingObject to be a standalone
function so that it can live in Analysis instead of
VMCore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121885 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd some special purpose register definitions to the MBlaze backend and cleanup some...
Wesley Peck [Wed, 15 Dec 2010 19:35:36 +0000 (19:35 +0000)]
Add some special purpose register definitions to the MBlaze backend and cleanup some old, unused floating point register definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121882 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typo in r121875.
Owen Anderson [Wed, 15 Dec 2010 19:24:24 +0000 (19:24 +0000)]
Fix typo in r121875.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121880 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTweak a few pseudo-inst pattern base classes.
Jim Grosbach [Wed, 15 Dec 2010 19:03:16 +0000 (19:03 +0000)]
Tweak a few pseudo-inst pattern base classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121878 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up some of LVI:
Nick Lewycky [Wed, 15 Dec 2010 18:57:18 +0000 (18:57 +0000)]
Clean up some of LVI:
 * mergeIn now uses constant folding for constants that are provably not-equal.
 * sink some sanity checks from the get*() methods into the mark*() methods, to ensure that we never have a constant/notconstant ConstantInt
 * some textual cleanups, whitespace changes, removing "else" after return, that sort of thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121877 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe new t2LEApcrel* pseudo instructions need the size specified.
Jim Grosbach [Wed, 15 Dec 2010 18:48:45 +0000 (18:48 +0000)]
The new t2LEApcrel* pseudo instructions need the size specified.
rdar://8768390

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121876 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement cleanups suggested by Daniel.
Owen Anderson [Wed, 15 Dec 2010 18:48:27 +0000 (18:48 +0000)]
Implement cleanups suggested by Daniel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121875 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDocument some more AliasAnalysis infrastructure limitations.
Dan Gohman [Wed, 15 Dec 2010 18:45:20 +0000 (18:45 +0000)]
Document some more AliasAnalysis infrastructure limitations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121874 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix build.
Jakob Stoklund Olesen [Wed, 15 Dec 2010 18:07:48 +0000 (18:07 +0000)]
Fix build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121872 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDetect and enumerate bypass loops.
Jakob Stoklund Olesen [Wed, 15 Dec 2010 17:49:52 +0000 (17:49 +0000)]
Detect and enumerate bypass loops.

Bypass loops have the current live range live through, but contain no uses or
defs. Splitting around a bypass loop can free registers for other uses inside
the loop by spilling the split range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121871 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSeparate SplitAnalysis::getSplitLoops().
Jakob Stoklund Olesen [Wed, 15 Dec 2010 17:41:19 +0000 (17:41 +0000)]
Separate SplitAnalysis::getSplitLoops().

This method returns the set of loops with uses that are candidates for
splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121870 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a Neon intrinsic test generator.
Bob Wilson [Wed, 15 Dec 2010 16:58:45 +0000 (16:58 +0000)]
Add a Neon intrinsic test generator.
This is still a WIP.  It's already good enough to expose a few bugs, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121868 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix Neon intrinsic immediate range checking for some double-register operands.
Bob Wilson [Wed, 15 Dec 2010 16:58:42 +0000 (16:58 +0000)]
Fix Neon intrinsic immediate range checking for some double-register operands.
Some quad-register intrinsics with lane operands only take a double-register
operand for the vector containing the lane.  The valid range of lane numbers
is then half as big as you would expect from the quad-register type.
Note: This currently has no effect because those intrinsics are now handled
entirely in the header file using __builtin_shufflevector, which does its own
range checking, but I want to use this for generating tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121867 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove Sub simplifications and additional Add simplifications out of
Duncan Sands [Wed, 15 Dec 2010 14:07:39 +0000 (14:07 +0000)]
Move Sub simplifications and additional Add simplifications out of
instcombine and into InstructionSimplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121861 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIf we detect that the instruction we are simplifying is unreachable, arrange for
Duncan Sands [Wed, 15 Dec 2010 11:02:22 +0000 (11:02 +0000)]
If we detect that the instruction we are simplifying is unreachable, arrange for
it to be replaced by undef rather than not replaced at all, the idea being that
this may reduce the amount of work done by whoever called InstructionSimplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121860 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach jump threading to "look through" a select when the branch direction of a termin...
Frits van Bommel [Wed, 15 Dec 2010 09:51:20 +0000 (09:51 +0000)]
Teach jump threading to "look through" a select when the branch direction of a terminator depends on it.
When it sees a promising select it now tries to figure out whether the condition of the select is known in any of the predecessors and if so it maps the operands appropriately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121859 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd fixups for Thumb LDR/STR instructions.
Bill Wendling [Wed, 15 Dec 2010 08:51:02 +0000 (08:51 +0000)]
Add fixups for Thumb LDR/STR instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121858 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRelax alignment fragments.
Rafael Espindola [Wed, 15 Dec 2010 08:45:53 +0000 (08:45 +0000)]
Relax alignment fragments.

With this we don't need the EffectiveSize field anymore. Without that field
LayoutFragment only updates offsets and we don't need to invalidate the
current fragment when it is relaxed (only the ones following it).

This is also a very small improvement in the accuracy of the layout info as
we now use the after relaxation size immediately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121857 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPatch by David Meyer to avoid a O(N^2) behaviour when relaxing fragments.
Rafael Espindola [Wed, 15 Dec 2010 07:39:29 +0000 (07:39 +0000)]
Patch by David Meyer to avoid a O(N^2) behaviour when relaxing fragments.

Since we now don't update addresses so early, we might relax a bit more than
we need to. This is simillar to the issue in PR8467.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121856 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd another overflow idiom
Chris Lattner [Wed, 15 Dec 2010 07:28:58 +0000 (07:28 +0000)]
add another overflow idiom

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121854 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd a note about overflow idiom recognition.
Chris Lattner [Wed, 15 Dec 2010 07:25:55 +0000 (07:25 +0000)]
add a note about overflow idiom recognition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121853 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGeneralize an assert.
Rafael Espindola [Wed, 15 Dec 2010 07:12:24 +0000 (07:12 +0000)]
Generalize an assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121851 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd a shift/imul missed optimization
Chris Lattner [Wed, 15 Dec 2010 07:10:43 +0000 (07:10 +0000)]
add a shift/imul missed optimization

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121850 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd a note about a SPEC hack that gcc mainline does.
Chris Lattner [Wed, 15 Dec 2010 06:38:24 +0000 (06:38 +0000)]
add a note about a SPEC hack that gcc mainline does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121849 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotake care of some todos, transforming [us]mul_lohi into
Chris Lattner [Wed, 15 Dec 2010 06:04:19 +0000 (06:04 +0000)]
take care of some todos, transforming [us]mul_lohi into
a wider mul if the wider mul is legal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121848 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agomerge two tests
Chris Lattner [Wed, 15 Dec 2010 05:58:59 +0000 (05:58 +0000)]
merge two tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121847 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agowhen transforming a MULHS into a wider MUL, there is no need to SRA the
Chris Lattner [Wed, 15 Dec 2010 05:51:39 +0000 (05:51 +0000)]
when transforming a MULHS into a wider MUL, there is no need to SRA the
result, the top bits are truncated off anyway, just use SRL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121846 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agomake qsort predicate more conformant by returning 0 for equal values.
Chris Lattner [Wed, 15 Dec 2010 04:52:41 +0000 (04:52 +0000)]
make qsort predicate more conformant by returning 0 for equal values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121838 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agovarious cleanups to tblgen, patch by Garrison Venn!
Chris Lattner [Wed, 15 Dec 2010 04:48:22 +0000 (04:48 +0000)]
various cleanups to tblgen, patch by Garrison Venn!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121837 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd mention that we support FreeBSD/amd64.
Bill Wendling [Wed, 15 Dec 2010 01:35:55 +0000 (01:35 +0000)]
Add mention that we support FreeBSD/amd64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121832 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd some more MC tests for ARM arithmetic instructions that update or don't
Kevin Enderby [Wed, 15 Dec 2010 01:24:36 +0000 (01:24 +0000)]
Add some more MC tests for ARM arithmetic instructions that update or don't
update the condition codes.  These come from my test generator and are just
the ones that MC currently assembles correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121830 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCopy-pastos.
Mikhail Glushenkov [Wed, 15 Dec 2010 01:22:34 +0000 (01:22 +0000)]
Copy-pastos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121829 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove ConvertToMAttrImpl, it became too '-march'-specific.
Mikhail Glushenkov [Wed, 15 Dec 2010 01:22:29 +0000 (01:22 +0000)]
Remove ConvertToMAttrImpl, it became too '-march'-specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121828 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agollvmc: Support -march arguments that should be forwarded to llc as -mcpu.
Mikhail Glushenkov [Wed, 15 Dec 2010 01:22:25 +0000 (01:22 +0000)]
llvmc: Support -march arguments that should be forwarded to llc as -mcpu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121827 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agollvmc: Better -mfpu/-mcpu support for ARM & PPC.
Mikhail Glushenkov [Wed, 15 Dec 2010 01:22:20 +0000 (01:22 +0000)]
llvmc: Better -mfpu/-mcpu support for ARM & PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121826 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agollvmc: more complete -march table for ARM.
Mikhail Glushenkov [Wed, 15 Dec 2010 01:22:15 +0000 (01:22 +0000)]
llvmc: more complete -march table for ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121825 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agollvmc: Support -mabi/-mfloat-abi.
Mikhail Glushenkov [Wed, 15 Dec 2010 01:22:10 +0000 (01:22 +0000)]
llvmc: Support -mabi/-mfloat-abi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121824 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agollvmc: Forward -march/-mcpu/-mtune to as & ld.
Mikhail Glushenkov [Wed, 15 Dec 2010 01:22:05 +0000 (01:22 +0000)]
llvmc: Forward -march/-mcpu/-mtune to as & ld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121823 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agollvmc: make switch options ZeroOrMore by default.
Mikhail Glushenkov [Wed, 15 Dec 2010 01:21:59 +0000 (01:21 +0000)]
llvmc: make switch options ZeroOrMore by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121822 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReapply r121808 now that the missing patterns have been supplied.
Bill Wendling [Wed, 15 Dec 2010 01:03:19 +0000 (01:03 +0000)]
Reapply r121808 now that the missing patterns have been supplied.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121820 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd some missing patterns now that tLDRB and tLDRH are split into reg and
Bill Wendling [Wed, 15 Dec 2010 00:58:57 +0000 (00:58 +0000)]
Add some missing patterns now that tLDRB and tLDRH are split into reg and
immediate versions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121819 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix PR8790, another instance where unreachable code can cause instruction simplificat...
Owen Anderson [Wed, 15 Dec 2010 00:55:35 +0000 (00:55 +0000)]
Fix PR8790, another instance where unreachable code can cause instruction simplification to fail,
this case involve a select that simplifies to itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121817 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCleanup trailing whitespace.
Owen Anderson [Wed, 15 Dec 2010 00:52:44 +0000 (00:52 +0000)]
Cleanup trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121816 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r121808 until I can fix the build.
Bill Wendling [Wed, 15 Dec 2010 00:04:00 +0000 (00:04 +0000)]
Revert r121808 until I can fix the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121815 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agothumb adr fixup needs alignment just like the t2 version.
Jim Grosbach [Tue, 14 Dec 2010 23:47:35 +0000 (23:47 +0000)]
thumb adr fixup needs alignment just like the t2 version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121812 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoComments and cleaning.
Bill Wendling [Tue, 14 Dec 2010 23:42:48 +0000 (23:42 +0000)]
Comments and cleaning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121809 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake the ISel selections for LDR/STR the same as before the LDRr/LDRi split. In
Bill Wendling [Tue, 14 Dec 2010 23:40:49 +0000 (23:40 +0000)]
Make the ISel selections for LDR/STR the same as before the LDRr/LDRi split. In
particular, we want

   ldr r2, [r3]

to be equivalent to

   ldr r2, [r3, #0]

and not

   ldr r2, [r3, r0]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121808 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify RegAllocGreedy's use of register aliases.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 23:38:19 +0000 (23:38 +0000)]
Simplify RegAllocGreedy's use of register aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121807 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify CCState's use of register aliases.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 23:28:01 +0000 (23:28 +0000)]
Simplify CCState's use of register aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121806 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify AggressiveAntiDepBreaker's use of register aliases.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 23:23:15 +0000 (23:23 +0000)]
Simplify AggressiveAntiDepBreaker's use of register aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121805 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplyfy RegAllocBasic by using getOverlaps instead of getAliasSet.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 23:10:48 +0000 (23:10 +0000)]
Simplyfy RegAllocBasic by using getOverlaps instead of getAliasSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121801 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce TargetRegisterInfo::getOverlaps(Reg), returning a list of all
Jakob Stoklund Olesen [Tue, 14 Dec 2010 23:03:42 +0000 (23:03 +0000)]
Introduce TargetRegisterInfo::getOverlaps(Reg), returning a list of all
registers that alias Reg, including itself. This is almost the same as the
existing getAliasSet() method, except for the inclusion of Reg.

The name matches the reflexive TRI::regsOverlap(x, y) relation.

It is very common to do stuff to a register and all its aliases:

  stuff(Reg)
  for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias)
    stuff(*Alias);

That can now be written as the simpler:

  for (const unsigned *Alias = TRI->getOverlaps(Reg); *Alias; ++Alias)
    stuff(*Alias);

This change requires a bit more constant space for the alias lists because Reg
is included and because the empty alias list cannot be shared any longer.

If the getAliasSet method is eventually removed, this space can be reclaimed by
sharing overlap lists. For instance, %rax and %eax have identical overlap sets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121800 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for MC-ized encoding of tLEApcrel and tLEApcrelJT. rdar://8755755
Jim Grosbach [Tue, 14 Dec 2010 22:28:03 +0000 (22:28 +0000)]
Add support for MC-ized encoding of tLEApcrel and tLEApcrelJT. rdar://8755755

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121798 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix comment.
Bill Wendling [Tue, 14 Dec 2010 22:26:49 +0000 (22:26 +0000)]
Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121797 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMulticlassify the LDR/STR encoding patterns. The only functionality difference
Bill Wendling [Tue, 14 Dec 2010 22:10:49 +0000 (22:10 +0000)]
Multiclassify the LDR/STR encoding patterns. The only functionality difference
is the addition of the FoldableAsLoad & Rematerializable flags to some of the
load instructions. ARM has these flags set for them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121794 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a minor bug in two-address pass. It was missing a commute opportunity.
Evan Cheng [Tue, 14 Dec 2010 21:34:53 +0000 (21:34 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121793 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotrailing whitespace
Jim Grosbach [Tue, 14 Dec 2010 21:28:29 +0000 (21:28 +0000)]
trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121792 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove debugging code entirely within DEBUG(). Silences an unused variable
Matt Beaumont-Gay [Tue, 14 Dec 2010 21:14:55 +0000 (21:14 +0000)]
Move debugging code entirely within DEBUG(). Silences an unused variable
warning in the opt build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121791 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRefactor a bit for legibility.
Jim Grosbach [Tue, 14 Dec 2010 21:10:47 +0000 (21:10 +0000)]
Refactor a bit for legibility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121790 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotrailing whitespace.
Jim Grosbach [Tue, 14 Dec 2010 20:46:39 +0000 (20:46 +0000)]
trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121789 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure to propagate the predicate operands for LEApcrel to ADR.
Jim Grosbach [Tue, 14 Dec 2010 20:45:47 +0000 (20:45 +0000)]
Make sure to propagate the predicate operands for LEApcrel to ADR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121788 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a small bug (typo?) in the fixup for Thumb1 CBZ/CBNZ instructions.
Owen Anderson [Tue, 14 Dec 2010 19:42:53 +0000 (19:42 +0000)]
Fix a small bug (typo?) in the fixup for Thumb1 CBZ/CBNZ instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121784 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd LiveIntervalUnion print methods, RegAllocGreedy::trySplit debug spew.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 19:38:49 +0000 (19:38 +0000)]
Add LiveIntervalUnion print methods, RegAllocGreedy::trySplit debug spew.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121783 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse TRI::printReg instead of AbstractRegisterDescription when printing
Jakob Stoklund Olesen [Tue, 14 Dec 2010 18:53:47 +0000 (18:53 +0000)]
Use TRI::printReg instead of AbstractRegisterDescription when printing
LiveIntervalUnions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121781 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd TargetRegisterInfo::printReg() to pretty-print registers.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 18:53:39 +0000 (18:53 +0000)]
Add TargetRegisterInfo::printReg() to pretty-print registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121780 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoARM Fixups relative to thumb functions need to have the low bit of the value
Jim Grosbach [Tue, 14 Dec 2010 18:46:57 +0000 (18:46 +0000)]
ARM Fixups relative to thumb functions need to have the low bit of the value
set for interworking to work properly. rdar://8755956

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121778 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoQ.seenAllInterferences() must be called after Q.collectInterferingVRegs().
Jakob Stoklund Olesen [Tue, 14 Dec 2010 17:47:36 +0000 (17:47 +0000)]
Q.seenAllInterferences() must be called after Q.collectInterferingVRegs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121774 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMC/ARM: Fix-up fixup offset for fixup_arm_branch target specific fixup.
Daniel Dunbar [Tue, 14 Dec 2010 17:37:16 +0000 (17:37 +0000)]
MC/ARM: Fix-up fixup offset for fixup_arm_branch target specific fixup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121772 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTrailing whitespace
Jim Grosbach [Tue, 14 Dec 2010 16:25:15 +0000 (16:25 +0000)]
Trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121769 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse the integer scheduling intrinsic for integer loads and stores.
Bill Wendling [Tue, 14 Dec 2010 12:33:05 +0000 (12:33 +0000)]
Use the integer scheduling intrinsic for integer loads and stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121765 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago - Insert new instructions before DomBlock's terminator,
Chris Lattner [Tue, 14 Dec 2010 08:46:09 +0000 (08:46 +0000)]
 - 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121764 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix two significant issues with FoldTwoEntryPHINode:
Chris Lattner [Tue, 14 Dec 2010 08:01:53 +0000 (08:01 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121762 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoremove the instsimplify logic I added in r121754. It is apparently
Chris Lattner [Tue, 14 Dec 2010 07:53:03 +0000 (07:53 +0000)]
remove the instsimplify logic I added in r121754.  It is apparently
breaking the selfhost builds, though I can't fathom how.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121761 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoclean up logic, convert std::set to SmallPtrSet, handle the case
Chris Lattner [Tue, 14 Dec 2010 07:41:39 +0000 (07:41 +0000)]
clean up logic, convert std::set to SmallPtrSet, handle the case
when all 2-entry phis are simplified away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121760 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotidy up a bit, move DEBUG down to when we commit to doing the transform so we
Chris Lattner [Tue, 14 Dec 2010 07:23:10 +0000 (07:23 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121758 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agouse SimplifyInstruction instead of reimplementing part of it.
Chris Lattner [Tue, 14 Dec 2010 07:20:29 +0000 (07:20 +0000)]
use SimplifyInstruction instead of reimplementing part of it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121757 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agosimplify GetIfCondition by using getSinglePredecessor.
Chris Lattner [Tue, 14 Dec 2010 07:15:21 +0000 (07:15 +0000)]
simplify GetIfCondition by using getSinglePredecessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121756 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agouse AddPredecessorToBlock in 3 places instead of a manual loop.
Chris Lattner [Tue, 14 Dec 2010 07:09:42 +0000 (07:09 +0000)]
use AddPredecessorToBlock in 3 places instead of a manual loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121755 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agomake FoldTwoEntryPHINode use instsimplify a bit, make
Chris Lattner [Tue, 14 Dec 2010 07:00:00 +0000 (07:00 +0000)]
make FoldTwoEntryPHINode use instsimplify a bit, make
GetIfCondition faster by avoiding pred_iterator.  No
really interesting change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121754 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoremove the dead (and terrible) llvm::RemoveSuccessor function.
Chris Lattner [Tue, 14 Dec 2010 06:51:55 +0000 (06:51 +0000)]
remove the dead (and terrible) llvm::RemoveSuccessor function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121753 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoimprove DEBUG's a bit, switch to eraseFromParent() to simplify
Chris Lattner [Tue, 14 Dec 2010 06:17:25 +0000 (06:17 +0000)]
improve DEBUG's a bit, switch to eraseFromParent() to simplify
code a bit, switch from constant folding to instsimplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121751 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix yet anohter broken line
Chris Lattner [Tue, 14 Dec 2010 06:09:07 +0000 (06:09 +0000)]
fix yet anohter broken line

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121750 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoreapply my recent change that disables a piece of the switch formation
Chris Lattner [Tue, 14 Dec 2010 05:57:30 +0000 (05:57 +0000)]
reapply my recent change that disables a piece of the switch formation
work, but fixes 400.perlbmk.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121749 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe tLDR et al instructions were emitting either a reg/reg or reg/imm
Bill Wendling [Tue, 14 Dec 2010 03:36:38 +0000 (03:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121747 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agobfi A, (and B, C1), C2) -> bfi A, B, C2 iff C1 & C2 == C1. rdar://8458663
Evan Cheng [Tue, 14 Dec 2010 03:22:07 +0000 (03:22 +0000)]
bfi A, (and B, C1), C2) -> bfi A, B, C2 iff C1 & C2 == C1. rdar://8458663

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121746 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix fixme case typo :-)
Jason W Kim [Tue, 14 Dec 2010 01:42:38 +0000 (01:42 +0000)]
fix fixme case typo :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121743 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove unused vector.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 00:58:47 +0000 (00:58 +0000)]
Remove unused vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121741 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd IntervalMap to the Programmer's Manual.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 00:55:51 +0000 (00:55 +0000)]
Add IntervalMap to the Programmer's Manual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121740 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove debugging code.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 00:37:52 +0000 (00:37 +0000)]
Remove debugging code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121738 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry reassigning all virtual register interferences, not just those with lower
Jakob Stoklund Olesen [Tue, 14 Dec 2010 00:37:49 +0000 (00:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121737 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd stub for RAGreedy::trySplit.
Jakob Stoklund Olesen [Tue, 14 Dec 2010 00:37:44 +0000 (00:37 +0000)]
Add stub for RAGreedy::trySplit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121736 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSecond attempt at make Thumb2 LEAs pseudos. This time, perform the lowering much...
Owen Anderson [Tue, 14 Dec 2010 00:36:49 +0000 (00:36 +0000)]
Second attempt at make Thumb2 LEAs pseudos.  This time, perform the lowering much later, which makes the entire
process cleaner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121735 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix recent buildbot breakage by pulling SimplifyCFG back to its state as of r121694...
Owen Anderson [Mon, 13 Dec 2010 23:49:28 +0000 (23:49 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121733 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFirst cut of ARM/MC/ELF PIC relocations.
Jason W Kim [Mon, 13 Dec 2010 23:16:07 +0000 (23:16 +0000)]
First cut of ARM/MC/ELF PIC relocations.
Test has fixme, to move to .s -> .o test when AsmParser works better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121732 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the rest of the *_sfp Neon instruction patterns.
Bob Wilson [Mon, 13 Dec 2010 23:02:37 +0000 (23:02 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121730 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify N2VSPat, removing some unnecessary type arguments.
Bob Wilson [Mon, 13 Dec 2010 23:02:31 +0000 (23:02 +0000)]
Simplify N2VSPat, removing some unnecessary type arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121729 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotemporarily disable part of my previous patch, which causes an iterator invalidation...
Chris Lattner [Mon, 13 Dec 2010 23:02:19 +0000 (23:02 +0000)]
temporarily disable part of my previous patch, which causes an iterator invalidation issue, causing a crash on some versions of perlbmk.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121728 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate a comment.
Dan Gohman [Mon, 13 Dec 2010 22:53:18 +0000 (22:53 +0000)]
Update a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121727 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r121721, which broke buildbots.
Owen Anderson [Mon, 13 Dec 2010 22:51:08 +0000 (22:51 +0000)]
Revert r121721, which broke buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121726 91177308-0d34-0410-b5e6-96231b3b80d8