Craig Topper [Thu, 11 Dec 2014 07:04:52 +0000 (07:04 +0000)]
Just use the Module unique_ptr object directly in many places instead of separate pointer that's kept in sync with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224004
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 11 Dec 2014 07:04:46 +0000 (07:04 +0000)]
Use unique_ptr to remove an explicit delete. Change return type to pass the unique_ptr to caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224003
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 06:32:29 +0000 (06:32 +0000)]
IR: Canonicalize metadata formatting, NFC
Canonicalize formatting of metadata to make it easier to upgrade via
scripts -- in particular, one line per metadata definition makes it more
`sed`-able.
This is preparation for changing the assembly syntax for metadata [1].
[1]: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20141208/248449.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224002
91177308-0d34-0410-b5e6-
96231b3b80d8
Ekaterina Romanova [Thu, 11 Dec 2014 06:22:35 +0000 (06:22 +0000)]
Reverting commit 223981, because the test that I added (incorrect-variable-debugloc1.ll) failed for llvm-ppc64.
The test is failing for llvm-ppc64 because for this platform the location list is not being generated at all (most likely because of the bug in PPC code optimization or generation). I will file a bug agains PPC compiler, but meanwhile, until PPC bug is fixed, I will have to revert my change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224000
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 11 Dec 2014 05:25:33 +0000 (05:25 +0000)]
Make MultiClass::DefPrototypes own their Records to fix memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223998
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 11 Dec 2014 05:25:30 +0000 (05:25 +0000)]
Replace std::map<K, V*> with std::map<K, std::unique_ptr<V>> to handle ownership and deletion of the values.
Ideally we would store the MultiClasses by value directly in the maps, but I had some trouble with that before and this at least fixes the leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223997
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Thu, 11 Dec 2014 04:32:17 +0000 (04:32 +0000)]
[X86] Add back AVX2 VR256 PMOVX patterns.
We can't reach those from zext, but other parts of the backend (the shuffle
lowering) generate 256-bit VZEXT nodes.
Fixes PR21876.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223996
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 11 Dec 2014 02:10:28 +0000 (02:10 +0000)]
Fix LLVMContext to match what MDKind names that the LL parser permits. Fixes PR21799!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223995
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 11 Dec 2014 01:47:23 +0000 (01:47 +0000)]
GCStrategy should not own GCFunctionInfo
This change moves the ownership and access of GCFunctionInfo (the object which describes the safepoints associated with a safepoint under GCRoot) to GCModuleInfo. Previously, this was owned by GCStrategy which was in turned owned by GCModuleInfo. This made GCStrategy module specific which is 'surprising' given it's name and other purposes.
There's a few more changes needed, but we're getting towards the point we can reuse GCStrategy for gc.statepoint as well.
p.s. The style of this code ends up being a mess. I was trying to move code around without otherwise changing much. Once I get the ownership structure rearranged, I will go through and fixup spacing, naming, comments etc.
Differential Revision: http://reviews.llvm.org/D6587
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223994
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 01:34:46 +0000 (01:34 +0000)]
IR: Add 'invalid-' to test names for invalid assembly
Take the opportunity to sort these by `metadata`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223993
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 11 Dec 2014 00:59:06 +0000 (00:59 +0000)]
LiveInterval: Use range based for loops for subregister ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223991
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 11 Dec 2014 00:52:59 +0000 (00:52 +0000)]
Try again at sorting entries in CODE_OWNERS
I apparently fail at the alphabet, E is not after G, and G isn't even
close to C. Sorry for the noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223990
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 11 Dec 2014 00:41:15 +0000 (00:41 +0000)]
Fix some incorrectly sorted entries in CODE_OWNERS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223989
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 11 Dec 2014 00:37:25 +0000 (00:37 +0000)]
Add code owners for profiling and coverage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223988
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 10 Dec 2014 23:40:50 +0000 (23:40 +0000)]
ARM: correctly expand LDR-lit based globals.
Quite a major error here: the expansions for the Pseudos with and without
folded load were mixed up. Fortunately it only affects ARM-mode, when not using
movw/movt, on Darwin. I'm guessing no-one actually uses that combination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223986
91177308-0d34-0410-b5e6-
96231b3b80d8
Ekaterina Romanova [Wed, 10 Dec 2014 23:19:56 +0000 (23:19 +0000)]
A fix for PR21176.
DW_OP_const <const> doesn't describe a constant value, but a value at a constant address.
The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value.
Added DW_OP_stack_value to the stack.
-This line, and those below, will be ignored--
M lib/CodeGen/AsmPrinter/DwarfDebug.cpp
A test/DebugInfo/incorrect-variable-debugloc1.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223981
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 23:07:54 +0000 (23:07 +0000)]
LiveInterval: Use more range based for loops for value numbers and segments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223978
91177308-0d34-0410-b5e6-
96231b3b80d8
Mark Heffernan [Wed, 10 Dec 2014 22:53:52 +0000 (22:53 +0000)]
Fix PR21694. r219517 added a use of SCEV divide in HowFarToZero computation. This divide can produce incorrect results as we are using an unsigned divide for what should be a modular divide. This change reverts back to a more conservative computation using trailing zeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223974
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 10 Dec 2014 22:23:07 +0000 (22:23 +0000)]
[Hexagon] Adding combine ri/ir instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223971
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 21:58:17 +0000 (21:58 +0000)]
ConstantFold: Clean up X * undef code
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223970
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 21:58:15 +0000 (21:58 +0000)]
ConstantFold, InstSimplify: undef >>a x can be either -1 or 0, choose 0
Zero is usually a nicer constant to have than -1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223969
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 21:38:05 +0000 (21:38 +0000)]
ConstantFold: an undef shift amount results in undef
X shifted by undef results in undef because the undef value can
represent values greater than the width of the operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223968
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 10 Dec 2014 21:24:10 +0000 (21:24 +0000)]
[Hexagon] Adding encodings for JR class instructions. Updating complier usages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223967
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 10 Dec 2014 20:46:55 +0000 (20:46 +0000)]
Move three methods only used by MCJIT to MCJIT.
These methods are only used by MCJIT and are very specific to it. In fact, they
are also fairly specific to the fact that we have a dynamic linker of
relocatable objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223964
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Wed, 10 Dec 2014 19:43:32 +0000 (19:43 +0000)]
[AArch64] MachO large code-model: Materialize FP constants in code.
In the large code model we have to first get the address of the GOT entry, load
the address of the constant, and then load the constant itself.
To avoid these loads and the GOT entry alltogether this commit changes the way
how FP constants are materialized in the large code model. The constats are now
materialized in a GPR and then bitconverted/moved into the FPR.
Reviewed by Tim Northover
Fixes rdar://problem/
16572564.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223941
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Wed, 10 Dec 2014 19:25:31 +0000 (19:25 +0000)]
R600/SI: Use getTargetConstant in AdjustRegClass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223940
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 10 Dec 2014 18:24:16 +0000 (18:24 +0000)]
[Hexagon] Adding JR class predicated call reg instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223933
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Wed, 10 Dec 2014 17:42:01 +0000 (17:42 +0000)]
Added documentation for MergeFunctions pass:
Pass looks for equivalent functions that are mergable and folds them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223931
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 10 Dec 2014 16:58:54 +0000 (16:58 +0000)]
Match new shuffle codegen for MOVHPD patterns
Add patterns to match SSE (shufpd) and AVX (vpermilpd) shuffle codegen
when storing the high element of a v2f64. The existing patterns were
only checking for an unpckh type of shuffle.
http://llvm.org/bugs/show_bug.cgi?id=21791
Differential Revision: http://reviews.llvm.org/D6586
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223929
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 10 Dec 2014 14:14:54 +0000 (14:14 +0000)]
Silencing a -Wsequence-point warning, and the resulting undefined behavior. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223926
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 09:14:55 +0000 (09:14 +0000)]
ConstantFold: div undef, 0 should fold to undef, not zero
Dividing by zero yields an undefined value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223924
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 09:14:52 +0000 (09:14 +0000)]
InstSimplify: [al]shr exact undef, %X -> undef
Exact shifts always keep the non-zero bits of their input. This means
it keeps it's undef bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223923
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 10 Dec 2014 08:46:12 +0000 (08:46 +0000)]
[X86] Make a code path in EltsFromConsecutiveLoads work only on vectors it expects
EltsFromConsecutiveLoads was apparently only ever called for 128-bit vectors, and assumed this implicitly. r223518 started calling it for AVX-sized vectors, causing the code path that had this assumption to crash.
This adds a check to make this path fire only for 128-bit vectors.
Differential Revision: http://reviews.llvm.org/D6579
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223922
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 07:52:18 +0000 (07:52 +0000)]
InstSimplify: div %X, 0 -> undef
We already optimized rem %X, 0 to undef, we should do the same for div.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223919
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 10 Dec 2014 06:18:57 +0000 (06:18 +0000)]
Use unique_ptr instead of DeleteContainerSeconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223918
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Fiselier [Wed, 10 Dec 2014 03:42:09 +0000 (03:42 +0000)]
[LIT] Add support for `UNSUPPORTED` tag to `TestRunner.parseIntegratedTestScript`
Summary:
This patch gives me just enough to leverage the existing functionality in `TestRunner` for use in `libc++` and `libc++abi` .
It does the following:
* Adds the `UNSUPPORTED` tag to `TestRunner.parseIntegratedTestScript`.
* Allows `parseIntegratedTestScript` to return an empty script if a script is not required by the caller.
Reviewers: ddunbar, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits, llvm-commits
Differential Revision: http://reviews.llvm.org/D6589
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223915
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 02:36:41 +0000 (02:36 +0000)]
DataLayout: Provide nicer diagnostics for malformed strings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223911
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 02:10:35 +0000 (02:10 +0000)]
AsmParser: Don't allow null bytes in BB labels
Since Value objects can't have null bytes in their name, we shouldn't
allow them in the labels of basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223907
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 10 Dec 2014 01:45:04 +0000 (01:45 +0000)]
IR: Move call to dropAllReferences() to MDNode subclasses
Don't call `dropAllReferences()` from `MDNode::~MDNode()`, call it
directly from `~MDNodeFwdDecl()` and `~GenericMDNode()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223904
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 01:38:28 +0000 (01:38 +0000)]
DataLayout: Be more verbose when diagnosing problems in pointer specs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223903
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 01:17:48 +0000 (01:17 +0000)]
I didn't intend to commit this with r223898
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223899
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 01:17:08 +0000 (01:17 +0000)]
DataLayout: Move asserts over to report_fatal_error
As indicated by the tests, it is possible to feed the AsmParser an
invalid datalayout string. We should verify the result of parsing this
string regardless of whether or not we have assertions enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223898
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:13:13 +0000 (01:13 +0000)]
MachineVerifier: Allow physreg use if just a subreg is defined.
We can't mark partially undefined registers, so we have to allow reading
a register in the machine verifier if just parts of a register are
defined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223896
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:13:11 +0000 (01:13 +0000)]
MachineVerifier: Allow LiveInterval segments to end at a partial write.
In the subregister liveness tracking case we do not create implicit
reads on partial register writes anymore, still we need to produce a new
SSA value for partial writes so the live segment has to end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223895
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:13:08 +0000 (01:13 +0000)]
VirtRegMap: Improve block live-in info if subregister liveness is available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223894
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:13:06 +0000 (01:13 +0000)]
MCRegisterInfo: Add MCSubRegIndexIterator.
This iterator iterates over subregister and their associated subregister indices
at the same time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223893
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:13:04 +0000 (01:13 +0000)]
VirtRegMap: No implicit defs/uses for super registers with subreg liveness tracking.
Adding the implicit defs/uses to the superregisters is semantically questionable
but was not dangerous before as the register allocator never assigned the same
register to two overlapping LiveIntervals even when the actually live
subregisters do not overlap. With subregister liveness tracking enabled this
does actually happen and leads to subsequent bugs if we don't stop adding
the superregister defs/uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223892
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:13:01 +0000 (01:13 +0000)]
LiveRegMatrix: Respect subregister liveness when allocating registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223891
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:59 +0000 (01:12 +0000)]
LiveIntervalUnion: Allow specification of liverange when unifying/extracting.
This allows it to add subregister ranges into the union.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223890
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:56 +0000 (01:12 +0000)]
Tablegen'erate lanemasks for register units.
Now we can relate lanemasks in a virtual register to register units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223889
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:52 +0000 (01:12 +0000)]
RegisterCoalescer: Preserve subregister liveranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223888
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:40 +0000 (01:12 +0000)]
LiveInterval: Add removeEmptySubRanges().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223887
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:36 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Add subregister aware variants pruneValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223886
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:33 +0000 (01:12 +0000)]
LiveInterval: Introduce LiveQuery accessor for dead or live out values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223885
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:30 +0000 (01:12 +0000)]
Add a flag to enable/disable subregister liveness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223884
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:26 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Adapt repairIntervalsInRange() to subregister liveness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223883
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:23 +0000 (01:12 +0000)]
LiveRangeEdit: Adapt eliminateDeadDef() to subregister liveness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223882
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:20 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Adapt handleMove() to subregister ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223881
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:18 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Update SubRanges in shrinkToUses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223880
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:15 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Make computeDeadValues() private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223879
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:12 +0000 (01:12 +0000)]
LiveIntervalAnalysis: Compute subregister ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223878
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:10 +0000 (01:12 +0000)]
LiveInterval: Add support to track liveness of subregisters.
This code adds the required data structures. Algorithms to compute it follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223877
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:06 +0000 (01:12 +0000)]
LiveInterval: Add a 'covers' operation to LiveRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223876
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:02 +0000 (01:12 +0000)]
LiveInterval: Add const version of LiveRange::advanceTo().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223875
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:12:00 +0000 (01:12 +0000)]
Add function that translates subregister lane masks to other subregs.
This works like the composeSubRegisterIndices() function but transforms
a subregister lane mask instead of a subregister index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223874
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 10 Dec 2014 01:11:56 +0000 (01:11 +0000)]
Let tablegen compute maximum lanemask for regs/regclasses.
Let tablegen compute the combination of subregister lanemasks for all
subregisters in a register/register class. This is preparation for further
work subregister allocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223873
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 10 Dec 2014 00:43:17 +0000 (00:43 +0000)]
AsmParser: Don't crash if a null byte is inside a quoted string
We don't allow Value* to have names which contain null bytes. The
AsmParser should reject .ll files that try to do this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223869
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Wed, 10 Dec 2014 00:30:11 +0000 (00:30 +0000)]
Extend some comments around GCModuleInfo, GCFunctionInfo, & GCStrategy
Nothing particularly interesting here, just documenting the way the code currently works before I start changing it...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223866
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Wed, 10 Dec 2014 00:10:21 +0000 (00:10 +0000)]
cmake: Make SVNVersion.inc work on Windows if svn is called svn.bat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223864
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 10 Dec 2014 00:09:35 +0000 (00:09 +0000)]
Simplify the handling of aliases in the gold plugin.
The complicated situation is when we have to keep an alias but drop a GV
that is part of the aliasee.
We used to clone the dropped GV and make the clone internal. This is wasteful
as we know the original will be dropped.
With this patch what is done instead is set the linkage of the original to
internal and replace all uses (but the one in the alias) with a new
declaration that takes the name of the old GV. This saves us from having
to copy the body.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223863
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Wed, 10 Dec 2014 00:07:37 +0000 (00:07 +0000)]
[ARM] Combine base-updating/post-incrementing vector load/stores.
We used to only combine intrinsics, and turn them into VLD1_UPD/VST1_UPD
when the base pointer is incremented after the load/store.
We can do the same thing for generic load/stores.
Note that we can only combine the first load/store+adds pair in
a sequence (as might be generated for a v16f32 load for instance),
because other combines turn the base pointer addition chain (each
computing the address of the next load, from the address of the last
load) into independent additions (common base pointer + this load's
offset).
Differential Revision: http://reviews.llvm.org/D6585
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223862
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 9 Dec 2014 23:57:54 +0000 (23:57 +0000)]
Remove the Module pointer from GCStrategy and GCMetadataPrinter
In the current implementation, GCStrategy is a part of the ownership structure for the gc metadata which describes a Module. It also contains a reference to the module in question. As a result, GCStrategy instances are essentially Module specific.
I plan to transition away from this design. Instead, a GCStrategy will be owned by the LLVMContext. It will be a lightweight policy object which contains no information about the Modules or Functions involved, but can be easily reached given a Function.
The first step in this transition is to remove the direct Module reference from GCStrategy. This also requires removing the single user of this reference, the GCMetadataPrinter hierarchy. In theory, this will allow the lifetime of the printers to be scoped to the LLVMContext as well, but in practice, I'm not actually changing that. (Yet?)
An alternate design would have been to move the direct Module reference into the GCMetadataPrinter and change the keying of the owning maps to explicitly key off both GCStrategy and Module. I'm open to doing it that way instead, but didn't see much value in preserving the per Module association for GCMetadataPrinters.
The next change in this sequence will be to start unwinding the intertwined ownership between GCStrategy, GCModuleInfo, and GCFunctionInfo.
Differential Revision: http://reviews.llvm.org/D6566
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223859
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 23:56:39 +0000 (23:56 +0000)]
IR: Fix memory corruption in MDNode new/delete
There were two major problems with `MDNode` memory management.
1. `MDNode::operator new()` called a placement array constructor for
`MDOperand`. What? Each operand needs to be placed individually.
2. `MDNode::operator delete()` failed to destruct the `MDOperand`s at
all.
Frankly it's hard to understand how this worked locally, how this
survived an LTO bootstrap, or how it worked on most of the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223858
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Dec 2014 23:51:14 +0000 (23:51 +0000)]
Forgot to add test for r223856
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223857
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Dec 2014 23:50:38 +0000 (23:50 +0000)]
AsmParser: Verifier that the contents of a hex integer are hex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223856
91177308-0d34-0410-b5e6-
96231b3b80d8
Kaelyn Takata [Tue, 9 Dec 2014 23:32:46 +0000 (23:32 +0000)]
Rename static functiom "map" to be more descriptive and to avoid
potential confusion with the std::map type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223853
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 23:04:59 +0000 (23:04 +0000)]
IR: Metadata: Detect an RAUW recursion
Speculatively handle a recursion in
`GenericMDNode::handleChangedOperand()`. I'm hoping this fixes the
failing hexagon bot [1].
[1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/13434
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223849
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Tue, 9 Dec 2014 22:45:07 +0000 (22:45 +0000)]
Remove redundant variable.
Tested by adding assert(LoopVectorPreHeader == VecPreheader) on LLVM
test suite and SPECs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223847
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 9 Dec 2014 22:33:26 +0000 (22:33 +0000)]
[Hexagon] [NFC] Cleaning up unused classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223845
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 9 Dec 2014 22:08:57 +0000 (22:08 +0000)]
[ARM] Make testcase more explicit. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223841
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 9 Dec 2014 21:30:00 +0000 (21:30 +0000)]
[ARM] Factor out base-updating VLD/VST combiner function. NFC.
Move the combiner-state check into another function, add a few
small comments, and use a more general type in a cast<>.
In preparation for a future patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223834
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 9 Dec 2014 21:26:53 +0000 (21:26 +0000)]
[ARM] Move the store combiner function down. NFC.
And flip its final condition.
In preparation for a future patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223833
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 9 Dec 2014 21:25:00 +0000 (21:25 +0000)]
[ARM] Also support v2f64 vld1/vst1.
It was missing from the VLD1/VST1 handling logic, even though the
corresponding instructions exist (same form as v2i64).
In preparation for a future patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223832
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 21:12:56 +0000 (21:12 +0000)]
IR: Metadata/Value split: RAUW in a deterministic order
RAUW in a deterministic order to try to recover the hexagon bot [1],
whose tests started failing once my GCC fixes were in for r223802.
Otherwise, I'm not sure why tests would fail there and not here.
[1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/13426
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223829
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 9 Dec 2014 21:05:36 +0000 (21:05 +0000)]
Return ErrorOr<std::unique_ptr<Archive>> form getAsArchive.
This is the same return type of Archive::create.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223827
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 9 Dec 2014 20:39:15 +0000 (20:39 +0000)]
Try fixing MSVC build after r223802
LLVM_EXPLICIT is only supported by recent version of MSVC, and it seems
the not-so-recent versions get confused about the operator bool() when
tryint to resolve operator== calls.
This removed the operator bool()'s since they don't seem to be used
anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223824
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 9 Dec 2014 20:36:53 +0000 (20:36 +0000)]
[Hexagon] Fixing broken tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223823
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 9 Dec 2014 20:36:13 +0000 (20:36 +0000)]
Rename createIRObjectFile to just create.
It is a static method of IRObjectFile, so having to use
IRObjectFile::createIRObjectFile was redundant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223822
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 9 Dec 2014 20:23:30 +0000 (20:23 +0000)]
[Hexagon] Updating rr/ri 32/64 transfer encodings and adding tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223821
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 20:01:40 +0000 (20:01 +0000)]
Fix an MSVC failure from r223802
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223820
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 9 Dec 2014 19:44:38 +0000 (19:44 +0000)]
[FastISel][AArch64] Fix a missing nullptr check in 'computeAddress'.
The load/store value type is currently not available when lowering the memcpy
intrinsic. Add the missing nullptr check to support this in 'computeAddress'.
Fixes rdar://problem/
19178947.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223818
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 9 Dec 2014 19:23:45 +0000 (19:23 +0000)]
[Hexagon] Adding word combine dot-new form and replacing old combine opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223815
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 9 Dec 2014 19:21:16 +0000 (19:21 +0000)]
Revert r223764 which taught instcombine about integer-based elment extraction
patterns.
This is causing Clang to miscompile itself for 32-bit x86 somehow, and likely
also on ARM and PPC. I really don't know how, but reverting now that I've
confirmed this is actually the culprit. I have a reproduction as well and so
should be able to restore this shortly.
This reverts commit r223764.
Original commit log follows:
Teach instcombine to canonicalize "element extraction" from a load of an
integer and "element insertion" into a store of an integer into actual
element extraction, element insertion, and vector loads and stores.
Previously various parts of LLVM (including instcombine itself) would
introduce integer loads and stores into the code as a way of opaquely
loading and storing "bits". In some cases (such as a memcpy of
std::complex<float> object) we will eventually end up using those bits
in non-integer types. In order for SROA to effectively promote the
allocas involved, it splits these "store a bag of bits" integer loads
and stores up into the constituent parts. However, for non-alloca loads
and tsores which remain, it uses integer math to recombine the values
into a large integer to load or store.
All of this would be "fine", except that it forces LLVM to go through
integer math to combine and split up values. While this makes perfect
sense for integers (and in fact is critical for bitfields to end up
lowering efficiently) it is *terrible* for non-integer types, especially
floating point types. We have a much more canonical way of representing
the act of concatenating the bits of two SSA values in LLVM: a vector
and insertelement. This patch teaching InstCombine to use this
representation.
With this patch applied, LLVM will no longer introduce integer math into
the critical path of every loop over std::complex<float> operations such
as those that make up the hot path of ... oh, most HPC code, Eigen, and
any other heavy linear algebra library.
For the record, I looked *extensively* at fixing this in other parts of
the compiler, but it just doesn't work:
- We really do want to canonicalize memcpy and other bit-motion to
integer loads and stores. SSA values are tremendously more powerful
than "copy" intrinsics. Not doing this regresses massive amounts of
LLVM's scalar optimizer.
- We really do need to split up integer loads and stores of this form in
SROA or every memcpy of a trivially copyable struct will prevent SSA
formation of the members of that struct. It essentially turns off
SROA.
- The closest alternative is to actually split the loads and stores when
partitioning with SROA, but this has all of the downsides historically
discussed of splitting up loads and stores -- the wide-store
information is fundamentally lost. We would also see performance
regressions for bitfield-heavy code and other places where the
integers aren't really intended to be split without seemingly
arbitrary logic to treat integers totally differently.
- We *can* effectively fix this in instcombine, so it isn't that hard of
a choice to make IMO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223813
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Dec 2014 19:10:03 +0000 (19:10 +0000)]
AsmParser: Don't crash on short hex constants for fp128 types
If we see 0xL01, treat it like 0xL00000000000000000000000000000001
instead of crashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223811
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 18:59:09 +0000 (18:59 +0000)]
Fix another GCC build failure from r223802
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223810
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 9 Dec 2014 18:57:39 +0000 (18:57 +0000)]
Remove unneeded curly braces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223809
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 9 Dec 2014 18:57:34 +0000 (18:57 +0000)]
Reorder the code to avoid inserting at the beginning of a vector.
As per dblaikie suggestion, thanks\!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223808
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 9 Dec 2014 18:56:35 +0000 (18:56 +0000)]
Cleanup PatternMatch. NFC.
Tidy up the code a little by using 'auto' when the type is obvious, doxify the
comments, and clang-format the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223807
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 18:52:38 +0000 (18:52 +0000)]
Fix a GCC build failure from r223802
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223806
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 9 Dec 2014 18:49:55 +0000 (18:49 +0000)]
Adding a new option to CMake to disable C++ atexit on llvm-shlib.
Summary:
This is desirable for WebKit and other clients of the llvm-shlib because C++ exit time destructors have a tendency to crash when invoked from multi-threaded applications.
Ideally this option will be temporary, because the ideal fix is to just not have exit time destructors.
Reviewers: chapuni, ributzka
Reviewed By: ributzka
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6572
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223805
91177308-0d34-0410-b5e6-
96231b3b80d8