Commit Graph

49775 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
79c40a011b Count inserted spills and reloads more accurately.
Adjust counters when removing spill and reload instructions.

We still don't account for reloads being removed by eliminateDeadDefs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139806 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 17:54:28 +00:00
Benjamin Kramer
34f864fd38 DWARF: wire up .debug_str dumping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 16:57:13 +00:00
Jim Grosbach
70796ca867 Handle missing newline at EOF more gracefully in MC AsmLexer.
If we see an EOF w/o a preceding end-of-line, return an EndOfStatement
token before returning the Eof token.

Based on patch by Stepan Dyatkovskiy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139798 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 16:52:06 +00:00
Jakob Stoklund Olesen
6b6e32d954 Trace through sibling PHIs in bulk.
When traceSiblingValue() encounters a PHI-def value created by live
range splitting, don't look at all the predecessor blocks.  That can be
very expensive in a complicated CFG.

Instead, consider that all the non-PHI defs jointly dominate all the
PHI-defs.  Tracing directly to all the non-PHI defs is much faster that
zipping around in the CFG when there are many PHIs with many
predecessors.

This significantly improves compile time for indirectbr interpreters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139797 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 16:41:12 +00:00
Jim Grosbach
b6e9a83349 ARM support the pre-UAL mnemonic 'qsubaddx' for 'qsax.'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 16:16:50 +00:00
Jim Grosbach
57b21e437a Thumb2 push/pop mnemonic recognition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 15:55:04 +00:00
Jakob Stoklund Olesen
031432f9ad Speed up LiveIntervals::shrinkToUse with some caching.
Blocks with multiple PHI successors only need to go on the worklist
once.  Use a SmallPtrSet to track the live-out blocks that have already
been handled.  This is a lot faster than the two live range check we
would otherwise do.

Also stop recomputing hasPHIKill flags.  Like RenumberValues(), it is
conservatively correct to leave them in, and they are not used for
anything important.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 15:24:16 +00:00
Jakob Stoklund Olesen
9b82d50d20 Revert r139782, "RemoveCopyByCommutingDef doesn't need hasPHIKill()."
It does, after all.

RemoveCopyByCommutingDef rewrites the uses of one particular value
number in A. It doesn't know how to rewrite phi uses, so there can't be
any.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 06:27:32 +00:00
Benjamin Kramer
75c63087b4 DWARF: Make DIE printing more bulletproof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139786 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 05:43:00 +00:00
Nick Lewycky
3a4178ea13 Add some more DWARF extensions from:
1. http://gcc.gnu.org/wiki/TemplateParmsDwarf
2. ftp://ftp.software.ibm.com/software/os390/czos/dwarf/mips_extensions.pdf


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139784 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 05:21:03 +00:00
Jakob Stoklund Olesen
df8412c4c1 Stop verifying hasPHIKill() flags.
There is only one legitimate use remaining, in addIntervalsForSpills().
All other calls to hasPHIKill() are only used to update PHIKill flags.

The addIntervalsForSpills() function is part of the old spilling
framework, only used by linearscan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139783 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 05:16:30 +00:00
Jakob Stoklund Olesen
de07abe35d RemoveCopyByCommutingDef doesn't need hasPHIKill().
Instead, let HasOtherReachingDefs() test for defs in B that overlap any
phi-defs in A as well.  This test is slightly different, but almost
identical.

A perfectly precise test would only check those phi-defs in A that are
reachable from AValNo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 05:03:50 +00:00
Jakob Stoklund Olesen
4ea24e993f It is safe to remat a value killed by phis.
The source live range is recomputed using shrinkToUses() which does
handle phis correctly.  The hasPHIKill() condition was relevant in the
old days when ReMaterializeTrivialDef() tried to recompute the live
range itself.

The shrinkToUses() function will mark the original def as dead when no
more uses and phi kills remain.  It is then removed by
runOnMachineFunction().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139781 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 04:52:06 +00:00
Jakob Stoklund Olesen
573a32d487 Leave hasPHIKill flags alone in LiveInterval::RenumberValues.
It is conservatively correct to keep the hasPHIKill flags, even after
deleting PHI-defs.

The calculation can be very expensive after taildup has created a
quadratic number of indirectbr edges in the CFG, and the hasPHIKill flag
isn't used for anything after RenumberValues().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139780 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 04:37:18 +00:00
Nick Lewycky
f59c532cfd Update Dwarf enums list for DWARF 4.
Note that DW_TAG_rvalue_reference_type is officially 0x42, not 0x41.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139779 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 04:23:44 +00:00
Benjamin Kramer
7b97442b49 DWARF: Print the number for unknown abbrev fields.
Thanks Nick!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 04:15:59 +00:00
Benjamin Kramer
42180e8336 DWARF: Fail gracefully when encountering unknown values in an abbrev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139777 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 04:00:58 +00:00
Nick Lewycky
6bc4e712dc Give structs with virtual methods a virtual destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 03:41:51 +00:00
Benjamin Kramer
068d9a564b DWARF: Silence GCC -Wsign-compare warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139775 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 03:20:04 +00:00
Benjamin Kramer
89aedba562 DWARF: Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139774 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 03:11:09 +00:00
Benjamin Kramer
7393c7f748 DWARF: Include <algorithm> explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139773 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 02:19:33 +00:00
Benjamin Kramer
b848e97611 DWARF: Add basic support for line tables.
The llvm-dwarfdump output isn't very verbose yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139771 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 02:12:05 +00:00
Eli Friedman
c82751dd67 Make demanded-elt simplification for shufflevector slightly stronger. Spotted by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139768 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 01:14:29 +00:00
Andrew Trick
b1afbac64b [regcoalescing] bug fix for RegistersDefinedFromSameValue.
An improper SlotIndex->VNInfo lookup was leading to unsafe copy removal.
Fixes PR10920 401.bzip2 miscompile with no IV rewrite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 01:09:33 +00:00
Eli Friedman
322ea080ad Fix the code creating VZEXT_LOAD so that it creates the right memoperand. Issue spotted in -debug output. I can't think of any practical effects at the moment, but it might matter if we start doing more aggressive alias analysis in CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139758 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 23:42:45 +00:00
Douglas Gregor
d26d6b68dd Update the comment for system_temp_directory() to indicate when it
will ignore the erasedOnReboot option, and properly escape the
backslash in "C:\TEMP". Thanks to Aaron and Francois.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 23:21:47 +00:00
Jim Grosbach
0b69247b10 Thumb2 assembly parsing and encoding for PKH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139754 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 23:16:41 +00:00
Jim Grosbach
21a05e7017 ARMv7a has the PKH instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139753 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 23:16:34 +00:00
Devang Patel
734a67cda5 Add support to emit debug info for C++0x nullptr type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139751 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 23:13:28 +00:00
Jim Grosbach
e1d58a6556 ARM tighten up the register classes for the PKH instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 22:52:14 +00:00
Owen Anderson
8adf62034a Fix a crasher in Thumb2 MOV-immediate encoding for certain inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 22:46:14 +00:00
Bill Wendling
544e4124fe Include limits.h to make sure PATH_MAX is known on Solaris 10.
Patch by Joakim Johansson!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 21:49:42 +00:00
Jim Grosbach
d32872f9ca Thumb2 assembly parsing and encoding for MVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139739 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 21:24:41 +00:00
Owen Anderson
34626acf7f Nested IT blocks are UNPREDICTABLE. Mark them as such when disassembling them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139736 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 21:06:21 +00:00
Jim Grosbach
64944f48a1 Thumb2 assembly parsing and encoding for MUL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139735 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 21:00:40 +00:00
Benjamin Kramer
10df80692c DWARF: Generate the address lookup table from the DIE tree if .debug_aranges is not available.
Ported from LLDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139732 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 20:52:27 +00:00
Douglas Gregor
55cf815e19 Add a simple routine to determine the typical system directory for
temporary data. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139725 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 20:27:01 +00:00
Jim Grosbach
bf841cf336 Thumb2 assembly parsing and encoding for MSR/MRS.
Fix a bug in handling default flags for both ARM and Thumb encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 20:03:46 +00:00
Jim Grosbach
c2d3164ab4 Thumb2 assembly parsing for MOV in IT block.
Select the right 16 vs. 32 bit encoding in an IT block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139714 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 19:12:11 +00:00
Benjamin Kramer
d6361c0954 DWARF: Reorder fields to reduce padding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139712 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:34:47 +00:00
Dan Gohman
1d2fd75e3b Don't mark objc_retainBlock as nounwind. It calls user copy constructors
which could theoretically throw.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139710 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:33:34 +00:00
Dan Gohman
211048286b objc_retainBlock is not NoModRef because it can update forwarding pointers
in memory relevant to the optimizer. rdar://10050579.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:13:00 +00:00
Jim Grosbach
d0588e2a2e ARM fix assembly parser handling of ranges in register lists.
Clean up register list handling in general a bit to explicitly check things
like all the registers being from the same register class.

rdar://8883573


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139707 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:08:35 +00:00
Benjamin Kramer
0942255f6d DWARF: Improve indentation of DIE dumping so it's easier to see the structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 17:54:56 +00:00
Jakob Stoklund Olesen
0d4fea7866 Ignore the cloning of unknown registers.
THe LRE_DidCloneVirtReg callback may be called with vitual registers
that RAGreedy doesn't even know about yet.  In that case, there are no
data structures to update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139702 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 17:34:37 +00:00
Benjamin Kramer
1c0b24f91a llvm-dwarfdump: Make the "is debug info section" heuristic stricter so it doesn't accidentaly picks up the wrong section.
Also add some validation code to the aranges section parser.

Fixes PR10926.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139701 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 17:28:13 +00:00
Akira Hatanaka
0b7b6a0856 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139699 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 17:22:51 +00:00
Jakob Stoklund Olesen
c4c633852f Hoist back-copies to the least busy dominator.
When a back-copy is hoisted to the nearest common dominator, keep
looking up the dominator tree for a less loopy dominator, and place the
back-copy there instead.

Don't do this when a single existing back-copy dominates all the others.
Assume the client knows what he is doing, and keep the dominating
back-copy.

This prevents us from hoisting back-copies into loops in most cases.  If
a value is defined in a loop with multiple exits, we may still hoist
back-copies into that loop.  That is the speed/size tradeoff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139698 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 16:45:39 +00:00
Jim Grosbach
6148225b95 Move state var to private class member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139697 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 16:37:04 +00:00
Douglas Gregor
dcd9996241 Add APInt support for converting to/from hexatridecimal strings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139695 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 15:54:46 +00:00