Commit Graph

76527 Commits

Author SHA1 Message Date
David Greene 4fff1e2f5e Vim Support for Multidefs
Add vim highlighting support for multidefs.

llvm-svn: 141238
2011-10-05 22:42:52 +00:00
David Greene 5d835cc5a0 Emacs Support for Multidefs
Add Emacs font-lock keyword support for multidefs.

llvm-svn: 141237
2011-10-05 22:42:51 +00:00
David Greene ce3852464a Document Multidefs
Provide documentation for multidefs, explaining in detail how they
work.

llvm-svn: 141236
2011-10-05 22:42:49 +00:00
David Greene 9bc27ec40f Update Test for Multidefs
Update the MultiPat.td test to create some defs via multidefs.

llvm-svn: 141235
2011-10-05 22:42:48 +00:00
David Greene 52a9cb8063 Add a Multidef Test
Add a simple test for multidefs.

llvm-svn: 141234
2011-10-05 22:42:47 +00:00
David Greene 2ac084dbb2 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.

llvm-svn: 141233
2011-10-05 22:42:45 +00:00
David Greene dd1eb61298 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.

llvm-svn: 141232
2011-10-05 22:42:44 +00:00
David Greene dd88abaa97 Lexer Support for Multidefs
Add keyword support for multidefs.

llvm-svn: 141231
2011-10-05 22:42:35 +00:00
David Greene 87cf662fbd 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.

llvm-svn: 141230
2011-10-05 22:42:17 +00:00
David Greene db44597494 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.

llvm-svn: 141229
2011-10-05 22:42:07 +00:00
Eli Friedman 3e3aecbc2c 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.

llvm-svn: 141227
2011-10-05 22:27:16 +00:00
Bill Wendling 267f323d28 Modify the mapping from landing pad to call sites to accept more than one call
site.

llvm-svn: 141226
2011-10-05 22:24:35 +00:00
Bill Wendling c2d55b6e50 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.

llvm-svn: 141224
2011-10-05 22:20:38 +00:00
Bill Wendling e61c62533e Small refactoring. Cache the FunctionInfo->MBB into a local variable.
llvm-svn: 141221
2011-10-05 22:16:11 +00:00
Jakob Stoklund Olesen eb38bd8ced 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.

llvm-svn: 141220
2011-10-05 22:12:57 +00:00
Andrew Trick 3e8a576da1 Fixes PR11070 - assert in SCEV getConstantEvolvingPHIOperands.
llvm-svn: 141219
2011-10-05 22:06:53 +00:00
Bill Wendling db1633530a Fix comment to reflect the new EH stuff.
llvm-svn: 141218
2011-10-05 22:04:08 +00:00
Jakob Stoklund Olesen 3abead76ea Remove unused DstSubIdx argument.
llvm-svn: 141214
2011-10-05 21:22:53 +00:00
Jim Grosbach e7abae0442 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.

llvm-svn: 141210
2011-10-05 20:53:43 +00:00
Jim Grosbach 8f9acfac89 Revert 141203. InstCombine is looping on unit tests.
llvm-svn: 141209
2011-10-05 20:44:29 +00:00
Jakob Stoklund Olesen f7957a9819 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.

llvm-svn: 141207
2011-10-05 20:26:40 +00:00
Jakob Stoklund Olesen ee9b576a2a 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.

llvm-svn: 141206
2011-10-05 20:26:33 +00:00
Rafael Espindola 79d0c4f4b0 Check for the returns_twice attribute in callsFunctionThatReturnsTwice. This
fixes PR11038, but there are still some cleanups to be done.

llvm-svn: 141204
2011-10-05 20:05:13 +00:00
Jim Grosbach e37e030137 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

llvm-svn: 141203
2011-10-05 20:05:00 +00:00
Justin Holewinski 664e9f55bf PTX: Fixup a case where getRegClassFor() should be used instead of custom code.
llvm-svn: 141199
2011-10-05 18:32:25 +00:00
Jakob Stoklund Olesen 8ff52c4135 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.

llvm-svn: 141198
2011-10-05 18:31:00 +00:00
Akira Hatanaka c6b742f98a Fix assertion string.
llvm-svn: 141197
2011-10-05 18:17:49 +00:00
Akira Hatanaka 426a804825 Make sure candidate for delay slot filler is not a return instruction.
llvm-svn: 141196
2011-10-05 18:16:09 +00:00
Dan Gohman 8218b8f6ae Make this test less sensitive to codegen optimizations.
llvm-svn: 141195
2011-10-05 18:13:08 +00:00
Akira Hatanaka 14e4149f4e Add RA to the set of registers that are defined if instruction is a call.
llvm-svn: 141194
2011-10-05 18:11:44 +00:00
Owen Anderson 10c5b12f99 Support a valid, but not very useful, encoding of CPSIE where none of the AIF bits are set.
llvm-svn: 141190
2011-10-05 17:16:40 +00:00
Andrew Trick ed39bb8efd Typo. Thanks Bob.
llvm-svn: 141188
2011-10-05 16:52:28 +00:00
Jakob Stoklund Olesen ccdfbfb5e5 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).

llvm-svn: 141187
2011-10-05 16:51:21 +00:00
Duncan Sands 6e8129e127 Ensure OpCode is not used uninitialized.
llvm-svn: 141184
2011-10-05 15:13:13 +00:00
Duncan Sands 36ffaa809f Comment out a variable that is only used in commented out code.
llvm-svn: 141183
2011-10-05 15:12:44 +00:00
Duncan Sands b0e6d04a00 Remove a bunch of unused variables in the PTX backend (warned about by gcc-4.6).
llvm-svn: 141182
2011-10-05 15:11:08 +00:00
Duncan Sands efb31f3f3c Fix compilation when using gcc-4.6. Patch by wanders.
llvm-svn: 141178
2011-10-05 14:36:12 +00:00
Duncan Sands f4f47ccd12 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.

llvm-svn: 141177
2011-10-05 14:28:49 +00:00
Duncan Sands e90dd0587e 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.

llvm-svn: 141176
2011-10-05 14:17:01 +00:00
NAKAMURA Takumi 9ebdf46b5a MipsDelaySlotFiller.cpp: Appease msvc to specify llvm::next() explicitly.
llvm-svn: 141174
2011-10-05 10:11:02 +00:00
Cameron Zwarich 2226b4be09 Add braces around something that throws me for a loop.
llvm-svn: 141173
2011-10-05 08:59:10 +00:00
Cameron Zwarich 6a7aa237cc 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.

llvm-svn: 141172
2011-10-05 08:59:05 +00:00
Bill Wendling ad33c139ac Also update the EH with bitcode. I missed this earlier. Thanks to Duncan for pointing it out.
llvm-svn: 141169
2011-10-05 07:04:14 +00:00
Chandler Carruth f6567a131d Fix a broken assert found by -Wparentheses.
llvm-svn: 141168
2011-10-05 07:02:23 +00:00
Andrew Trick 887a111e31 Missing test case for r141164.
llvm-svn: 141166
2011-10-05 06:23:32 +00:00
Andrew Trick e9162f1ff8 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.

llvm-svn: 141164
2011-10-05 05:58:49 +00:00
Eric Christopher c4b9b526ba Add more initializers to quiet a clang warning.
llvm-svn: 141163
2011-10-05 05:00:26 +00:00
Craig Topper b58a9665bd Change C++ style comments to C style comments in X86 disassembler. Patch from Joe Abbey.
llvm-svn: 141162
2011-10-05 03:29:32 +00:00
Andrew Trick 3a86ba767c 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.

llvm-svn: 141161
2011-10-05 03:25:31 +00:00
Akira Hatanaka 02e760add3 Insert space.
llvm-svn: 141158
2011-10-05 02:22:49 +00:00