oota-llvm.git
12 years agoadd binding to read icmp predicate
Torok Edwin [Thu, 6 Oct 2011 12:13:20 +0000 (12:13 +0000)]
add binding to read icmp predicate

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

12 years agoocaml/C bindings: getmdstring, add num_op, get_op should work on metadata too
Torok Edwin [Thu, 6 Oct 2011 12:13:11 +0000 (12:13 +0000)]
ocaml/C bindings: getmdstring, add num_op, get_op should work on metadata too

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

12 years agoC/OCaml API to retrieve struct name.
Torok Edwin [Thu, 6 Oct 2011 12:12:50 +0000 (12:12 +0000)]
C/OCaml API to retrieve struct name.

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

12 years agoocaml bindings: add llvm_ipo based on IPO.h
Torok Edwin [Thu, 6 Oct 2011 12:12:27 +0000 (12:12 +0000)]
ocaml bindings: add llvm_ipo based on IPO.h

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

12 years agoadd more tests for the OCaml bindings
Torok Edwin [Thu, 6 Oct 2011 12:12:12 +0000 (12:12 +0000)]
add more tests for the OCaml bindings

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

12 years agoFix assembling of xchg %eax, %eax to not use the NOP encoding of 0x90. This was done...
Craig Topper [Thu, 6 Oct 2011 06:44:41 +0000 (06:44 +0000)]
Fix assembling of xchg %eax, %eax to not use the NOP encoding of 0x90. This was done by creating a new register group that excludes AX registers. Fixes PR10345. Also added aliases for flipping the order of the operands of xchg <reg>, %eax.

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

12 years agoCosmetic change.
Evan Cheng [Thu, 6 Oct 2011 02:47:18 +0000 (02:47 +0000)]
Cosmetic change.

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

12 years agoBuild system infrastructure for multiple tblgens.
Peter Collingbourne [Thu, 6 Oct 2011 01:51:51 +0000 (01:51 +0000)]
Build system infrastructure for multiple tblgens.

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

12 years agoAdd the MBBs before inserting the instructions. Doing it afterwards could lead
Bill Wendling [Thu, 6 Oct 2011 00:53:33 +0000 (00:53 +0000)]
Add the MBBs before inserting the instructions. Doing it afterwards could lead
to an infinite loop because of the def-use chains.

Also use a frame load instead of store for the LD instruction.

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

12 years agoRemove the TRI::getSubRegisterRegClass() hook.
Jakob Stoklund Olesen [Thu, 6 Oct 2011 00:08:27 +0000 (00:08 +0000)]
Remove the TRI::getSubRegisterRegClass() hook.

This restores my karma after I added TRI::getSubClassWithSubReg().

Register constraints are applied 'backwards'.  Starting from the
register class required by an instruction operand, the correct question
is: 'How can I constrain the super-register register class so all its
sub-registers satisfy the instruction constraint?' The
getMatchingSuperRegClass() hook answers that.

We never need to go 'forwards': Starting from a super-register register
class, what register class are the sub-registers in?  The
getSubRegisterRegClass() hook did that.

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

12 years agoAlways merge profitable shifts on A9, not just when they have a single use.
Cameron Zwarich [Wed, 5 Oct 2011 23:39:02 +0000 (23:39 +0000)]
Always merge profitable shifts on A9, not just when they have a single use.

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

12 years agoRemove a check from ARM shifted operand isel helper methods, which were blocking
Cameron Zwarich [Wed, 5 Oct 2011 23:38:50 +0000 (23:38 +0000)]
Remove a check from ARM shifted operand isel helper methods, which were blocking
merging an lsl #2 that has multiple uses on A9. This shift is free, so there is
no problem merging it in multiple places. Other unprofitable shifts will not be
merged.

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

12 years agoGet the proper call site numbers for the landing pads. Also remove a magic
Bill Wendling [Wed, 5 Oct 2011 23:28:57 +0000 (23:28 +0000)]
Get the proper call site numbers for the landing pads. Also remove a magic
number (18) for the proper addressing mode.

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

12 years agoAdd accessor method to check if the landing pad symbol has call site information.
Bill Wendling [Wed, 5 Oct 2011 23:26:10 +0000 (23:26 +0000)]
Add accessor method to check if the landing pad symbol has call site information.

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

12 years agoFix a typo.
David Greene [Wed, 5 Oct 2011 23:16:44 +0000 (23:16 +0000)]
Fix a typo.

Fix the argument passed in the multidef example.

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

12 years agoPrefix Template Arg Names with Multiclass Name
David Greene [Wed, 5 Oct 2011 22:42:54 +0000 (22:42 +0000)]
Prefix Template Arg Names with Multiclass Name

For consistency, prefix multiclass template arg names with the
multiclass name followed by "::" to avoid name clashes among
multiclass arguments and other entities in the multiclass.

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

12 years agoVim Support for Multidefs
David Greene [Wed, 5 Oct 2011 22:42:52 +0000 (22:42 +0000)]
Vim Support for Multidefs

Add vim highlighting support for multidefs.

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

12 years agoEmacs Support for Multidefs
David Greene [Wed, 5 Oct 2011 22:42:51 +0000 (22:42 +0000)]
Emacs Support for Multidefs

Add Emacs font-lock keyword support for multidefs.

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

12 years agoDocument Multidefs
David Greene [Wed, 5 Oct 2011 22:42:49 +0000 (22:42 +0000)]
Document Multidefs

Provide documentation for multidefs, explaining in detail how they
work.

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

12 years agoUpdate Test for Multidefs
David Greene [Wed, 5 Oct 2011 22:42:48 +0000 (22:42 +0000)]
Update Test for Multidefs

Update the MultiPat.td test to create some defs via multidefs.

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

12 years agoAdd a Multidef Test
David Greene [Wed, 5 Oct 2011 22:42:47 +0000 (22:42 +0000)]
Add a Multidef Test

Add a simple test for multidefs.

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

12 years agoProcess Multidefs
David Greene [Wed, 5 Oct 2011 22:42:45 +0000 (22:42 +0000)]
Process Multidefs

Process each multidef declared in a multiclass.  Iterate through the
list and instantiate a def in the multiclass for each item, resolving
the list item to the temporary iterator (possibly) used in the
multidef ObjectBody.  We then process each generated def in the normal
way.

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

12 years agoParser Multidef Support
David Greene [Wed, 5 Oct 2011 22:42:44 +0000 (22:42 +0000)]
Parser Multidef Support

Add parser support to recognize multidefs.  No processing on the
multidef is done at this point.  The grammar is:

MultiDef = MULTIDEF ObjectName < Value, Declaration, Value > ObjectBody

The first Value must be resolveable to a list and the second Value
must be resolveable to an integer.  The Declaration is a temporary
value used as an iterator to refer to list items during processing.
It may be passed into the ObjectBody where it will be substituted with
the list value used to instantiate each def.

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

12 years agoLexer Support for Multidefs
David Greene [Wed, 5 Oct 2011 22:42:35 +0000 (22:42 +0000)]
Lexer Support for Multidefs

Add keyword support for multidefs.

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

12 years agoAdd Multidef Data Structures
David Greene [Wed, 5 Oct 2011 22:42:17 +0000 (22:42 +0000)]
Add Multidef Data Structures

Add a set of data structures and members analogous to those used for
multiclass defs.  These will represent a new kind of multiclass def: a
multidef.  The idea behind the multidef is to process a list of items
and create a def record for each one inside the enclosing multiclass.
This allows the user to dynamically create a set of defs based on the
contents of a list.

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

12 years agoRefactor Multiclass Def Processing
David Greene [Wed, 5 Oct 2011 22:42:07 +0000 (22:42 +0000)]
Refactor Multiclass Def Processing

Move the code to instantiate a multiclass def, bind its arguments and
resolve its members into three helper functions.  These will be reused
to support a new kind of multiclass def: a multidef.

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

12 years agoPR11061: Make simplifylibcalls fold strcmp("", x) correctly.
Eli Friedman [Wed, 5 Oct 2011 22:27:16 +0000 (22:27 +0000)]
PR11061: Make simplifylibcalls fold strcmp("", x) correctly.

While I'm here, fix the related issue with strncmp, add some actual tests for strcmp and strncmp, and start using StringRef::compare for constant folding instead of using strcmp/strncmp so that the optimized IR isn't dependent on the host's implementation of strcmp.

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

12 years agoModify the mapping from landing pad to call sites to accept more than one call
Bill Wendling [Wed, 5 Oct 2011 22:24:35 +0000 (22:24 +0000)]
Modify the mapping from landing pad to call sites to accept more than one call
site.

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

12 years agoAdd an ivar that maps a landing pad's EH symbol to the call sites that may jump
Bill Wendling [Wed, 5 Oct 2011 22:20:38 +0000 (22:20 +0000)]
Add an ivar that maps a landing pad's EH symbol to the call sites that may jump
to the landing pad. This will be used by the back-end to generate the jump
tables for dispatching the arriving longjmp in sjlj eh.

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

12 years agoSmall refactoring. Cache the FunctionInfo->MBB into a local variable.
Bill Wendling [Wed, 5 Oct 2011 22:16:11 +0000 (22:16 +0000)]
Small refactoring. Cache the FunctionInfo->MBB into a local variable.

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

12 years agoFix sub-register operand verification.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 22:12:57 +0000 (22:12 +0000)]
Fix sub-register operand verification.

PhysReg operands are not allowed to have sub-register indices at all.

For virtual registers with sub-reg indices, check that all registers in
the register class support the sub-reg index.

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

12 years agoFixes PR11070 - assert in SCEV getConstantEvolvingPHIOperands.
Andrew Trick [Wed, 5 Oct 2011 22:06:53 +0000 (22:06 +0000)]
Fixes PR11070 - assert in SCEV getConstantEvolvingPHIOperands.

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

12 years agoFix comment to reflect the new EH stuff.
Bill Wendling [Wed, 5 Oct 2011 22:04:08 +0000 (22:04 +0000)]
Fix comment to reflect the new EH stuff.

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

12 years agoRemove unused DstSubIdx argument.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 21:22:53 +0000 (21:22 +0000)]
Remove unused DstSubIdx argument.

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

12 years agoRe-commit 141203, but much more conservative.
Jim Grosbach [Wed, 5 Oct 2011 20:53:43 +0000 (20:53 +0000)]
Re-commit 141203, but much more conservative.

Just pull the instruction name, but don't change the order of anything
else. That keeps --debug happy and non-crashing, but doesn't change
how the worklist gets built.

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

12 years agoRevert 141203. InstCombine is looping on unit tests.
Jim Grosbach [Wed, 5 Oct 2011 20:44:29 +0000 (20:44 +0000)]
Revert 141203. InstCombine is looping on unit tests.

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

12 years agoSimplify EXTRACT_SUBREG emission.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 20:26:40 +0000 (20:26 +0000)]
Simplify EXTRACT_SUBREG emission.

EXTRACT_SUBREG is emitted as %dst = COPY %src:sub, so there is no need to
constrain the %dst register class.  RegisterCoalescer will apply the
necessary constraints if it decides to eliminate the COPY.

The %src register class does need to be constrained to something with
the right sub-registers, though.  This is currently done manually with
COPY_TO_REGCLASS nodes.  They can possibly be removed after this patch.

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

12 years agoOverride TRI::getSubClassWithSubReg for X86.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 20:26:33 +0000 (20:26 +0000)]
Override TRI::getSubClassWithSubReg for X86.

There are fewer registers with sub_8bit sub-registers in 32-bit mode
than in 64-bit mode.  In 32-bit mode, sub_8bit behaves the same as
sub_8bit_hi.

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

12 years agoCheck for the returns_twice attribute in callsFunctionThatReturnsTwice. This
Rafael Espindola [Wed, 5 Oct 2011 20:05:13 +0000 (20:05 +0000)]
Check for the returns_twice attribute in callsFunctionThatReturnsTwice. This
fixes PR11038, but there are still some cleanups to be done.

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

12 years agoUpdate InstCombine worklist after instruction transform is complete.
Jim Grosbach [Wed, 5 Oct 2011 20:05:00 +0000 (20:05 +0000)]
Update InstCombine worklist after instruction transform is complete.

When updating the worklist for InstCombine, the Add/AddUsersToWorklist
functions may access the instruction(s) being added, for debug output for
example. If the instructions aren't yet added to the basic block, this
can result in a crash. Finish the instruction transformation before
adjusting the worklist instead.

rdar://10238555

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

12 years agoPTX: Fixup a case where getRegClassFor() should be used instead of custom code.
Justin Holewinski [Wed, 5 Oct 2011 18:32:25 +0000 (18:32 +0000)]
PTX: Fixup a case where getRegClassFor() should be used instead of custom code.

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

12 years agoSimplify INSERT_SUBREG emission.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 18:31:00 +0000 (18:31 +0000)]
Simplify INSERT_SUBREG emission.

The register class created by INSERT_SUBREG and SUBREG_TO_REG must be
legal and support the SubIdx sub-registers.

The new getSubClassWithSubReg() hook can compute that.

This may create INSERT_SUBREG instructions defining a larger register
class than the sub-register being inserted.  That is OK,
RegisterCoalescer will constrain the register class as needed when it
eliminates the INSERT_SUBREG instructions.

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

12 years agoFix assertion string.
Akira Hatanaka [Wed, 5 Oct 2011 18:17:49 +0000 (18:17 +0000)]
Fix assertion string.

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

12 years agoMake sure candidate for delay slot filler is not a return instruction.
Akira Hatanaka [Wed, 5 Oct 2011 18:16:09 +0000 (18:16 +0000)]
Make sure candidate for delay slot filler is not a return instruction.

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

12 years agoMake this test less sensitive to codegen optimizations.
Dan Gohman [Wed, 5 Oct 2011 18:13:08 +0000 (18:13 +0000)]
Make this test less sensitive to codegen optimizations.

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

12 years agoAdd RA to the set of registers that are defined if instruction is a call.
Akira Hatanaka [Wed, 5 Oct 2011 18:11:44 +0000 (18:11 +0000)]
Add RA to the set of registers that are defined if instruction is a call.

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

12 years agoSupport a valid, but not very useful, encoding of CPSIE where none of the AIF bits...
Owen Anderson [Wed, 5 Oct 2011 17:16:40 +0000 (17:16 +0000)]
Support a valid, but not very useful, encoding of CPSIE where none of the AIF bits are set.

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

12 years agoTypo. Thanks Bob.
Andrew Trick [Wed, 5 Oct 2011 16:52:28 +0000 (16:52 +0000)]
Typo. Thanks Bob.

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

12 years agoAdd a FIXME.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 16:51:21 +0000 (16:51 +0000)]
Add a FIXME.

TwoAddressInstructionPass should annotate instructions with <undef>
flags when it lower REG_SEQUENCE instructions.  LiveIntervals should not
be in the business of modifying code (except for kill flags, perhaps).

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

12 years agoEnsure OpCode is not used uninitialized.
Duncan Sands [Wed, 5 Oct 2011 15:13:13 +0000 (15:13 +0000)]
Ensure OpCode is not used uninitialized.

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

12 years agoComment out a variable that is only used in commented out code.
Duncan Sands [Wed, 5 Oct 2011 15:12:44 +0000 (15:12 +0000)]
Comment out a variable that is only used in commented out code.

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

12 years agoRemove a bunch of unused variables in the PTX backend (warned about by gcc-4.6).
Duncan Sands [Wed, 5 Oct 2011 15:11:08 +0000 (15:11 +0000)]
Remove a bunch of unused variables in the PTX backend (warned about by gcc-4.6).

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

12 years agoFix compilation when using gcc-4.6. Patch by wanders.
Duncan Sands [Wed, 5 Oct 2011 14:36:12 +0000 (14:36 +0000)]
Fix compilation when using gcc-4.6.  Patch by wanders.

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

12 years agoGVN does simple propagation of conditions: when it sees a conditional
Duncan Sands [Wed, 5 Oct 2011 14:28:49 +0000 (14:28 +0000)]
GVN does simple propagation of conditions: when it sees a conditional
branch "br i1 %x, label %if_true, label %if_false" then it replaces
"%x" with "true" in places only reachable via the %if_true arm, and
with "false" in places only reachable via the %if_false arm.  Except
that actually it doesn't: if value numbering shows that %y is equal
to %x then, yes, %y will be turned into true/false in this way, but
any occurrences of %x itself are not transformed.  Fix this.  What's
more, it's often the case that %x is an equality comparison such as
"%x = icmp eq %A, 0", in which case every occurrence of %A that is
only reachable via the %if_true arm can be replaced with 0.  Implement
this and a few other variations on this theme.  This reduces the number
of lines of LLVM IR in "GCC as one big file" by 0.2%.  It has a bigger
impact on Ada code, typically reducing the number of lines of bitcode
by around 0.4% by removing repeated compiler generated checks.  Passes
the LLVM nightly testsuite and the Ada ACATS testsuite.

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

12 years agoGeneralize GVN's conditional propagation logic slightly:
Duncan Sands [Wed, 5 Oct 2011 14:17:01 +0000 (14:17 +0000)]
Generalize GVN's conditional propagation logic slightly:
it's OK for the false/true destination to have multiple
predecessors as long as the extra ones are dominated by
the branch destination.

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

12 years agoMipsDelaySlotFiller.cpp: Appease msvc to specify llvm::next() explicitly.
NAKAMURA Takumi [Wed, 5 Oct 2011 10:11:02 +0000 (10:11 +0000)]
MipsDelaySlotFiller.cpp: Appease msvc to specify llvm::next() explicitly.

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

12 years agoAdd braces around something that throws me for a loop.
Cameron Zwarich [Wed, 5 Oct 2011 08:59:10 +0000 (08:59 +0000)]
Add braces around something that throws me for a loop.

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

12 years agoThere is no point in setting out-parameters for a ComplexPattern function when
Cameron Zwarich [Wed, 5 Oct 2011 08:59:05 +0000 (08:59 +0000)]
There is no point in setting out-parameters for a ComplexPattern function when
it returns false, at least as far as I could tell by reading the code.

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

12 years agoAlso update the EH with bitcode. I missed this earlier. Thanks to Duncan for pointing...
Bill Wendling [Wed, 5 Oct 2011 07:04:14 +0000 (07:04 +0000)]
Also update the EH with bitcode. I missed this earlier. Thanks to Duncan for pointing it out.

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

12 years agoFix a broken assert found by -Wparentheses.
Chandler Carruth [Wed, 5 Oct 2011 07:02:23 +0000 (07:02 +0000)]
Fix a broken assert found by -Wparentheses.

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

12 years agoMissing test case for r141164.
Andrew Trick [Wed, 5 Oct 2011 06:23:32 +0000 (06:23 +0000)]
Missing test case for r141164.

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

12 years agoFix disabled SCEV analysis caused r141161 and add unit test.
Andrew Trick [Wed, 5 Oct 2011 05:58:49 +0000 (05:58 +0000)]
Fix disabled SCEV analysis caused r141161 and add unit test.

I noticed during self-review that my previous checkin disabled some
analysis. Even with the reenabled analysis the test case runs in about
5ms. Without the fix, it will take several minutes at least.

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

12 years agoAdd more initializers to quiet a clang warning.
Eric Christopher [Wed, 5 Oct 2011 05:00:26 +0000 (05:00 +0000)]
Add more initializers to quiet a clang warning.

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

12 years agoChange C++ style comments to C style comments in X86 disassembler. Patch from Joe...
Craig Topper [Wed, 5 Oct 2011 03:29:32 +0000 (03:29 +0000)]
Change C++ style comments to C style comments in X86 disassembler. Patch from Joe Abbey.

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

12 years agoAvoid exponential recursion in SCEV getConstantEvolvingPHI and EvaluateExpression.
Andrew Trick [Wed, 5 Oct 2011 03:25:31 +0000 (03:25 +0000)]
Avoid exponential recursion in SCEV getConstantEvolvingPHI and EvaluateExpression.

Note to compiler writers: never recurse on multiple instruction
operands without memoization.
Fixes rdar://10187945. Was taking 45s, now taking 5ms.

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

12 years agoInsert space.
Akira Hatanaka [Wed, 5 Oct 2011 02:22:49 +0000 (02:22 +0000)]
Insert space.

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

12 years agoDo not examine variadic or implicit operands if instruction is a return (jr).
Akira Hatanaka [Wed, 5 Oct 2011 02:21:58 +0000 (02:21 +0000)]
Do not examine variadic or implicit operands if instruction is a return (jr).

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

12 years agoClean up function Filler::delayHasHazard.
Akira Hatanaka [Wed, 5 Oct 2011 02:18:58 +0000 (02:18 +0000)]
Clean up function Filler::delayHasHazard.

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

12 years agoRemove function Filler::insertCallUses.
Akira Hatanaka [Wed, 5 Oct 2011 02:04:17 +0000 (02:04 +0000)]
Remove function Filler::insertCallUses.
Record the registers used and defined by a call in Filler::insertDefsUses.

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

12 years agoClean up Filler::findDelayInstr.
Akira Hatanaka [Wed, 5 Oct 2011 01:57:46 +0000 (01:57 +0000)]
Clean up Filler::findDelayInstr.

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

12 years agoRemove function Filler::isDelayFiller. Check if I is the same instruction that
Akira Hatanaka [Wed, 5 Oct 2011 01:30:09 +0000 (01:30 +0000)]
Remove function Filler::isDelayFiller. Check if I is the same instruction that
filled the last delay slot visited.

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

12 years agoClean up Filler::runOnMachineBasicBlock. Change interface of
Akira Hatanaka [Wed, 5 Oct 2011 01:23:39 +0000 (01:23 +0000)]
Clean up Filler::runOnMachineBasicBlock. Change interface of
Filler::findDelayInstr.

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

12 years agoDefine a statistic for the number of slots that were filled with useful
Akira Hatanaka [Wed, 5 Oct 2011 01:19:13 +0000 (01:19 +0000)]
Define a statistic for the number of slots that were filled with useful
instructions (instructions that are not NOP).

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

12 years agoRemove unnecessary check. isDelayFiller(MBB, I) will evaluate to true before
Akira Hatanaka [Wed, 5 Oct 2011 01:15:31 +0000 (01:15 +0000)]
Remove unnecessary check. isDelayFiller(MBB, I) will evaluate to true before
I->getDesc().hasDelaySlot() does.

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

12 years agoAdd comments and move assignment statement. If sawStore is true, sawLoad does
Akira Hatanaka [Wed, 5 Oct 2011 01:09:37 +0000 (01:09 +0000)]
Add comments and move assignment statement. If sawStore is true, sawLoad does
not have to be set.

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

12 years agoCorrect description string of enable-mips-delay-filler.
Akira Hatanaka [Wed, 5 Oct 2011 01:06:57 +0000 (01:06 +0000)]
Correct description string of enable-mips-delay-filler.

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

12 years agoLook at the number of entries in the jump table and jump to a 'trap' block if
Bill Wendling [Wed, 5 Oct 2011 00:39:32 +0000 (00:39 +0000)]
Look at the number of entries in the jump table and jump to a 'trap' block if
the value exceeds that number.

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

12 years agoAdd TRI::getSubClassWithSubReg(RC, Idx) function.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 00:35:49 +0000 (00:35 +0000)]
Add TRI::getSubClassWithSubReg(RC, Idx) function.

This function is used to constrain a register class to a sub-class that
supports the given sub-register index.

For example, getSubClassWithSubReg(GR32, sub_8bit) -> GR32_ABCD.

The function will be used to compute register classes when emitting
INSERT_SUBREG and EXTRACT_SUBREG nodes and for register class inflation
of sub-register operations.

The version provided by TableGen is usually adequate, but targets can
override.

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

12 years agoCheckpoint for SJLJ EH code.
Bill Wendling [Wed, 5 Oct 2011 00:02:33 +0000 (00:02 +0000)]
Checkpoint for SJLJ EH code.

This is a first pass at generating the jump table for the sjlj dispatch. It
currently generates something plausible, but hasn't been tested thoroughly.

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

12 years agoAlso add <imp-use,kill> flags for redefined super-registers.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 00:01:48 +0000 (00:01 +0000)]
Also add <imp-use,kill> flags for redefined super-registers.

For example:

  %vreg10:dsub_0<def,undef> = COPY %vreg1
  %vreg10:dsub_1<def> = COPY %vreg2

is rewritten as:

  %D2<def> = COPY %D0, %Q1<imp-def>
  %D3<def> = COPY %D1, %Q1<imp-use,kill>, %Q1<imp-def>

The first COPY doesn't care about the previous value of %Q1, so it
doesn't read that register.

The second COPY is a partial redefinition of %Q1, so it implicitly kills
and redefines that register.

This makes it possible to recognize instructions that can harmlessly
clobber the full super-register.  The write and don't read the
super-register.

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

12 years agoAlso add <def,undef> flags when coalescing sub-registers.
Jakob Stoklund Olesen [Wed, 5 Oct 2011 00:01:46 +0000 (00:01 +0000)]
Also add <def,undef> flags when coalescing sub-registers.

RegisterCoalescer can create sub-register defs when it is joining a
register with a sub-register.  Add <undef> flags to these new
sub-register defs where appropriate.

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

12 years agoTeach the MC to output code/data region marker labels in MachO and ELF modes. These...
Owen Anderson [Tue, 4 Oct 2011 23:26:17 +0000 (23:26 +0000)]
Teach the MC to output code/data region marker labels in MachO and ELF modes.  These are used by disassemblers to provide better disassembly, particularly on targets like ARM Thumb that like to intermingle data in the TEXT segment.

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

12 years agoAdding back support for printing operands symbolically to ARM's new disassembler
Kevin Enderby [Tue, 4 Oct 2011 22:44:48 +0000 (22:44 +0000)]
Adding back support for printing operands symbolically to ARM's new disassembler
using llvm's public 'C' disassembler API now including annotations.

Hooked this up to Darwin's otool(1) so it can again print things like branch
targets for example this:
 blx _puts
instead of this:
 blx #-36
and includes support for annotations for branches to symbol stubs like:
 bl 0x40 @ symbol stub for: _puts
and annotations for pc relative loads like this:
 ldr r3, #8 @ literal pool for: Hello, world!
Also again can print the expression encoded in the Mach-O relocation entries for
things like this:
 movt r0, :upper16:((_foo-_bar)+1234)

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

12 years agoCreate a mapping between the landing pad basic block and the call site index for...
Bill Wendling [Tue, 4 Oct 2011 22:00:35 +0000 (22:00 +0000)]
Create a mapping between the landing pad basic block and the call site index for later use.

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

12 years agoAllow <undef> flags on def operands as well as uses.
Jakob Stoklund Olesen [Tue, 4 Oct 2011 21:49:33 +0000 (21:49 +0000)]
Allow <undef> flags on def operands as well as uses.

The <undef> flag says that a MachineOperand doesn't read its register,
or doesn't depend on the previous value of its register.

A full register def never depends on the previous register value.  A
partial register def may depend on the previous value if it is intended
to update part of a register.

For example:

  %vreg10:dsub_0<def,undef> = COPY %vreg1
  %vreg10:dsub_1<def> = COPY %vreg2

The first copy instruction defines the full %vreg10 register with the
bits not covered by dsub_0 defined as <undef>.  It is not considered a
read of %vreg10.

The second copy modifies part of %vreg10 while preserving the rest.  It
has an implicit read of %vreg10.

This patch adds a MachineOperand::readsReg() method to determine if an
operand reads its register.

Previously, this was modelled by adding a full-register <imp-def>
operand to the instruction.  This approach makes it possible to
determine directly from a MachineOperand if it reads its register.  No
scanning of MI operands is required.

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

12 years agoTidy up formatting.
Jim Grosbach [Tue, 4 Oct 2011 21:43:51 +0000 (21:43 +0000)]
Tidy up formatting.

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

12 years agoDoxygen-ize comments. No functionality change.
Bill Wendling [Tue, 4 Oct 2011 21:25:01 +0000 (21:25 +0000)]
Doxygen-ize comments. No functionality change.

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

12 years agoRemove unused web page.
Daniel Dunbar [Tue, 4 Oct 2011 21:17:19 +0000 (21:17 +0000)]
Remove unused web page.

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

12 years agoUn-XFAIL file. Comment out individual failing instructions.
Jim Grosbach [Tue, 4 Oct 2011 21:16:42 +0000 (21:16 +0000)]
Un-XFAIL file. Comment out individual failing instructions.

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

12 years agoReplace snprintf with raw_string_ostream.
Francois Pichet [Tue, 4 Oct 2011 21:08:56 +0000 (21:08 +0000)]
Replace snprintf with raw_string_ostream.

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

12 years agoTidy up formatting.
Jim Grosbach [Tue, 4 Oct 2011 20:52:57 +0000 (20:52 +0000)]
Tidy up formatting.

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

12 years agoUn-XFAIL file. Fix incorrect CHECK lines. General format cleanup.
Jim Grosbach [Tue, 4 Oct 2011 20:50:05 +0000 (20:50 +0000)]
Un-XFAIL file. Fix incorrect CHECK lines. General format cleanup.

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

12 years agoUn-XFAIL file. Fix incorrect CHECK line. General format cleanup.
Jim Grosbach [Tue, 4 Oct 2011 20:46:49 +0000 (20:46 +0000)]
Un-XFAIL file. Fix incorrect CHECK line. General format cleanup.

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

12 years agoTidy up formatting.
Jim Grosbach [Tue, 4 Oct 2011 20:42:35 +0000 (20:42 +0000)]
Tidy up formatting.

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

12 years agoUn-XFAIL file. Fix incorrect CHECK line.
Jim Grosbach [Tue, 4 Oct 2011 20:42:09 +0000 (20:42 +0000)]
Un-XFAIL file. Fix incorrect CHECK line.

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

12 years agoUn-XFAIL the file. Disable only the individual tests that aren't working yet.
Jim Grosbach [Tue, 4 Oct 2011 20:34:11 +0000 (20:34 +0000)]
Un-XFAIL the file. Disable only the individual tests that aren't working yet.

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

12 years agoAdd method to determine if a begin label has a call site number associated with it.
Bill Wendling [Tue, 4 Oct 2011 20:31:56 +0000 (20:31 +0000)]
Add method to determine if a begin label has a call site number associated with it.

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

12 years agoProperly use const_iterator.
Jakob Stoklund Olesen [Tue, 4 Oct 2011 20:18:39 +0000 (20:18 +0000)]
Properly use const_iterator.

This should unbreak the Windows build.

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

12 years agoUpdate cmake list.
Devang Patel [Tue, 4 Oct 2011 19:38:16 +0000 (19:38 +0000)]
Update cmake list.

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

12 years agoTell people using the tutorial how to make it actually work.
David Chisnall [Tue, 4 Oct 2011 19:36:30 +0000 (19:36 +0000)]
Tell people using the tutorial how to make it actually work.

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