Duncan Sands [Thu, 23 Feb 2012 11:01:22 +0000 (11:01 +0000)]
Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151251
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Thu, 23 Feb 2012 10:36:04 +0000 (10:36 +0000)]
Fix to make sure that a comdat group gets generated correctly for a static member
of instantiated C++ templates.
Patch by Kristof Beyls!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151250
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Thu, 23 Feb 2012 09:33:44 +0000 (09:33 +0000)]
Update for the removal of Hashing.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151249
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Thu, 23 Feb 2012 09:17:40 +0000 (09:17 +0000)]
Reinstate r151049 now that GeneralHash is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151248
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Thu, 23 Feb 2012 09:16:04 +0000 (09:16 +0000)]
The implementation of GeneralHash::addBits broke C++ aliasing rules; fix
it with memcpy. This also fixes a problem on big-endian hosts, where
addUnaligned would return different results depending on the alignment
of the data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151247
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Feb 2012 08:42:06 +0000 (08:42 +0000)]
Remove 'if' from getSuperRegisters, getSubRegisters, and getOverlaps that were added in r151038.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151246
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 23 Feb 2012 08:25:25 +0000 (08:25 +0000)]
An easy case where GCC should really be able to work out that the value is only
used if IsInDevelopmentTree is 'true'. But it doesn't, so help it out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151244
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 23 Feb 2012 08:23:53 +0000 (08:23 +0000)]
GCC warns about a comparison between signed and unsigned values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151243
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 23 Feb 2012 08:23:06 +0000 (08:23 +0000)]
GCC fails to understand that NextBB is always initialized if EvaluateBlock
returns 'true' and emits a warning. Help it out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151242
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 Feb 2012 05:38:51 +0000 (05:38 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151238
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Feb 2012 03:39:43 +0000 (03:39 +0000)]
More newline cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151235
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Feb 2012 03:39:39 +0000 (03:39 +0000)]
Add some handy-dandy newlines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151234
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 23 Feb 2012 03:16:24 +0000 (03:16 +0000)]
misched: cleanup reaching def computation
Ignore undef uses completely.
Use a more explicit SlotIndex API.
Add more explicit comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151233
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 23 Feb 2012 02:58:19 +0000 (02:58 +0000)]
Canonicalize (srl (bswap x), 16) to (rotr (bswap x), 16) if the high 16 bits
of x are zero. This optimizes rev + lsr 16 to rev16.
rdar://
10750814
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151230
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 23 Feb 2012 01:52:38 +0000 (01:52 +0000)]
PostRASched: Convert physreg def/use tracking to Jakob's SparseSet.
Added array subscript to SparseSet for convenience.
Slight reorg to make it easier to manage the def/use sets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151228
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:22:15 +0000 (01:22 +0000)]
Handle regmasks in FixupKills.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151226
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 23 Feb 2012 01:19:06 +0000 (01:19 +0000)]
Optimize a couple of common patterns involving conditional moves where the false
value is zero. Instead of a cmov + op, issue an conditional op instead. e.g.
cmp r9, r4
mov r4, #0
moveq r4, #1
orr lr, lr, r4
should be:
cmp r9, r4
orreq lr, lr, #1
That is, optimize (or x, (cmov 0, y, cond)) to (or.cond x, y). Similarly extend
this to xor as well as (and x, (cmov -1, y, cond)) => (and.cond x, y).
It's possible to extend this to ADD and SUB but I don't think they are common.
rdar://
8659097
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151224
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:15:26 +0000 (01:15 +0000)]
Handle regmasks in CriticalAntiDepBreaker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151223
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:13:32 +0000 (01:13 +0000)]
Track reserved registers separately from RegsAvailable.
The bulk masking operations from register mask operands don't account
for reserved registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151222
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Wed, 22 Feb 2012 23:49:50 +0000 (23:49 +0000)]
MC: Fix the MCNullStreamer which was broken in r147763.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151213
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 22 Feb 2012 22:52:52 +0000 (22:52 +0000)]
Don't compute latencies for regmask operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151211
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 22 Feb 2012 22:50:14 +0000 (22:50 +0000)]
Handle regmasks in RegisterScavenging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151210
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 22 Feb 2012 21:59:00 +0000 (21:59 +0000)]
misched: Use SparseSet for VRegDegs for constant time clear().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151205
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 22 Feb 2012 21:11:47 +0000 (21:11 +0000)]
Allow the use of an alternate symbol for calculating a function's size.
The standard function epilog includes a .size directive, but ppc64 uses
an alternate local symbol to tag the actual start of each function.
Until recently, binutils accepted the .size directive as:
.size test1, .Ltmp0-test1
however, using this directive with recent binutils will result in the error:
.size expression for XXX does not evaluate to a constant
so we must use the label which actually tags the start of the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151200
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 22 Feb 2012 19:38:03 +0000 (19:38 +0000)]
Remove bad comma from .el file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151189
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 22 Feb 2012 19:17:20 +0000 (19:17 +0000)]
libclc is now dual licensed, Tobias and Peter own their respective subprojects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151186
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 22 Feb 2012 19:06:13 +0000 (19:06 +0000)]
Properly emit _fltused with FastISel. Refactor to share code with SDAG.
Patch by Joe Groff!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151183
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 22 Feb 2012 18:34:49 +0000 (18:34 +0000)]
Comment from code review
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151178
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 Feb 2012 17:25:00 +0000 (17:25 +0000)]
Remove extra semi-colons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151169
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 22 Feb 2012 16:50:46 +0000 (16:50 +0000)]
80 col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151167
91177308-0d34-0410-b5e6-
96231b3b80d8
Sirish Pande [Wed, 22 Feb 2012 16:45:10 +0000 (16:45 +0000)]
Efficient pattern for store truncate. Patch by Evandro Menezes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151166
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Wed, 22 Feb 2012 16:09:41 +0000 (16:09 +0000)]
Add Foreach Loop
Add some data structures to represent for loops. These will be
referenced during object processing to do any needed iteration and
instantiation.
Add foreach keyword support to the lexer.
Add a mode to indicate that we're parsing a foreach loop. This allows
the value parser to early-out when processing the foreach value list.
Add a routine to parse foreach iteration declarations. This is
separate from ParseDeclaration because the type of the named value
(the iterator) doesn't match the type of the initializer value (the
value list). It also needs to add two values to the foreach record:
the iterator and the value list.
Add parsing support for foreach.
Add the code to process foreach loops and create defs based
on iterator values.
Allow foreach loops to be matched at the top level.
When parsing an IDValue check if it is a foreach loop iterator for one
of the active loops. If so, return a VarInit for it.
Add Emacs keyword support for foreach.
Add VIM keyword support for foreach.
Add tests to check foreach operation.
Add TableGen documentation for foreach.
Support foreach with multiple objects.
Support non-braced foreach body with one object.
Do not require types for the foreach declaration. Assume the iterator
type from the iteration list element type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151164
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 22 Feb 2012 16:01:54 +0000 (16:01 +0000)]
Fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151163
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 22 Feb 2012 13:42:11 +0000 (13:42 +0000)]
Remove static ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151160
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 22 Feb 2012 11:32:54 +0000 (11:32 +0000)]
Support was removed from LLVM's MIPS backend for the PSP variant of that
chip in r139383, and the PSP components of the triple are really
annoying to parse. Let's leave this chapter behind. There is no reason
to expect LLVM to see a PSP-related triple these days, and so no
reasonable motivation to support them.
It might be reasonable to prune a few of the older MIPS triple forms in
general, but as those at least cause no burden on parsing (they aren't
both a chip and an OS!), I'm happy to leave them in for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151156
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 22 Feb 2012 08:46:21 +0000 (08:46 +0000)]
Only add DW_AT_prototyped if we're working with a C-like language.
Worth another 45k (1%) off of a large C++ testcase.
rdar://
10909458
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151144
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 22 Feb 2012 08:46:13 +0000 (08:46 +0000)]
Add the source language into the compile unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151143
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 22 Feb 2012 08:46:02 +0000 (08:46 +0000)]
Remove extra semi-colon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151142
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 22 Feb 2012 07:28:11 +0000 (07:28 +0000)]
Declare register classes as const. Fix a couple pointers to register classes that weren't already const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151138
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 22 Feb 2012 06:08:13 +0000 (06:08 +0000)]
misched: DAG builder should not track dependencies for SSA defs.
The vast majority of virtual register definitions don't need an entry
in the DAG builder's VRegDefs set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151136
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 22 Feb 2012 06:08:11 +0000 (06:08 +0000)]
Initialize SUnits before DAG building.
Affect on SD scheduling and postRA scheduling:
Printing the DAG will display the nodes in top-down topological order.
This matches the order within the MBB and makes my life much easier in general.
Affect on misched:
We don't need to track virtual register uses at all. This is awesome.
I also intend to rely on the SUnit ID as a topo-sort index. So if A < B then we cannot have an edge B -> A.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151135
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 22 Feb 2012 05:59:10 +0000 (05:59 +0000)]
Make all pointers to TargetRegisterClass const since they are all pointers to static data that should not be modified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151134
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Feb 2012 03:44:46 +0000 (03:44 +0000)]
Improve comment. Thanks for Andrew for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151127
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Feb 2012 03:21:39 +0000 (03:21 +0000)]
Semantically revert 151015. Add a comment on why we should be able to assert
the dominance once the dominates method is fixed and why we can use the builder's
insertion point.
Fixes pr12048.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151125
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 22 Feb 2012 03:04:40 +0000 (03:04 +0000)]
Adding support for Microsoft's thiscall calling convention. LLVM side of the patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151123
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 22 Feb 2012 01:43:47 +0000 (01:43 +0000)]
Improve handling of blockaddresses in bugpoint when splitting a module. Patch by Daniel Reynaud.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151115
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 22 Feb 2012 01:19:35 +0000 (01:19 +0000)]
ADT/SparseSet.h: Fix up header dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151114
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 22 Feb 2012 01:07:19 +0000 (01:07 +0000)]
Clarify ARM calling conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151113
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 22 Feb 2012 01:02:37 +0000 (01:02 +0000)]
Use SparseSet for the RAFast live virtual register map.
This makes RAFast 4% faster, and it gets rid of the dodgy DenseMap
iteration.
This also revealed that RAFast would sometimes dereference DenseMap
iterators after erasing other elements from the map. That does seem to
work in the current DenseMap implementation, but SparseSet doesn't allow
it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151111
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 22 Feb 2012 00:56:08 +0000 (00:56 +0000)]
Add a Briggs and Torczon sparse set implementation.
For objects that can be identified by small unsigned keys, SparseSet
provides constant time clear() and fast deterministic iteration. Insert,
erase, and find operations are typically faster than hash tables.
SparseSet is useful for keeping information about physical registers,
virtual registers, or numbered basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151110
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 22 Feb 2012 00:16:54 +0000 (00:16 +0000)]
Use a function in MathExtras to do sign extension.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151107
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 21 Feb 2012 23:49:18 +0000 (23:49 +0000)]
Remove a bad PowerPC test.
This test case was way too strict, matching the entire assembly output.
Every non-trivial change to the ppc backend or -O0 pipeline required
the test to be updated.
It should be replaced with a test of the specific vaarg feature.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151105
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 21 Feb 2012 23:47:43 +0000 (23:47 +0000)]
Calls don't really change the stack pointer.
Even if a call instruction has %SP<imp-def> operands, it doesn't change
the value of the stack pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151104
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 21 Feb 2012 22:29:38 +0000 (22:29 +0000)]
Add API "handleMoveIntoBundl" for updating liveness when moving instructions into
bundles. This method takes a bundle start and an MI being bundled, and makes
the intervals for the MI's operands appear to start/end on the bundle start.
Also fixes some minor cosmetic issues (whitespace, naming convention) in the
HMEditor code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151099
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 21 Feb 2012 22:25:56 +0000 (22:25 +0000)]
Testcase for previous commit.
rdar://
10493979
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151098
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 21 Feb 2012 22:25:53 +0000 (22:25 +0000)]
There's no need for a DW_AT_byte_size on a pointer type.
Part of rdar://
10493979 where it reduces by about .5% (10k)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151097
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 21 Feb 2012 22:08:06 +0000 (22:08 +0000)]
Use the target-aware constant folder on expressions to improve the chance
they'll be simple enough to simulate, and to reduce the chance we'll encounter
equal but different simple pointer constants.
This removes the symptoms from PR11352 but is not a full fix. A proper fix would
either require a guarantee that two constant objects we simulate are folded
when equal, or a different way of handling equal pointers (ie., trying a
constantexpr icmp on them to see whether we know they're equal or non-equal or
unsure).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151093
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 21 Feb 2012 20:46:00 +0000 (20:46 +0000)]
Proper support for a bastardized darwin-eabi hybird ABI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151083
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Feb 2012 19:27:16 +0000 (19:27 +0000)]
s/the the/the/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151079
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 21 Feb 2012 13:40:06 +0000 (13:40 +0000)]
Fix unsigned off-by-one in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151056
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 21 Feb 2012 13:31:09 +0000 (13:31 +0000)]
InstCombine: Don't transform a signed icmp of two GEPs into a signed compare of the indices.
This transformation is not safe in some pathological cases (signed icmp of pointers should be an
extremely rare thing, but it's valid IR!). Add an explanatory comment.
Kudos to Duncan for pointing out this edge case (and not giving up explaining it until I finally got it).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151055
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Tue, 21 Feb 2012 12:00:25 +0000 (12:00 +0000)]
Move the implementation of StringRef::split out of StringExtras.cpp
and into StringRef.cpp, which is where the other StringRef stuff is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151054
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 21 Feb 2012 11:56:42 +0000 (11:56 +0000)]
test/CodeGen/X86/2012-02-20-MachineCPBug.ll: Fix on generic(non-x86) hosts to add -mattr=+sse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151053
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Tue, 21 Feb 2012 11:44:46 +0000 (11:44 +0000)]
Revert r151049 cos it broke the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151052
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 21 Feb 2012 09:29:14 +0000 (09:29 +0000)]
Tiny cosmetic change to use the same style for all of the while loops in
the normalize routine, especially the empty while loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151050
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Tue, 21 Feb 2012 09:25:52 +0000 (09:25 +0000)]
PR1210: make uniquing of struct and function types more efficient by
using a DenseMap and Talin's new GeneralHash, avoiding the need for a
temporary std::vector on every lookup.
Patch by Meador Inge!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151049
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 21 Feb 2012 09:12:48 +0000 (09:12 +0000)]
Replace a hand rolled loop with a lovely StringRef helper we have these
days. No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151048
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 21 Feb 2012 08:53:32 +0000 (08:53 +0000)]
Pull the parsing helper functions out of the Triple interface entirely.
They're private static methods but we can just make them static
functions in the implementation. It makes the implementations a touch
more wordy, but takes another chunk out of the header file.
Also, take the opportunity to switch the names to the new coding
conventions.
No functionality changed here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151047
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 21 Feb 2012 08:31:18 +0000 (08:31 +0000)]
Clean up comments that I missed when changing the triple representation.
Somehow, I even missed the ones I wrote just the other day...
Thanks to Matt for the code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151045
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 21 Feb 2012 07:36:39 +0000 (07:36 +0000)]
Reorder some members in MCRegisterClass to remove padding on 64-bit builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151043
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 21 Feb 2012 06:54:41 +0000 (06:54 +0000)]
In generated RegisterInfo files, replace a pointer to the end of an array with just the size of the array to avoid relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151041
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 21 Feb 2012 06:23:21 +0000 (06:23 +0000)]
Merge some tables in generated RegisterInfo file. Store indices into larger table instead of pointers to reduce relocations and shrink table size on 64-bit builds. Shaves ~24K off X86MCTargetDesc.o. Accidentally commited only part of this in r151038.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151039
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 21 Feb 2012 06:22:36 +0000 (06:22 +0000)]
Merge some tables in generated RegisterInfo file. Store indices into larger table instead of pointers to reduce relocations and shrink table size on 64-bit builds. Shaves ~24K off X86MCTargetDesc.o
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151038
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 21 Feb 2012 04:51:23 +0000 (04:51 +0000)]
Clear virtual registers after they are no longer referenced.
Passes after RegAlloc should be able to rely on MRI->getNumVirtRegs() == 0.
This makes sharing code for pre/postRA passes more robust.
Now, to check if a pass is running before the RA pipeline begins, use MRI->isSSA().
To check if a pass is running after the RA pipeline ends, use !MRI->getNumVirtRegs().
PEI resets virtual regs when it's done scavenging.
PTX will either have to provide its own PEI pass or assign physregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151032
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 21 Feb 2012 04:51:19 +0000 (04:51 +0000)]
StackSlotColoring does not use a VirtRegMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151031
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 21 Feb 2012 04:51:17 +0000 (04:51 +0000)]
whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151030
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Feb 2012 03:51:14 +0000 (03:51 +0000)]
Use more idiomatic assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151026
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Feb 2012 03:48:30 +0000 (03:48 +0000)]
Avoid warning on non assert builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151025
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 21 Feb 2012 03:39:36 +0000 (03:39 +0000)]
Switch the llvm::Triple class to immediately parse the triple string on
construction. Simplify its interface, implementation, and users
accordingly as there is no longer an 'uninitialized' state to check for.
Also, fixes a bug lurking in the interface as there was one method that
didn't correctly check for initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151024
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Feb 2012 01:19:51 +0000 (01:19 +0000)]
It turns out that with the current scev organization ReuseOrCreateCast cannot
know where users will be added. Because of this, it cannot use
Builder.GetInsertPoint at all.
This patch
* removes the FIXME about adding the assert.
* adds a comment explaining hy we don't have one.
* removes a broken logic that only works for some callers and is not needed
since r150884.
* adds an assert to caller that would have caught the bug fixed by r150884.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151015
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 21 Feb 2012 00:00:36 +0000 (00:00 +0000)]
Fix some bugs in HMEditor's moveAllOperandsInto logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151006
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 20 Feb 2012 23:32:26 +0000 (23:32 +0000)]
Check for the correct size in the invariant marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151003
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 20 Feb 2012 23:28:17 +0000 (23:28 +0000)]
Fix machine-cp by having it to check sub-register indicies. e.g.
ecx = mov eax
al = mov ch
The second copy is not a nop because the sub-indices of ecx,ch is not the
same of that of eax/al.
Re-enabled machine-cp.
PR11940
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151002
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 20 Feb 2012 23:13:17 +0000 (23:13 +0000)]
Fix 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150998
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 20 Feb 2012 19:00:28 +0000 (19:00 +0000)]
Test case for r150978.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150979
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 20 Feb 2012 18:45:10 +0000 (18:45 +0000)]
InstCombine: Removing the base from the address calculation is only safe when the GEPs are inbounds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150978
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 20 Feb 2012 18:04:39 +0000 (18:04 +0000)]
Make this a bit prettier and more obvious when a derived type isn't
derived from anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150975
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 20 Feb 2012 18:04:35 +0000 (18:04 +0000)]
If a derived type is also a composite type, print that information
too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150974
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 20 Feb 2012 18:04:14 +0000 (18:04 +0000)]
Add support for runtime languages on our forward declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150973
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 20 Feb 2012 15:07:47 +0000 (15:07 +0000)]
InstCombine: When comparing two GEPs that were derived from the same base pointer but use different types, expand the offset calculation and to the compare on the offset if profitable.
This came up in SmallVector code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150962
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 20 Feb 2012 14:34:57 +0000 (14:34 +0000)]
InstCombine: Make OptimizePointerDifference more aggressive.
- Ignore pointer casts.
- Also expand GEPs that aren't constantexprs when they have one use or only constant indices.
- We now compile "&foo[i] - &foo[j]" into "i - j".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150961
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 20 Feb 2012 12:02:38 +0000 (12:02 +0000)]
Teach the DAGCombiner that certain loadext nodes followed by ANDs can be converted to zeroexts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150957
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 20 Feb 2012 09:24:05 +0000 (09:24 +0000)]
Improve generated code for extending loads and some trunc stores on ARM.
Teach TargetSelectionDAG about lengthening loads for vector types and set v4i8 as legal. Allow FP_TO_UINT for v4i16 from v4i32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150956
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 20 Feb 2012 07:51:58 +0000 (07:51 +0000)]
Make post-ra tail duplication bundle safe. No test case as recent codegen
flow changes have already hidden the bug. rdar://
10893812
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150949
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 20 Feb 2012 03:25:59 +0000 (03:25 +0000)]
Rename class Evaluate to Evaluator and put it in an anonymous namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150947
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 20 Feb 2012 00:42:49 +0000 (00:42 +0000)]
fold comparisons of gep'd alloca points with null to false,
implementing PR12013. We now compile the testcase to:
__Z4testv: ## @_Z4testv
## BB#0: ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
pushq %rbx
subq $64, %rsp
leaq 32(%rsp), %rbx
movq %rbx, (%rsp)
leaq 64(%rsp), %rax
movq %rax, 16(%rsp)
movl $1, 32(%rsp)
leaq 36(%rsp), %rax
movq %rax, 8(%rsp)
leaq (%rsp), %rdi
callq __Z1gRN4llvm11SmallVectorIiLj8EEE
movq (%rsp), %rdi
cmpq %rbx, %rdi
je LBB0_2
## BB#1:
callq _free
LBB0_2: ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
addq $64, %rsp
popq %rbx
ret
instead of:
__Z4testv: ## @_Z4testv
## BB#0:
pushq %rbx
subq $64, %rsp
xorl %eax, %eax
leaq (%rsp), %rbx
addq $32, %rbx
movq %rbx, (%rsp)
movq %rbx, 8(%rsp)
leaq 64(%rsp), %rcx
movq %rcx, 16(%rsp)
je LBB0_2
## BB#1:
movl $1, 32(%rsp)
movq %rbx, %rax
LBB0_2: ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
addq $4, %rax
movq %rax, 8(%rsp)
leaq (%rsp), %rdi
callq __Z1gRN4llvm11SmallVectorIiLj8EEE
movq (%rsp), %rdi
cmpq %rbx, %rdi
je LBB0_4
## BB#3:
callq _free
LBB0_4: ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
addq $64, %rsp
popq %rbx
ret
This doesn't shrink clang noticably though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150944
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 20 Feb 2012 00:02:49 +0000 (00:02 +0000)]
Switch to a more idiomatic way of silencing unused variable warnings in
release builds. Silences clang's -Wself-assign.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150942
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 20 Feb 2012 00:02:47 +0000 (00:02 +0000)]
Move constructors out-of-line and flesh out their documentation. No
functionality changed. This is in preparation for some refactoring of
how this class behaves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150941
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sun, 19 Feb 2012 23:26:27 +0000 (23:26 +0000)]
Move EvaluateFunction and EvaluateBlock into a class, and make the class store
the information that they pass around between them. No functionality change!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150939
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 19 Feb 2012 12:25:07 +0000 (12:25 +0000)]
Silence operator precedence warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150921
91177308-0d34-0410-b5e6-
96231b3b80d8