Commit Graph

190919 Commits

Author SHA1 Message Date
Alexander Kornienko 9115a3af02 [clang-tidy] Make ClangTidyOptionsProvider::getOptions return by value.
Returning by reference limits possible implementations and doesn't bring any
benefits as all callers make copies of the returned value anyway.

llvm-svn: 226553
2015-01-20 09:48:51 +00:00
Pavel Labath bb917683b6 Test commit, no changes.
llvm-svn: 226552
2015-01-20 09:47:57 +00:00
Daniel Jasper d106b734cf Factor out a splitSwitchCase() function so that it can be reused.
This is in preparation for a fix to llvm.org/PR22262. One of the ideas
here is to first find a good jump table range first and then split
before and after it. Thereby, we don't need to use the
split-based-on-density heuristic at all, which can make the "binary
tree" deteriorate in various cases.

Also some minor cleanups.

No functional changes.

llvm-svn: 226551
2015-01-20 08:57:44 +00:00
Chandler Carruth 5175b9a7b9 [PM] Move the LoopInfo analysis pointer into the InstCombiner class
along with the other analyses.

The most obvious reason why is because eventually I need to separate out
the pass layer from the rest of the instcombiner. However, it is also
probably a compile time win as every query through the pass manager
layer is pretty slow these days.

llvm-svn: 226550
2015-01-20 08:35:24 +00:00
Alexey Bataev 42971a3342 [OPENMP] Fixed DSA processing for predetermined shared variables.
This patch allows to use predetermined shared variables in private clauses in
parallel or tasks regions.

llvm-svn: 226549
2015-01-20 07:03:46 +00:00
Sameer Sahasrabuddhe 450a58b8af Introduce SPIR calling conventions.
This implements Section 3.7 from the SPIR 1.2 spec:

    SPIR kernels should use "spir_kernel" calling convention.
    Non-kernel functions use "spir_func" calling convention. All
    other calling conventions are disallowed.

The patch works only for OpenCL source. Any other uses will need
to ensure that kernels are assigned the spir_kernel calling
convention correctly.

llvm-svn: 226548
2015-01-20 06:44:32 +00:00
Karthik Bhat 0b0f4660fa Fix Operandreorder logic in SLPVectorizer to generate longer vectorizable chain.
This patch fixes 2 issues in reorderInputsAccordingToOpcode
1) AllSameOpcodeLeft and AllSameOpcodeRight was being calculated incorrectly resulting in code not being vectorized in few cases.
2) Adds logic to reorder operands if we get longer chain of consecutive loads enabling vectorization. Handled the same for cases were we have AltOpcode.
Thanks Michael for inputs and review.
Review: http://reviews.llvm.org/D6677

llvm-svn: 226547
2015-01-20 06:11:00 +00:00
David Majnemer 3087b22e1a Bitcode: Don't create comdats when autoupgrading macho bitcode
Don't infer COMDAT groups from older bitcode if the target is macho,
it doesn't have COMDATs.

llvm-svn: 226546
2015-01-20 05:58:07 +00:00
Duncan P. N. Exon Smith aa687a3d4c Reapply "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
This reverts commit r226542, effectively reapplying r226540.  This time,
initialize `IsEmpty` in the copy and move constructors as well.

llvm-svn: 226545
2015-01-20 05:02:42 +00:00
Jason Molenda 3bc66f1f47 Fix creation of StringRef in FileSpec::ResolveUsername()
so it doesn't assume that the SmallVector<char> will have
nul terminator.  It did not in at least one case.
Caught by ASAN instrumentation.

llvm-svn: 226544
2015-01-20 04:20:42 +00:00
Jason Molenda 65e0642d03 Don't mention a "--core-file" argument to target create. It is
"--core".

<rdar://problem/19518164> 

llvm-svn: 226543
2015-01-20 03:06:17 +00:00
Duncan P. N. Exon Smith 5f39dfd429 Revert "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
This reverts commit r226540, since I hit an unexpected bot failure [1].
I'll investigate.

[1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20244

llvm-svn: 226542
2015-01-20 03:01:27 +00:00
Duncan P. N. Exon Smith 03e0583a2d IR: Move MDNode clone() methods from ValueMapper to MDNode, NFC
Now that the clone methods used by `MapMetadata()` don't do any
remapping (and return a temporary), they make more sense as member
functions on `MDNode` (and subclasses).

llvm-svn: 226541
2015-01-20 02:56:57 +00:00
Duncan P. N. Exon Smith 8a07e7f657 IR: Simplify DIBuilder's HeaderBuilder API, NFC
Change `HeaderBuilder` API to work well even when it's not starting with
a tag.  There's already one case like this, and the tag is moving
elsewhere as part of PR22235.

llvm-svn: 226540
2015-01-20 02:54:07 +00:00
Duncan P. N. Exon Smith a7477285b9 AsmParser: PARSE_MD_FIELD() => ParseMDField(), NFC
Extract most of `PARSE_MD_FIELD()` into a function.

llvm-svn: 226539
2015-01-20 02:42:29 +00:00
Duncan P. N. Exon Smith 8839cb1dc8 AsmParser: Refactor duplicate code, NFC
llvm-svn: 226538
2015-01-20 02:39:21 +00:00
Chandler Carruth 10f28f26fd [PM] Replace the Pass argument in MergeBasicBlockIntoOnlyPred with
a DominatorTree argument as that is the analysis that it wants to
update.

This removes the last non-loop utility function in Utils/ which accepts
a raw Pass argument.

llvm-svn: 226537
2015-01-20 01:37:09 +00:00
Duncan P. N. Exon Smith 408f5a25fa IR: Delete GenericDwarfNode during teardown
Fix a leak in `LLVMContextImpl` teardown that the leak sanitizer tracked
down [1].  I've just switched to automatic dispatch here (since I'll
inevitably forget again with the next class).

[1]: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/811/steps/check-llvm%20asan/logs/stdio

llvm-svn: 226536
2015-01-20 01:18:32 +00:00
Duncan P. N. Exon Smith db6bc8bfdf Bitcode: Simplify MDNode subclass dispatch, NFC
llvm-svn: 226535
2015-01-20 01:03:09 +00:00
Duncan P. N. Exon Smith 6592deeab2 Bitcode: WriteMDNode() => WriteMDTuple(), NFC
llvm-svn: 226534
2015-01-20 01:01:53 +00:00
Duncan P. N. Exon Smith 9a6f64e7b8 Bitcode: Add ValueEnumerator::getMetadataOrNullID(), NFC
llvm-svn: 226533
2015-01-20 01:00:23 +00:00
Duncan P. N. Exon Smith 2da09e4408 IR: Canonicalize GenericDwarfNode empty headers to null
llvm-svn: 226532
2015-01-20 00:58:46 +00:00
Duncan P. N. Exon Smith 0f529998a5 IR: Detect whether to call recalculateHash() via SFINAE, NFC
Rather than relying on updating switch statements correctly, detect
whether `setHash()` exists in the subclass.  If so, call
`recalculateHash()` and `setHash(0)` appropriately.

llvm-svn: 226531
2015-01-20 00:57:33 +00:00
Greg Clayton ee3626ec16 Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets.
Include paths were switched to be user include paths, if this breaks the linux build we will need to fix the Makefiles/cmake stuff.

<rdar://problem/19198581> 

llvm-svn: 226530
2015-01-20 00:04:26 +00:00
Duncan P. N. Exon Smith fed199a758 IR: Introduce GenericDwarfNode
As part of PR22235, introduce `DwarfNode` and `GenericDwarfNode`.  The
former is a metadata node with a DWARF tag.  The latter matches our
current (generic) schema of a header with string (and stringified
integer) data and an arbitrary number of operands.

This doesn't move it into place yet; that change will require a large
number of testcase updates.

llvm-svn: 226529
2015-01-20 00:01:43 +00:00
Jim Ingham d5ac1ab65d Fix a race condition where you could set the selected thread & target in the
CommandInterpreter's execution context AFTER the process had started running
and before it initially stopped.  Also fixed one test case that was implicitly
using this (and an abuse of the async mode) to accidentally succeed.

<rdar://problem/16814726>

llvm-svn: 226528
2015-01-19 23:51:51 +00:00
Duncan P. N. Exon Smith 2a6b5fcfaa AsmParser: Abstract more of MDLocation parser, NFC
llvm-svn: 226527
2015-01-19 23:44:41 +00:00
Duncan P. N. Exon Smith 66ca92e509 AsmParser: Split up ParseMDFieldsImpl(), NFC
llvm-svn: 226526
2015-01-19 23:39:32 +00:00
Frederic Riss e4a6fef98f [dsymutil] Add the detected target triple to the debug map.
It will be needed to instantiate the Target object that we will
use to create all the MC objects for the dwarf emission.

llvm-svn: 226525
2015-01-19 23:33:14 +00:00
Duncan P. N. Exon Smith 13890af51c AsmParser: Fix error location for missing fields
llvm-svn: 226524
2015-01-19 23:32:36 +00:00
Duncan P. N. Exon Smith 909131b95f IR: Cleanup MDNode field use, NFC
Swap usage of `SubclassData32` and `MDNodeSubclassData`, and rename
`MDNodeSubclassData` to `NumUnresolved`.  Small drive-by cleanup to
`countUnresolvedOperands()` since otherwise the name clash with local
vars named `NumUnresolved` would be confusing.

llvm-svn: 226523
2015-01-19 23:18:34 +00:00
Duncan P. N. Exon Smith 8647529250 IR: Move replaceWithUniqued(), etc., to source file, NFC
llvm-svn: 226522
2015-01-19 23:17:09 +00:00
Duncan P. N. Exon Smith a1ae4f6b30 IR: Cleanup MDNode::MDNode(), NFC
llvm-svn: 226521
2015-01-19 23:15:21 +00:00
Duncan P. N. Exon Smith 2bc00f4a38 IR: Merge UniquableMDNode back into MDNode, NFC
As pointed out in r226501, the distinction between `MDNode` and
`UniquableMDNode` is confusing.  When we need subclasses of `MDNode`
that don't use all its functionality it might make sense to break it
apart again, but until then this makes the code clearer.

llvm-svn: 226520
2015-01-19 23:13:14 +00:00
Duncan P. N. Exon Smith 93e983e707 IR: Extract MDNodeOpsKey, NFC
Make the MDTuple operand hashing logic reusable.

llvm-svn: 226519
2015-01-19 22:53:18 +00:00
Duncan P. N. Exon Smith f9d1bc9919 IR: Simplify uniquifyImpl(), NFC
llvm-svn: 226518
2015-01-19 22:52:07 +00:00
Duncan P. N. Exon Smith 6cf10d2786 IR: Simplify erasing from uniquing store, NFC
llvm-svn: 226517
2015-01-19 22:47:08 +00:00
Duncan P. N. Exon Smith 660c0893da Remove dead code, NFC
llvm-svn: 226516
2015-01-19 22:45:41 +00:00
Duncan P. N. Exon Smith 6dc22bf27b Utils: Simplify MapMetadata(), NFC
Extract out the operand remapping loops, which are now very similar.

llvm-svn: 226515
2015-01-19 22:44:32 +00:00
Duncan P. N. Exon Smith 9fa10658ce Skip upcast, NFC
llvm-svn: 226514
2015-01-19 22:41:14 +00:00
Simon Pilgrim 20bc37c7db [X86][AVX] Missing AVX1 memory folding float instructions
Now that we can create much more exhaustive X86 memory folding tests, this patch adds the missing AVX1/F16C floating point instruction stack foldings we can easily test for including the scalar intrinsics (add, div, max, min, mul, sub), conversions float/int to double, half precision conversions, rounding, dot product and bit test. The patch also adds a couple of obviously missing SSE instructions (more to follow once we have full SSE testing).

Now that scalar folding is working it broke a very old test (2006-10-07-ScalarSSEMiscompile.ll) - this test appears to make no sense as its trying to ensure that a scalar subtraction isn't folded as it 'would zero the top elts of the loaded vector' - this test just appears to be wrong to me.

Differential Revision: http://reviews.llvm.org/D7055

llvm-svn: 226513
2015-01-19 22:40:45 +00:00
Duncan P. N. Exon Smith c862be860d Fix whitespace, NFC
llvm-svn: 226512
2015-01-19 22:40:25 +00:00
Duncan P. N. Exon Smith 0dcffe2cdc Utils: Simplify MapMetadata(), NFC
Take advantage of the new ability of temporary nodes to mutate to
distinct and uniqued nodes to greatly simplify the `MapMetadata()`
helper functions.

llvm-svn: 226511
2015-01-19 22:39:07 +00:00
Duncan P. N. Exon Smith e33530909d IR: Allow temporary nodes to become uniqued or distinct
Add `MDNode::replaceWithUniqued()` and `MDNode::replaceWithDistinct()`,
which mutate temporary nodes to become uniqued or distinct.  On uniquing
collisions, the unique version is returned and the node is deleted.

This takes advantage of temporary nodes being folded back in, and should
let me clean up some awkward logic in `MapMetadata()`.

llvm-svn: 226510
2015-01-19 22:24:52 +00:00
Duncan P. N. Exon Smith 434d4a5a06 IR: Remove templates from TempMDNodeDeleter, NFC
r226504 added `TempMDNodeDeleter` to help with `std::unique_ptr<>`-izing
the `MDNode::getTemporary()` interface.  It doesn't need to be
templated, though.

llvm-svn: 226509
2015-01-19 22:21:15 +00:00
Duncan P. N. Exon Smith c5a0e2e3a7 IR: Split out countUnresolvedOperands(), NFC
llvm-svn: 226508
2015-01-19 22:18:29 +00:00
Duncan P. N. Exon Smith 422e5c7acc Cleanup whitespace, NFC
llvm-svn: 226507
2015-01-19 22:16:01 +00:00
Duncan P. N. Exon Smith e566efec71 CodeGen: Update IRBuilder for LLVM API change
`MDNode::getTemporary()` returns a `unique_ptr<>` as of r226504.

llvm-svn: 226506
2015-01-19 21:31:48 +00:00
Duncan P. N. Exon Smith 7fd74acd0b CodeGen: Update LoopAttributes for LLVM API change
`MDNode::getTemporary()` returns a `unique_ptr<>` as of r226504.

llvm-svn: 226505
2015-01-19 21:30:48 +00:00
Duncan P. N. Exon Smith 7d82313bcd IR: Return unique_ptr from MDNode::getTemporary()
Change `MDTuple::getTemporary()` and `MDLocation::getTemporary()` to
return (effectively) `std::unique_ptr<T, MDNode::deleteTemporary>`, and
clean up call sites.  (For now, `DIBuilder` call sites just call
`release()` immediately.)

There's an accompanying change in each of clang and polly to use the new
API.

llvm-svn: 226504
2015-01-19 21:30:18 +00:00