Craig Topper [Sat, 26 Apr 2014 19:29:41 +0000 (19:29 +0000)]
Convert getMemIntrinsicNode to take ArrayRef of SDValue instead of pointer and size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207329
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Liew [Sat, 26 Apr 2014 19:05:45 +0000 (19:05 +0000)]
Trivial test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207328
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 26 Apr 2014 18:35:24 +0000 (18:35 +0000)]
Convert SelectionDAG::getNode methods to use ArrayRef<SDValue>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207327
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 26 Apr 2014 18:35:13 +0000 (18:35 +0000)]
Remove an unused version of getMemIntrinsicNode and getNode. Additionally, these were calling makeVTList with the pointers passed in which would were unlikely to belong to SelectionDAG and likely would have just been stack pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207326
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 26 Apr 2014 18:25:07 +0000 (18:25 +0000)]
Include C++ source for debug info test case committed in r207323
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207324
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 26 Apr 2014 17:27:38 +0000 (17:27 +0000)]
DWARF Type Units: Avoid emitting type units under fission if the type requires an address.
Since there's no way to ensure the type unit in the .dwo and the type
unit skeleton in the .o are correlated, this cannot work.
This implementation is a bit inefficient for a few reasons, called out
in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207323
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 26 Apr 2014 16:26:41 +0000 (16:26 +0000)]
Print X86ISD::PMULDQ nodes properly in debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207322
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 26 Apr 2014 16:26:41 +0000 (16:26 +0000)]
DwarfDebug: Minor refactoring around type unit construction
Sinking addition of the declaration attribute down to where the
signature is added. So that if the signature is not added neither is the
declaration attribute (this will come in handy when aborting type unit
construction to instead emit the type into the CU directly in some
cases)
Pull out type unit identifier hashing just to simplify the function a
little, it'll be getting longer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207321
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 26 Apr 2014 14:53:05 +0000 (14:53 +0000)]
X86TTI: i16/i32 vector div with a constant (splat) divisor are reasonably cheap now.
Turn vectorization back on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207320
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 26 Apr 2014 14:12:19 +0000 (14:12 +0000)]
X86: Lower SMUL_LOHI of v4i32 to pmuldq when SSE4.1 is available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207318
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 26 Apr 2014 13:01:03 +0000 (13:01 +0000)]
X86: Add patterns for MULHU/MULHS of v8i16 and v16i16.
This gets us pretty code for divs of i16 vectors. Turn the existing
intrinsics into the corresponding nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207317
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 26 Apr 2014 13:00:53 +0000 (13:00 +0000)]
Rip out X86-specific vector SDIV lowering, make the corresponding DAGCombiner transform work on vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207316
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 26 Apr 2014 12:06:28 +0000 (12:06 +0000)]
DAGCombiner: Turn divs of vector splats into vectorized multiplications.
Otherwise the legalizer would just scalarize everything. Support for
mulhi in the targets isn't that great yet so on most targets we get
exactly the same scalarized output. Add a test for x86 vector udiv.
I had to disable the mulhi nodes on ARM because there aren't any patterns
for it. As far as I know ARM has instructions for getting the high part of
a multiply so this should be fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207315
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 26 Apr 2014 12:06:11 +0000 (12:06 +0000)]
X86: Custom lower v4i32 UMUL_LOHI into 2 pmuludqs.
Test will follow soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207314
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Sat, 26 Apr 2014 09:56:41 +0000 (09:56 +0000)]
Revert r206749 till a final decision about the intrinsics is made.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207313
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 26 Apr 2014 09:45:55 +0000 (09:45 +0000)]
[LCG] Rather than removing nodes from the SCC entry set when we process
them, just skip over any DFS-numbered nodes when finding the next root
of a DFS. This allows the entry set to just be a vector as we populate
it from a uniqued source. It also removes the possibility for a linear
scan of the entry set to actually do the removal which can make things
go quadratic if we get unlucky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207312
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 26 Apr 2014 09:28:00 +0000 (09:28 +0000)]
[LCG] Rotate the full SCC finding algorithm to avoid round-trips through
the DFS stack for leaves in the call graph. As mentioned in my previous
commit, this is particularly interesting for graphs which have high fan
out but low connectivity resulting in many leaves. For such graphs, this
can remove a large % of the DFS stack traffic even though it doesn't
make the stack much smaller.
It's a bit easier to formulate this for the full algorithm because that
one stops completely for each SCC. For example, I was able to directly
eliminate the "Recurse" boolean used to continue an outer loop from the
inner loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207311
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 26 Apr 2014 09:06:53 +0000 (09:06 +0000)]
[LCG] Hoist the main DFS loop out of the edge removal function. This
makes working through the worklist much cleaner, and makes it possible
to avoid the 'bool-to-continue-the-outer-loop' hack. Not a huge
difference, but I think this is approaching as polished as I can make
it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207310
91177308-0d34-0410-b5e6-
96231b3b80d8
Gerolf Hoflehner [Sat, 26 Apr 2014 05:58:11 +0000 (05:58 +0000)]
RecursivelyDeleteTriviallyDeadInstructions() could remove
more than 1 instruction. The caller need to be aware of this
and adjust instruction iterators accordingly.
rdar://
16679376
Repaired r207302.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207309
91177308-0d34-0410-b5e6-
96231b3b80d8
Gerolf Hoflehner [Sat, 26 Apr 2014 05:43:41 +0000 (05:43 +0000)]
Restore CloneFunction.cpp which got accidently
overwritten by previous backout of r207303
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207308
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 26 Apr 2014 03:36:42 +0000 (03:36 +0000)]
[LCG] In the incremental SCC re-formation, lift the node currently being
processed in the DFS out of the stack completely. Keep it exclusively in
a variable. Re-shuffle some code structure to make this easier. This can
have a very dramatic effect in some cases because call graphs tend to
look like a high fan-out spanning tree. As a consequence, there are
a large number of leaf nodes in the graph, and this technique causes
leaf nodes to never even go into the stack. While this only reduces the
max depth by 1, it may cause the total number of round trips through the
stack to drop by a lot.
Now, most of this isn't really relevant for the incremental version. =]
But I wanted to prototype it first here as this variant is in ways more
complex. As long as I can get the code factored well here, I'll next
make the primary walk look the same. There are several refactorings this
exposes I think.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207306
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 26 Apr 2014 03:36:37 +0000 (03:36 +0000)]
[LCG] Special case the removal of self edges. These don't impact the SCC
graph in any way because we don't track edges in the SCC graph, just
nodes. This also lets us add a nice assert about the invariant that
we're working on at least a certain number of nodes within the SCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207305
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Sat, 26 Apr 2014 02:58:04 +0000 (02:58 +0000)]
[DAG] During DAG legalization keep opaque constants even after expanding.
The included test case would return the incorrect results, because the expansion
of an shift with a constant shift amount of 0 would generate undefined behavior.
This is because ExpandShiftByConstant assumes that all shifts by constants with
a value of 0 have already been optimized away. This doesn't happen for opaque
constants and usually this isn't a problem, because opaque constants won't take
this code path - they are not supposed to. In the case that the opaque constant
has to be expanded by the legalizer, the legalizer would drop the opaque flag.
In this case we hit the limitations of ExpandShiftByConstant and create incorrect
code.
This commit fixes the legalizer by not dropping the opaque flag when expanding
opaque constants and adding an assertion to ExpandShiftByConstant to catch this
not supported case in the future.
This fixes <rdar://problem/
16718472>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207304
91177308-0d34-0410-b5e6-
96231b3b80d8
Gerolf Hoflehner [Sat, 26 Apr 2014 02:03:17 +0000 (02:03 +0000)]
Revert commit r207302 since build failures
have been reported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207303
91177308-0d34-0410-b5e6-
96231b3b80d8
Gerolf Hoflehner [Sat, 26 Apr 2014 01:19:16 +0000 (01:19 +0000)]
RecursivelyDeleteTriviallyDeadInstructions() could remove
more than 1 instruction. The caller need to be aware of this
and adjust instruction iterators accordingly.
rdar://
16679376
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207302
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 26 Apr 2014 01:11:26 +0000 (01:11 +0000)]
[X86] Implement TargetLowering::getScalingFactorCost hook.
Scaling factors are not free on X86 because every "complex" addressing mode
breaks the related instruction into 2 allocations instead of 1.
<rdar://problem/
16730541>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207301
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 26 Apr 2014 01:03:46 +0000 (01:03 +0000)]
[LCG] Refactor the duplicated code I added in my last commit here into
a helper function. Also factor the other two places where we did the
same thing into the helper function. =] Much cleaner this way. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207300
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Sat, 26 Apr 2014 01:03:22 +0000 (01:03 +0000)]
[InstCombine][X86] Teach how to fold calls to SSE2/AVX2 packed logical shift
right intrinsics.
A packed logical shift right with a shift count bigger than or equal to the
element size always produces a zero vector. In all other cases, it can be
safely replaced by a 'lshr' instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207299
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Sat, 26 Apr 2014 00:53:26 +0000 (00:53 +0000)]
Add missing include guards and missing #include, found by modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207298
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Sat, 26 Apr 2014 00:02:37 +0000 (00:02 +0000)]
Appease the almighty buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207295
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Fri, 25 Apr 2014 23:51:17 +0000 (23:51 +0000)]
Optimization for certain shufflevector by using insertps.
Summary:
If we're doing a v4f32/v4i32 shuffle on x86 with SSE4.1, we can lower
certain shufflevectors to an insertps instruction:
When most of the shufflevector result's elements come from one vector (and
keep their index), and one element comes from another vector or a memory
operand.
Added tests for insertps optimizations on shufflevector.
Added support and tests for v4i32 vector optimization.
Reviewers: nadav
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D3475
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207291
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 23:16:58 +0000 (23:16 +0000)]
Revert "blockfreq: Approximate irreducible control flow"
This reverts commit r207286. It causes an ICE on the
cmake-llvm-x86_64-linux buildbot [1]:
llvm/lib/Analysis/BlockFrequencyInfo.cpp: In lambda function:
llvm/lib/Analysis/BlockFrequencyInfo.cpp:182:1: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:1035
[1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/12093/steps/build_llvm/logs/stdio
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207287
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 23:08:57 +0000 (23:08 +0000)]
blockfreq: Approximate irreducible control flow
Previously, irreducible backedges were ignored. With this commit,
irreducible SCCs are discovered on the fly, and modelled as loops with
multiple headers.
This approximation specifies the headers of irreducible sub-SCCs as its
entry blocks and all nodes that are targets of a backedge within it
(excluding backedges within true sub-loops). Block frequency
calculations act as if we insert a new block that intercepts all the
edges to the headers. All backedges and entries to the irreducible SCC
point to this imaginary block. This imaginary block has an edge (with
even probability) to each header block.
The result is now reasonable enough that I've added a number of
testcases for irreducible control flow. I've outlined in
`BlockFrequencyInfoImpl.h` ways to improve the approximation.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207286
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 25 Apr 2014 23:00:25 +0000 (23:00 +0000)]
Unbreak the gdb buildbot by not lowering dbg.declare intrinsics for arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207284
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 25 Apr 2014 22:23:54 +0000 (22:23 +0000)]
Make sure that rangelists are also relative to the compile unit
low_pc similar to location lists.
Fixes PR19563
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207283
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 25 Apr 2014 22:22:01 +0000 (22:22 +0000)]
R600: Fix function name printing in LowerCall
v2: Check both ExternalSymbol and GlobalAddress
Patch by: Jan Vesely <jan.vesely@rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207282
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 22:21:35 +0000 (22:21 +0000)]
DwarfAccelTable: Store the string symbol in the accelerator table to avoid duplicate lookup.
This also avoids the need for subtly side-effecting calls to manifest
strings in the string table at the point where items are added to the
accelerator tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207281
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Roeder [Fri, 25 Apr 2014 21:46:51 +0000 (21:46 +0000)]
Add an -mattr option to the gold plugin to support subtarget features in LTO
This adds support for an -mattr option to the gold plugin and to llvm-lto. This
allows the caller to specify details of the subtarget architecture, like +aes,
or +ssse3 on x86. Note that this requires a change to the include/llvm-c/lto.h
interface: it adds a function lto_codegen_set_attr and it increments the
version of the interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207279
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 25 Apr 2014 21:42:35 +0000 (21:42 +0000)]
Fix missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207278
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 21:34:35 +0000 (21:34 +0000)]
Encapsulate the DWARF string pool in a separate type.
Pulls out some more code from some of the rather monolithic DWARF
classes. Unlike the address table, the string table won't move up into
DwarfDebug - each DWARF file has its own string table (but there can be
only one address table).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207277
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 25 Apr 2014 21:30:03 +0000 (21:30 +0000)]
[DWARF parser] Cleanup code in DWARFDebugAranges.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207276
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 25 Apr 2014 21:10:56 +0000 (21:10 +0000)]
[DWARF parser] Cleanup code in DWARFDebugAbbrev.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207274
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 25 Apr 2014 21:02:21 +0000 (21:02 +0000)]
[LoopStrengthReduce] Don't trim formula that uses a subset of required registers
Consider this use from the new testcase:
LSR Use: Kind=ICmpZero, Offsets={0}, widest fixup type: i32
reg({1000,+,-1}<nw><%for.body>)
-3003 + reg({3,+,3}<nw><%for.body>)
-1001 + reg({1,+,1}<nuw><nsw><%for.body>)
-1000 + reg({0,+,1}<nw><%for.body>)
-3000 + reg({0,+,3}<nuw><%for.body>)
reg({-1000,+,1}<nw><%for.body>)
reg({-3000,+,3}<nsw><%for.body>)
This is the last use we consider for a solution in SolveRecurse, so CurRegs is
a large set. (CurRegs is the set of registers that are needed by the
previously visited uses in the in-progress solution.)
ReqRegs is {
{3,+,3}<nw><%for.body>,
{1,+,1}<nuw><nsw><%for.body>
}
This is the intersection of the regs used by any of the formulas for the
current use and CurRegs.
Now, the code requires a formula to contain *all* these regs (the comment is
simply wrong), otherwise the formula is immediately disqualified. Obviously,
no formula for this use contains two regs so they will all get disqualified.
The fix modifies the check to allow the formula in this case. The idea is
that neither of these formulae is introducing any new registers which is the
point of this early pruning as far as I understand.
In terms of set arithmetic, we now allow formulas whose used regs are a subset
of the required regs not just the other way around.
There are few more loops in the test-suite that are now successfully LSRed. I
have benchmarked those and found very minimal change.
Fixes <rdar://problem/
13965777>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207271
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 20:52:08 +0000 (20:52 +0000)]
SCC: Use the reference typedef
Actually use the `reference` typedef, and remove the private
redefinition of `pointer` since it has no users.
Using `reference` exposes a problem with r207257, which specified the
wrong `value_type` to `iterator_facade_base` (fixed that too).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207270
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 25 Apr 2014 20:49:25 +0000 (20:49 +0000)]
This reapplies r207235 with an additional bugfixes caught by the msan
buildbot - do not insert debug intrinsics before phi nodes.
Debug info for optimized code: Support variables that are on the stack and
described by DBG_VALUEs during their lifetime.
Previously, when a variable was at a FrameIndex for any part of its
lifetime, this would shadow all other DBG_VALUEs and only a single
fbreg location would be emitted, which in fact is only valid for a small
range and not the entire lexical scope of the variable. The included
dbg-value-const-byref testcase demonstrates this.
This patch fixes this by
Local
- emitting dbg.value intrinsics for allocas that are passed by reference
- dropping all dbg.declares (they are now fully lowered to dbg.values)
SelectionDAG
- renamed constructors for SDDbgValue for better readability.
- fix UserValue::match() to handle indirect values correctly
- not inserting an MMI table entries for dbg.values that describe allocas.
- lowering dbg.values that describe allocas into *indirect* DBG_VALUEs.
CodeGenPrepare
- leaving dbg.values for an alloca were they are (see comment)
Other
- regenerated/updated instcombine.ll testcase and included source
rdar://problem/
16679879
http://reviews.llvm.org/D3374
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207269
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 20:19:11 +0000 (20:19 +0000)]
MCAssembler: Simplify implementation of const variants of getSymbolData by calling one implementation from the other.
Code review feedback by Rafael Espindola on r207124.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207266
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 20:15:16 +0000 (20:15 +0000)]
BugPoint: Fix some memory leaks.
Patch by Kostya Serebryany.
unique_ptr would be nice, but it's a bit too much work for an area I'm
not familiar with, nor invested in, unfortunately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207265
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 20:02:24 +0000 (20:02 +0000)]
DwarfUnit: Remove unused function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207264
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 20:00:34 +0000 (20:00 +0000)]
DIE: Pass ownership of children via std::unique_ptr rather than raw pointer.
This should reduce the chance of memory leaks like those fixed in
r207240.
There's still some unclear ownership of DIEs happening in DwarfDebug.
Pushing unique_ptr and references through more APIs should help expose
the cases where ownership is a bit fuzzy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207263
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 19:33:43 +0000 (19:33 +0000)]
DIEEntry: Refer to the specified DIE via reference rather than pointer.
Makes some more cases (the unit tests, specifically), lexically
compatible with a change to unique_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207261
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 18:52:29 +0000 (18:52 +0000)]
DwarfUnit: return by reference from createAndAddDIE
Since this doesn't return ownership (the DIE has been added to the
specified parent already) nor return null, just return by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207259
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 18:47:04 +0000 (18:47 +0000)]
blockfreq: Further shift logic to LoopData
Move a lot of the loop-related logic that was sprinkled around the code
into `LoopData`.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207258
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 18:43:41 +0000 (18:43 +0000)]
SCC: Provide operator->() through iterator_facade_base
Use the fancy new `iterator_facade_base` to add
`scc_iterator::operator->()`. Remove other definitions where
`iterator_facade_base` does the right thing.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207257
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Fri, 25 Apr 2014 18:36:38 +0000 (18:36 +0000)]
enable fast isel tablegen files for Mips
Reviewers: dsanders
Reviewed By: dsanders
Differential Revision: http://reviews.llvm.org/D3498
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207256
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 18:35:57 +0000 (18:35 +0000)]
Return DIE by reference instead of pointer from DwarfUnit::getUnitDie
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207255
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 18:26:45 +0000 (18:26 +0000)]
SCC: Remove non-const operator*()
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207254
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 18:26:14 +0000 (18:26 +0000)]
DwarfUnit: Suddently, DIE references, everywhere.
This'll make changing to unique_ptr ownership of DIEs easier since the
usages will now have '*' on them making them textually compatible
between unique_ptr and raw pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207253
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 18:24:50 +0000 (18:24 +0000)]
SCC: Change clients to use const, NFC
It's fishy to be changing the `std::vector<>` owned by the iterator, and
no one actual does it, so I'm going to remove the ability in a
subsequent commit. First, update the users.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207252
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 18:18:46 +0000 (18:18 +0000)]
SCC: Doxygen-ize comments, NFC
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207251
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 25 Apr 2014 18:18:09 +0000 (18:18 +0000)]
Revert "This reapplies r207130 with an additional testcase+and a missing check for"
This reverts commit 207235 to investigate msan buildbot breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207250
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 18:15:50 +0000 (18:15 +0000)]
SCC: Un-inline long functions
These are long functions that really shouldn't be inlined. Otherwise,
no functionality change.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207249
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 18:10:23 +0000 (18:10 +0000)]
SCC: Remove redundant inline keywords, NFC
Functions declared in line in a class are inlined by default. There's
no reason for the `inline` keyword.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207248
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Fri, 25 Apr 2014 18:05:00 +0000 (18:05 +0000)]
Make sure that DSUB does not duplicate the pattern of DSUBU
Test Plan:
Run test suite to make sure there is no regression.
https://dmz-portal.mips.com/bb/builders/LLVM%20with%2064bit%20and%20delay%20slot%20optimizer%20and%20direct%20object%20emitter/builds/626
Reviewers: dsanders
Reviewed By: dsanders
Differential Revision: http://reviews.llvm.org/D3497
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207247
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 25 Apr 2014 17:51:25 +0000 (17:51 +0000)]
ARM: remove @llvm.arm.sevl
This intrinsic is no longer needed with the new @llvm.arm.hint(i32) intrinsic
which provides a generic, extensible manner for adding hint instructions. This
functionality can now be represented as @llvm.arm.hint(i32 5).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207246
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 25 Apr 2014 17:34:55 +0000 (17:34 +0000)]
[inline cold threshold] Command line argument for inline threshold will
override the default cold threshold.
When we use command line argument to set the inline threshold, the default
cold threshold will not be used. This is in line with how we use
OptSizeThreshold. When we want a higher threshold for all functions, we
do not have to set both inline threshold and cold threshold.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207245
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 17:32:19 +0000 (17:32 +0000)]
Refactor some common logic in DwarfUnit::constructVariableDIE and pass non-null DIE by reference to DbgVariable::setDIE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207244
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 25 Apr 2014 17:24:24 +0000 (17:24 +0000)]
ARM: provide a new generic hint intrinsic
Introduce the llvm.arm.hint(i32) intrinsic that can be used to inject hints into
the instruction stream. This is particularly useful for generating IR from a
compiler where the user may inject an intrinsic (e.g. __yield). These are then
pattern substituted into the correct instruction which already existed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207242
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 17:07:55 +0000 (17:07 +0000)]
PR19554: Fix some memory leaks in DIEHashTest.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207240
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 25 Apr 2014 17:01:04 +0000 (17:01 +0000)]
Reapply r207135 without modifications.
Debug info: Let dbg.values inserted by LowerDbgDeclare inherit the location
of the dbg.value. This gets rid of tons of redundant variable DIEs in
subscopes.
rdar://problem/
14874886, rdar://problem/
16679936
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207236
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 25 Apr 2014 17:01:00 +0000 (17:01 +0000)]
This reapplies r207130 with an additional testcase+and a missing check for
AllocaInst that was missing in one location.
Debug info for optimized code: Support variables that are on the stack and
described by DBG_VALUEs during their lifetime.
Previously, when a variable was at a FrameIndex for any part of its
lifetime, this would shadow all other DBG_VALUEs and only a single
fbreg location would be emitted, which in fact is only valid for a small
range and not the entire lexical scope of the variable. The included
dbg-value-const-byref testcase demonstrates this.
This patch fixes this by
Local
- emitting dbg.value intrinsics for allocas that are passed by reference
- dropping all dbg.declares (they are now fully lowered to dbg.values)
SelectionDAG
- renamed constructors for SDDbgValue for better readability.
- fix UserValue::match() to handle indirect values correctly
- not inserting an MMI table entries for dbg.values that describe allocas.
- lowering dbg.values that describe allocas into *indirect* DBG_VALUEs.
CodeGenPrepare
- leaving dbg.values for an alloca were they are (see comment)
Other
- regenerated/updated instcombine.ll testcase and included source
rdar://problem/
16679879
http://reviews.llvm.org/D3374
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207235
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Fri, 25 Apr 2014 13:43:18 +0000 (13:43 +0000)]
[ARM64] When compiling for ELF in PIC mode, local symbols shouldn't go through the GOT
There's no need for local symbols to go through the GOT, in fact it seems GNU ld is not even emitting GOT entries for local symbols and will error out when trying to resolve a GOT relocation for a local symbol.
This bug triggers when bootstrapping clang on AArch64 Linux with -fPIC and the ARM64 backend. The AArch64 backend is not affected.
With this commit it's now possible to bootstrap clang on AArch64 Linux with the ARM64 backend (-fPIC, -O3).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207226
91177308-0d34-0410-b5e6-
96231b3b80d8
Jiangning Liu [Fri, 25 Apr 2014 12:07:03 +0000 (12:07 +0000)]
[ARM64] Handle fp128 for parameter passing on stack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207222
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 25 Apr 2014 10:48:47 +0000 (10:48 +0000)]
ARM64: fix assertion in ISelDAGToDAG
Also an unused variable, so double bonus!
This should deal with PR19548.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207221
91177308-0d34-0410-b5e6-
96231b3b80d8
Bradley Smith [Fri, 25 Apr 2014 10:25:29 +0000 (10:25 +0000)]
[ARM64] Print preferred aliases for SFBM/UBFM in InstPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207219
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 25 Apr 2014 09:52:44 +0000 (09:52 +0000)]
[LCG] During the incremental update of an SCC, switch to using the
SCCMap to test for nodes that have been re-added to the root SCC rather
than a set vector. We already have done the SCCMap lookup, we juts need
to test it in two different ways. In turn, do most of the processing of
these nodes as they go into the root SCC rather than lazily. This
simplifies the final loop to just stitch the root SCC into its
children's parent sets. No functionlatiy changed.
However, this makes a few things painfully obvious, which was my intent.
=] There is tons of repeated code introduced here and elsewhere. I'm
splitting the refactoring of that code into helpers from this change so
its clear that this is the change which switches the datastructures used
around, and the other is a pure factoring & deduplication of code
change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207217
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Fri, 25 Apr 2014 09:44:20 +0000 (09:44 +0000)]
[ARM64] Add RUN lines for "–target arm64 –mattr=-fp-armv8" on AArch64 no-fp test.
This patch is a supplement of implementing predicate of FP, enabling aarch64 backend
no-fp tests on arm64 target for verification. During this, one bug is exposed and
fixed by this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207215
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Fri, 25 Apr 2014 09:25:42 +0000 (09:25 +0000)]
[ARM64] Support crc predicate on ARM64.
According to the specification, CRC is an optional extension of the
architecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207214
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 25 Apr 2014 09:08:10 +0000 (09:08 +0000)]
[LCG] During the incremental re-build of an SCC after removing an edge,
remove the nodes in the SCC from the SCC map entirely prior to the DFS
walk. This allows the SCC map to represent both the state of
not-yet-re-added-to-an-SCC and added-back-to-this-SCC independently. The
first is being missing from the SCC map, the second is mapping back to
'this'. In a subsequent commit, I'm going to use this property to
simplify the new node list for this SCC.
In theory, I think this also makes the contract for orphaning a node
from the graph slightly less confusing. Now it is also orphaned from the
SCC graph. Still, this isn't quite right either, and so I'm not adding
test cases here. I'll add test cases for the behavior of orphaning nodes
when the code *actually* supports it. The change here is mostly
incidental, my goal is simplifying the algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207213
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 25 Apr 2014 09:08:05 +0000 (09:08 +0000)]
[LCG] Rather than doing a linear time SmallSetVector removal of each
child from the worklist, wait until we actually need to pop another
element off of the worklist and skip over any that were already visited
by the DFS. This also enables swapping the nodes of the SCC into the
worklist. No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207212
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 25 Apr 2014 06:45:06 +0000 (06:45 +0000)]
[LCG] Remove a completely unnecessary loop. It wasn't even doing any
thing, just mucking up the code. I feel bad that I even wrote this loop.
Very sorry. The diff is huge because of the indent change, but I promise
all this is doing is realizing that the outer two loops were actually
the exact same loops, and we didn't need two of them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207202
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 25 Apr 2014 06:38:58 +0000 (06:38 +0000)]
[LCG] Now that the loop structure of the core SCC finding routine is
factored into a more reasonable form, replace the tail call with
a simple outer-loop continuation. It's sad that C++ makes this so
awkward to write, but it seems more direct and clear than the tail call
at this point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207201
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 25 Apr 2014 06:29:36 +0000 (06:29 +0000)]
X86: convert object streamer selection to a switch
Change the object streamer selection to a switch from a series of if conditions.
Rather than defaulting to ELF, require that an ELF format is requested. The
Windows/!ELF is maintained as MachO would have been selected first and will
still provide a MachO format. Add an assertion that if COFF is requested that
the target platform is Windows as only WinCOFF object emission is currently
supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207200
91177308-0d34-0410-b5e6-
96231b3b80d8
Anders Waldenborg [Fri, 25 Apr 2014 06:25:15 +0000 (06:25 +0000)]
[python] Fix getting section contents.
The returnvalue was handled as c_char_p which ment that ctypes
handled it as a NUL-terminated string making it cut the contents
at first NUL (or even worse - overrunning the buffer if it doesn't
contain a NUL).
Differential Revision: http://reviews.llvm.org/D3474
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207199
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 25 Apr 2014 06:22:32 +0000 (06:22 +0000)]
Add missing cpp file header
Code review feedback from Paul Robinson on r207022
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207198
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 25 Apr 2014 05:30:21 +0000 (05:30 +0000)]
[C++] Use 'nullptr'. Target edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207197
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 25 Apr 2014 05:29:35 +0000 (05:29 +0000)]
[C++] Use 'nullptr'. Transforms edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207196
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:43 +0000 (04:38 +0000)]
blockfreq: Only one mass distribution per node
Remove the concepts of "forward" and "general" mass distributions, which
was wrong. The split might have made sense in an early version of the
algorithm, but it's definitely wrong now.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207195
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:40 +0000 (04:38 +0000)]
blockfreq: Document assertion
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207194
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:37 +0000 (04:38 +0000)]
blockfreq: Use better branch weights in multiexit test
The branch weights were even before. Make them different.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207193
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:35 +0000 (04:38 +0000)]
blockfreq: Clean up irreducible testcases
Strip irreducible testcases to pure control flow. The function calls
made the branch weights more believable but cluttered it up a lot.
There isn't going to be any constant analysis here, so just use dumb
branch logic to clarify the important parts.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207192
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:32 +0000 (04:38 +0000)]
blockfreq: Document high-level functions
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207191
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:30 +0000 (04:38 +0000)]
blockfreq: Remove dead code
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207190
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:27 +0000 (04:38 +0000)]
blockfreq: Scale LoopData::Scale on the way down
Rather than scaling loop headers and then scaling all the loop members
by the header frequency, scale `LoopData::Scale` itself, and scale the
loop members by it. It's much more obvious what's going on this way,
and doesn't cost any extra multiplies.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207189
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:25 +0000 (04:38 +0000)]
blockfreq: unwrapLoopPackage() => unwrapLoop()
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207188
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:23 +0000 (04:38 +0000)]
blockfreq: Pass the Loop directly into unwrapLoopPackage()
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207187
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:20 +0000 (04:38 +0000)]
blockfreq: Unwrap from Loops
When unwrapping loops, just visit the loops rather than all nodes.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207186
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:17 +0000 (04:38 +0000)]
blockfreq: Separate unwrapLoops() from finalizeMetrics()
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207185
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:15 +0000 (04:38 +0000)]
blockfreq: LoopData::MemberList => NodeList
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207184
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:12 +0000 (04:38 +0000)]
blockfreq: Expose getPackagedNode()
Make `getPackagedNode()` a member function of
`BlockFrequencyInfoImplBase` so that it's available for templated code.
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207183
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 25 Apr 2014 04:38:09 +0000 (04:38 +0000)]
blockfreq: Store the header with the members
<rdar://problem/
14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207182
91177308-0d34-0410-b5e6-
96231b3b80d8