oota-llvm.git
13 years agoAdd MachineLoopRanges analysis.
Jakob Stoklund Olesen [Wed, 15 Dec 2010 23:41:23 +0000 (23:41 +0000)]
Add MachineLoopRanges analysis.

A MachineLoopRange contains the intervals of slot indexes covered by the blocks
in a loop. This representation of the loop blocks is more efficient to compare
against interfering registers during register coalescing.

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

13 years agoIf we're changing the frame register to a physical register other than SP, we
Bill Wendling [Wed, 15 Dec 2010 23:32:27 +0000 (23:32 +0000)]
If we're changing the frame register to a physical register other than SP, we
need to use tLDRi and tSTRi instead of tLDRspi and tSTRspi respectively.

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

13 years agoWhitespace cleanups.
Bill Wendling [Wed, 15 Dec 2010 23:31:24 +0000 (23:31 +0000)]
Whitespace cleanups.

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

13 years agoTeach the Neon intrinsic generator to widen half-precision float types.
Bob Wilson [Wed, 15 Dec 2010 23:16:25 +0000 (23:16 +0000)]
Teach the Neon intrinsic generator to widen half-precision float types.
This isn't currently used for anything but I ran into it when experimenting
with some changes, and it might be useful in the future.

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

13 years agoBetter fix for opt build
Matt Beaumont-Gay [Wed, 15 Dec 2010 23:14:45 +0000 (23:14 +0000)]
Better fix for opt build

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

13 years agoFix a typo that Bill spotted.
Dan Gohman [Wed, 15 Dec 2010 23:09:41 +0000 (23:09 +0000)]
Fix a typo that Bill spotted.

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

13 years agoOnly rr forms of ADD*_DB are commutable.
Evan Cheng [Wed, 15 Dec 2010 22:57:36 +0000 (22:57 +0000)]
Only rr forms of ADD*_DB are commutable.

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

13 years agoTypo.
Rafael Espindola [Wed, 15 Dec 2010 22:33:06 +0000 (22:33 +0000)]
Typo.

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

13 years agoAdd an InstCombine transform to recognize instances of manual overflow-safe addition
Owen Anderson [Wed, 15 Dec 2010 22:32:38 +0000 (22:32 +0000)]
Add an InstCombine transform to recognize instances of manual overflow-safe addition
(performing the addition in a wider type and explicitly checking for overflow), and
fold them down to intrinsics.  This currently only supports signed-addition, but could
be generalized if someone works out the magic constant formulas for other operations.

Fixes <rdar://problem/8558713>.

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

13 years agoFix opt -Werror build
Matt Beaumont-Gay [Wed, 15 Dec 2010 22:21:20 +0000 (22:21 +0000)]
Fix opt -Werror build

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

13 years agoTeach machine cse to commute instructions.
Evan Cheng [Wed, 15 Dec 2010 22:16:21 +0000 (22:16 +0000)]
Teach machine cse to commute instructions.

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

13 years agoAdd Neon VCVT instructions for f32 <-> f16 conversions.
Bob Wilson [Wed, 15 Dec 2010 22:14:12 +0000 (22:14 +0000)]
Add Neon VCVT instructions for f32 <-> f16 conversions.
Clang is now providing intrinsics for these and so we need to support them
in the backend.  Radar 8068427.

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

13 years agoFix misspelled target triples in MC/ARM test commands.
Bob Wilson [Wed, 15 Dec 2010 22:14:01 +0000 (22:14 +0000)]
Fix misspelled target triples in MC/ARM test commands.

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

13 years agoReapply r121886, and also update DecomposeGEPExpression to keep
Dan Gohman [Wed, 15 Dec 2010 20:49:55 +0000 (20:49 +0000)]
Reapply r121886, and also update DecomposeGEPExpression to keep
it in sync.

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

13 years agoAdd SlotIndexes::getMBBRange() to get the range of a basic block in a single
Jakob Stoklund Olesen [Wed, 15 Dec 2010 20:40:22 +0000 (20:40 +0000)]
Add SlotIndexes::getMBBRange() to get the range of a basic block in a single
lookup.

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

13 years agoRevert r121886. DecomposeGEPExpression needs to be kept
Dan Gohman [Wed, 15 Dec 2010 20:39:25 +0000 (20:39 +0000)]
Revert r121886. DecomposeGEPExpression needs to be kept
in sync.

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

13 years agoLower the MBlaze target specific calling conventions for "interrupt_handler"
Wesley Peck [Wed, 15 Dec 2010 20:27:28 +0000 (20:27 +0000)]
Lower the MBlaze target specific calling conventions for "interrupt_handler"
and "save_volatiles" correctly. This completes the custom calling convention
functionality changes for the MBlaze backend that were started in 121888.

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

13 years agoAdding target specific calling conventions to support the MBlaze GCC function
Wesley Peck [Wed, 15 Dec 2010 20:14:09 +0000 (20:14 +0000)]
Adding target specific calling conventions to support the MBlaze GCC function
attributes "interrupt_handle" and "save_volatiles". Support for lowering these
correctly will be in an upcoming commit.

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

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