Sanjay Patel [Sun, 14 Aug 2016 20:39:42 +0000 (20:39 +0000)]
[InstCombine] add test for missing vector icmp fold
llvm-svn: 278630
Craig Topper [Sun, 14 Aug 2016 17:57:22 +0000 (17:57 +0000)]
[AVX-512] Mark VPMADDWD as commutable to match SSE/AVX version.
llvm-svn: 278629
Craig Topper [Sun, 14 Aug 2016 17:57:19 +0000 (17:57 +0000)]
[AVX-512] Add masked commutable floating point max/min instructions to folding tables.
llvm-svn: 278628
Craig Topper [Sun, 14 Aug 2016 17:57:16 +0000 (17:57 +0000)]
[AVX-512] Add masked logical operations to memory folding tables.
llvm-svn: 278627
Igor Breger [Sun, 14 Aug 2016 13:58:57 +0000 (13:58 +0000)]
[AVX512] Fix VFPCLASSSD/VFPCLASSSS intrinsic lowering. The i1 result should be zero extended according to SPEC.
Differential Revision: http://reviews.llvm.org/D23489
llvm-svn: 278626
Ed Maste [Sun, 14 Aug 2016 11:30:11 +0000 (11:30 +0000)]
elf-core: set powerpc vector byte order correctly
It was being set to the fp reg set's byte order due to an apparent
copy-and-pasteo.
llvm-svn: 278625
Igor Breger [Sun, 14 Aug 2016 09:34:39 +0000 (09:34 +0000)]
autogenerate checks
llvm-svn: 278624
Igor Breger [Sun, 14 Aug 2016 05:25:07 +0000 (05:25 +0000)]
[AVX512] Fix insertelement i1 lowering.
1. Use shuffle to insert element i1 into vector. The previous implementation was incorrect ( dest_bit OR src_bit , it doesn't clear the bit if src_bit=0 )
2. Improve shuffle i1 vector, use CVT2MASK if supported instead TRUNCATE.
Differential Revision: http://reviews.llvm.org/D23347
llvm-svn: 278623
Saleem Abdulrasool [Sun, 14 Aug 2016 05:07:20 +0000 (05:07 +0000)]
Revert "gold: add a cast to appease std::max NFC"
This was fixed differently by Teresa and this should no longer be needed.
llvm-svn: 278622
Diana Picus [Sun, 14 Aug 2016 02:10:18 +0000 (02:10 +0000)]
Revert "CodeGen: If Convert blocks that would form a diamond when tail-merged."
This reverts commit r278287.
This commit broke the clang-cmake-thumbv7-a15-full-sh bot.
See https://llvm.org/bugs/show_bug.cgi?id=28949
llvm-svn: 278621
Diana Picus [Sun, 14 Aug 2016 02:10:12 +0000 (02:10 +0000)]
Revert "Codegen: Don't tail-duplicate blocks with un-analyzable fallthrough."
This reverts commit r278288.
r278287 broke the clang-cmake-thumbv7-a15-full-sh bot.
Revert this so we can get to r278287.
llvm-svn: 278620
Sanjoy Das [Sun, 14 Aug 2016 01:04:50 +0000 (01:04 +0000)]
[IRCE] Change variable grouping; NFC
llvm-svn: 278619
Sanjoy Das [Sun, 14 Aug 2016 01:04:46 +0000 (01:04 +0000)]
[IRCE] Create llvm::Loop instances for cloned out loops
llvm-svn: 278618
Sanjoy Das [Sun, 14 Aug 2016 01:04:36 +0000 (01:04 +0000)]
[IRCE] Don't iterate on loops that were cloned out
IRCE has the ability to further version pre-loops and post-loops that it
created, but this isn't useful at all. This change teaches IRCE to
leave behind some metadata in the loops it creates (by cloning the main
loop) so that these new loops are not re-processed by IRCE.
Today this bug is hidden by another bug -- IRCE does not update LoopInfo
properly so the loop pass manager does not re-invoke IRCE on the loops
it split out. However, once the latter is fixed the bug addressed in
this change causes IRCE to infinite-loop in some cases (e.g. it splits
out a pre-loop, a pre-pre-loop from that, a pre-pre-pre-loop from that
and so on).
llvm-svn: 278617
Sanjoy Das [Sun, 14 Aug 2016 01:04:31 +0000 (01:04 +0000)]
[IRCE] Add better DEBUG diagnostic; NFC
NFC meaning IRCE should not _do_ anything different, but
-debug-only=irce will be a little friendlier.
llvm-svn: 278616
Mehdi Amini [Sun, 14 Aug 2016 00:01:27 +0000 (00:01 +0000)]
Fix bitcode auto-upgrade when using bitcode lazy loading
The auto-upgrade path could be called before the VST (global
names) was fully parsed, and thus intrinsic names were not
available and the autoupgrade logic could not operate.
Fix link failures with ThinLTO.
This is a recommit of r278610 with a different fix.
llvm-svn: 278615
Ron Lieberman [Sat, 13 Aug 2016 23:41:11 +0000 (23:41 +0000)]
Fix unsupported relocation type R_HEX_6_X' for symbol .rodata
LowerTargetConstantPool is not properly setting the TargetFlag to indicate
desired relocation. Coding error, the offset parameter was omitted, so the
TargetFlag was used as the offset, and the TargetFlag defaulted to zero.
This only affects -fpic compilation, and only those items created in a
Constant Pool, for example a vector of constants. Halide ran into this issue.
llvm-svn: 278614
Mehdi Amini [Sat, 13 Aug 2016 23:39:14 +0000 (23:39 +0000)]
Revert "Fix bitcode auto-upgrade when using bitcode lazy loading"
This reverts commit r278610. Tests are broken
llvm-svn: 278613
Sanjoy Das [Sat, 13 Aug 2016 23:36:40 +0000 (23:36 +0000)]
[IRCE] Fix test case; NFC
The (negative) test case is supposed to check that IRCE does not muck
with range checks it cannot handle, not that it does the right thing in
the absence of profiling information.
llvm-svn: 278612
Sanjoy Das [Sat, 13 Aug 2016 23:36:35 +0000 (23:36 +0000)]
[IRCE] Be resilient in the face of non-simplified loops
Loops containing `indirectbr` may not be in simplified form, even after
running LoopSimplify. Reject then gracefully, instead of tripping an
assert.
llvm-svn: 278611
Mehdi Amini [Sat, 13 Aug 2016 23:31:53 +0000 (23:31 +0000)]
Fix bitcode auto-upgrade when using bitcode lazy loading
The auto-upgrade path could be called before the VST (global
names) was fully parsed, and thus intrinsic names were not
available and the autoupgrade logic could not operate.
Fix link failures with ThinLTO.
llvm-svn: 278610
Mehdi Amini [Sat, 13 Aug 2016 23:31:24 +0000 (23:31 +0000)]
Revert "Revert "Invariant start/end intrinsics overloaded for address space""
This reverts commit
32fc6488e48eafc0ca1bac1bd9cbf0008224d530.
llvm-svn: 278609
Mehdi Amini [Sat, 13 Aug 2016 23:27:32 +0000 (23:27 +0000)]
Revert "Invariant start/end intrinsics overloaded for address space"
This reverts commit r276447.
llvm-svn: 278608
Sanjoy Das [Sat, 13 Aug 2016 22:00:12 +0000 (22:00 +0000)]
[IRCE] Use dyn_cast instead of explicit isa/cast; NFC
llvm-svn: 278607
Sanjoy Das [Sat, 13 Aug 2016 22:00:09 +0000 (22:00 +0000)]
[IRCE] Use range-for; NFC
llvm-svn: 278606
Mehdi Amini [Sat, 13 Aug 2016 20:42:19 +0000 (20:42 +0000)]
[ADT] Add a reserve() method to DenseSet as well as an insert() for R-value
Recommit 278600 with some fixes to make the test more robust.
llvm-svn: 278604
Mehdi Amini [Sat, 13 Aug 2016 20:14:39 +0000 (20:14 +0000)]
Revert "[ADT] Add a reserve method to DenseSet as well as an insert() for R-value"
This reverts commit r278600. The unittest does not pass on MSVC, there is
an extra move. Investigating how to make it more robust.
llvm-svn: 278603
Yaron Keren [Sat, 13 Aug 2016 19:46:31 +0000 (19:46 +0000)]
Limit DenseMap::setNumEntries input to 1<<31, in accordance with the 31 bits allocated to NumEntries.
std::numeric_limits<int>::max() may be something else than 1<<31.
llvm-svn: 278602
Mehdi Amini [Sat, 13 Aug 2016 19:44:02 +0000 (19:44 +0000)]
Add missing REQUIRES in sancov/print_coverage_pcs.test: it requires aarch64 as well now
llvm-svn: 278601
Mehdi Amini [Sat, 13 Aug 2016 19:40:13 +0000 (19:40 +0000)]
[ADT] Add a reserve method to DenseSet as well as an insert() for R-value
llvm-svn: 278600
Sanjay Patel [Sat, 13 Aug 2016 18:42:14 +0000 (18:42 +0000)]
[x86] add tests to show missed 64-bit immediate merging
Tests are slightly modified versions of those written by
Sunita Marathe in D23391.
llvm-svn: 278599
Aditya Kumar [Sat, 13 Aug 2016 11:56:50 +0000 (11:56 +0000)]
Test commit
llvm-svn: 278598
Craig Topper [Sat, 13 Aug 2016 06:48:44 +0000 (06:48 +0000)]
[X86] Add a check of isCommutable at the top of X86InstrInfo::findCommutedOpIndices. Most callers don't check if the instruction is commutable before calling.
This saves us the trouble of ending up in the default of the switch and having to determine if this is an FMA or not.
llvm-svn: 278597
Craig Topper [Sat, 13 Aug 2016 06:48:41 +0000 (06:48 +0000)]
[AVX-512] Add isCommutable to scalar FMA3 instructions.
llvm-svn: 278596
Craig Topper [Sat, 13 Aug 2016 06:48:39 +0000 (06:48 +0000)]
[AVX-512] Add commutable flags to 132 form FMA3 instructions.
llvm-svn: 278595
Craig Topper [Sat, 13 Aug 2016 06:02:19 +0000 (06:02 +0000)]
[X86] Remove patterns for (vzmovl (insert_subvector undef, (scalar_to_vector))) as the (vzmovl VR256) pattern has higher priority. NFC
llvm-svn: 278594
Craig Topper [Sat, 13 Aug 2016 05:43:20 +0000 (05:43 +0000)]
[AVX-512] Remove an AddedComplexity that was prioritizing basic vzmovl patterns over more complex ones that produce better code.
llvm-svn: 278593
Craig Topper [Sat, 13 Aug 2016 05:33:12 +0000 (05:33 +0000)]
[AVX-512] Add patterns to support VZEXT_MOVL from 512-bit vectors with 64-bit and 32-bit elements.
Fixes PR28961.
llvm-svn: 278592
Teresa Johnson [Sat, 13 Aug 2016 04:11:27 +0000 (04:11 +0000)]
[PM] Port LoopDataPrefetch to new pass manager
Summary:
Refactor the existing support into a LoopDataPrefetch implementation
class and a LoopDataPrefetchLegacyPass class that invokes it.
Add a new LoopDataPrefetchPass for the new pass manager that utilizes
the LoopDataPrefetch implementation class.
Reviewers: mehdi_amini
Subscribers: sanjoy, mzolotukhin, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D23483
llvm-svn: 278591
Matt Arsenault [Sat, 13 Aug 2016 01:43:54 +0000 (01:43 +0000)]
AMDGPU: Fix not estimating MBB operand sizes correctly
llvm-svn: 278590
Matt Arsenault [Sat, 13 Aug 2016 01:43:51 +0000 (01:43 +0000)]
AMDGPU: Fix missing test for addressing mode with odd offsets
Add test if the constant offset looks unaligned.
llvm-svn: 278589
Matt Arsenault [Sat, 13 Aug 2016 01:43:46 +0000 (01:43 +0000)]
AMDGPU/R600: Remove macros
llvm-svn: 278588
Hans Wennborg [Sat, 13 Aug 2016 01:12:49 +0000 (01:12 +0000)]
Fix more dereferenced end() iterators after r278532
llvm-svn: 278587
Eugene Zelenko [Sat, 13 Aug 2016 01:05:35 +0000 (01:05 +0000)]
Fix build broken after llvm/ADT/DenseMap.h replacement of climits with limits.
llvm-svn: 278586
Pete Cooper [Sat, 13 Aug 2016 01:05:32 +0000 (01:05 +0000)]
Constify ValueTracking. NFC.
Almost all of the method here are only analysing Value's as opposed to
mutating them. Mark all of the easy ones as const.
llvm-svn: 278585
Sanjoy Das [Sat, 13 Aug 2016 00:58:31 +0000 (00:58 +0000)]
[IndVars] Ignore (s|z)exts that don't extend the induction variable
`IVVisitor::visitCast` used to have the invariant that if the
instruction it was passed was a sext or zext instruction, the result of
the instruction would be wider than the induction variable. This is no
longer true after rL275037, so this change teaches `IndVarSimplify` s
implementation of `IVVisitor::visitCast` to work with the relaxed
invariant.
A corresponding change to SimplifyIndVar to preserve the said invariant
after rL275037 would also work, but given how `IVVisitor::visitCast` is
spelled (no indication of said invariant), I figured the current fix is
cleaner.
Fixes PR28935.
llvm-svn: 278584
Eugene Zelenko [Sat, 13 Aug 2016 00:50:41 +0000 (00:50 +0000)]
Fix some Clang-tidy modernize-use-using and Include What You Use warnings.
Differential revision: https://reviews.llvm.org/D23478
llvm-svn: 278583
Kostya Serebryany [Sat, 13 Aug 2016 00:12:32 +0000 (00:12 +0000)]
[libFuzzer] mention one more trophie in LLVM
llvm-svn: 278582
Justin Lebar [Sat, 13 Aug 2016 00:04:12 +0000 (00:04 +0000)]
[LSV] Use a set rather than an ArraySlice at the end of getVectorizablePrefix. NFC
Summary: This avoids a small O(n^2) loop.
Reviewers: asbirlea
Subscribers: mzolotukhin, llvm-commits, arsenm
Differential Revision: https://reviews.llvm.org/D23473
llvm-svn: 278581
Justin Lebar [Sat, 13 Aug 2016 00:04:08 +0000 (00:04 +0000)]
[LSV] Use OrderedBasicBlock instead of rolling it ourselves. NFC
Summary:
In getVectorizablePrefix, this is less efficient (because we have to
iterate over the BB twice), but boy is it simpler. Given how much
trouble we've had here, I think the simplicity gain is worthwhile.
In reorder(), this is actually more efficient, as
DominatorTree::dominates iterates over the BB from the beginning when
the two instructions are in the same BB.
Reviewers: asbirlea
Subscribers: arsenm, llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D23472
llvm-svn: 278580
Mehdi Amini [Sat, 13 Aug 2016 00:02:33 +0000 (00:02 +0000)]
Fix ASAN failures in the demangler
These were found fuzzing with ASAN.
llvm-svn: 278579
Justin Lebar [Fri, 12 Aug 2016 23:58:19 +0000 (23:58 +0000)]
Minor comment fix ("generate" --> "generates").
llvm-svn: 278578
Hans Wennborg [Fri, 12 Aug 2016 23:35:59 +0000 (23:35 +0000)]
X86: Fix another dereferenced end() iterator after r278532
llvm-svn: 278577
Dominic Chen [Fri, 12 Aug 2016 23:14:18 +0000 (23:14 +0000)]
[WebAssembly] Re-enable disabled debug value test
Summary:
This test was resulting in asan/valgrind failures due to undefined
DWARF register mappings for WebAssembly, and was disabled in r278495.
These have been resolved.
Reviewers: sunfish, dschuff
Subscribers: bkramer, llvm-commits, jfb
Differential Revision: https://reviews.llvm.org/D23459
llvm-svn: 278576
Haicheng Wu [Fri, 12 Aug 2016 23:13:38 +0000 (23:13 +0000)]
Reapply [BranchFolding] Restrict tail merging loop blocks after MBP
Fixed a bug in the test case.
To fix PR28104, this patch restricts tail merging to blocks that belong to the
same loop after MBP.
llvm-svn: 278575
Dominic Chen [Fri, 12 Aug 2016 23:12:59 +0000 (23:12 +0000)]
Avoid accessing LLVM/DWARF register mappings if undefined
Summary:
If the backend does not define LLVM/DWARF register mappings, the associated
variables are undefined since the map initializer is called by auto-generated
TableGen routines. This patch initializes the pointers and sizes to nullptr
and zero, respectively, and checks that they are valid before searching
for a mapping.
Reviewers: grosbach, dschuff
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23458
llvm-svn: 278574
Tim Shen [Fri, 12 Aug 2016 22:47:13 +0000 (22:47 +0000)]
[LoopVectorize] Detect loops in the innermost loop before creating InnerLoopVectorizer
InnerLoopVectorizer shouldn't handle a loop with cycles inside the loop
body, even if that cycle isn't a natural loop.
Fixes PR28541.
Differential Revision: https://reviews.llvm.org/D22952
llvm-svn: 278573
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 22:43:33 +0000 (22:43 +0000)]
X86: Stop dereferencing end() in X86FrameLowering::emitEpilogue
On a Windows build of Chromium, r278532 (up to r278539)
X86FrameLowering::emitEpilogue because it wasn't wary enough of the
return of MachineBasicBlock::getFirstTerminator. Guard all the uses
here.
Note that r278532 *looks* like an NFC commit (just an API change), but
it removes a couple of layers of abstraction and is probably causing
optimization differences in MSVC.
llvm-svn: 278572
Reid Kleckner [Fri, 12 Aug 2016 22:23:04 +0000 (22:23 +0000)]
[Inliner] Don't treat inalloca allocas as static
They aren't static, and moving them to the entry block across something
else will only result in tears.
Root cause of http://crbug.com/636558.
llvm-svn: 278571
Pete Cooper [Fri, 12 Aug 2016 22:16:05 +0000 (22:16 +0000)]
Add support to paternmatch for simple const Value cases.
Pattern match has some paths which can operate on constant instructions,
but not all. This adds a version of m_value() to return const Value* and
changes ICmp matching to use auto so that it can match both constant and
mutable instructions.
Tests also included for both mutable and constant ICmpInst matching.
This will be used in a future commit to constify ValueTracking.cpp.
llvm-svn: 278570
Tim Shen [Fri, 12 Aug 2016 22:03:28 +0000 (22:03 +0000)]
[ADT] Add filter_iterator for filtering elements
Differential Revision: https://reviews.llvm.org/D22951
llvm-svn: 278569
Artem Belevich [Fri, 12 Aug 2016 22:02:19 +0000 (22:02 +0000)]
[NVPTX] Use untyped (.b) integer registers in PTX.
This bring LLVM-generated PTX closer to what nvcc generates and avoids
triggering issues in ptxas.
For instance, ptxas does not accept .s16 (or .u16) registers as operands
for .fp16 instructions.
Differential Revision: https://reviews.llvm.org/D23460
llvm-svn: 278568
Saleem Abdulrasool [Fri, 12 Aug 2016 21:56:12 +0000 (21:56 +0000)]
gold: add a cast to appease std::max NFC
llvm-svn: 278567
Teresa Johnson [Fri, 12 Aug 2016 21:33:36 +0000 (21:33 +0000)]
[PM] BitcodeWriterPass should derive from PassInfoMixin
Summary:
The BitcodeWriterPass was ported a couple years ago, and predates the
PassInfoMixin. Make BitcodeWriterPass from that base class.
Should BitcodeWriterPass be added to the PassRegistry.def file? It seems
like that is only for passes that can be added arbitrarily, e.g. via the
-passes flag to the opt tool. Whereas the bitcode writer is added
specially based on the output type (and requires an output stream and
other parameters). For now I have left it out of the PassRegistry, but
let me know if it should go there.
Finally, I was considering an NFC change of the legacy WriteBitcodePass
to BitcodeWriterLegacyPass to make its usage clearer and more consistent
with other legacy passes. WDYT?
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23465
llvm-svn: 278566
David L Kreitzer [Fri, 12 Aug 2016 21:06:53 +0000 (21:06 +0000)]
Fixed typo.
llvm-svn: 278565
Krzysztof Parzyszek [Fri, 12 Aug 2016 21:05:05 +0000 (21:05 +0000)]
[Hexagon] Cleanup and standardize vector load/store pseudo instructions
Remove the following single-vector load/store pseudo instructions, use real
instructions instead:
LDriv_pseudo_V6 STriv_pseudo_V6
LDriv_pseudo_V6_128B STriv_pseudo_V6_128B
LDrivv_indexed STrivv_indexed
LDrivv_indexed_128B STrivv_indexed_128B
Rename the double-vector load/store pseudo instructions, add unaligned
counterparts:
-- old -- -- new -- -- unaligned --
LDrivv_pseudo_V6 PS_vloadrw_io PS_vloadrwu_io
LDrivv_pseudo_V6_128B PS_vloadrw_io_128B PS_vloadrwu_io_128B
STrivv_pseudo_V6 PS_vstorerw_io PS_vstorerwu_io
STrivv_pseudo_V6_128B PS_vstorerw_io_128 PS_vstorerwu_io_128
llvm-svn: 278564
Kostya Serebryany [Fri, 12 Aug 2016 20:42:24 +0000 (20:42 +0000)]
[libFuzzer] fix typo in docs
llvm-svn: 278563
Eli Friedman [Fri, 12 Aug 2016 20:39:51 +0000 (20:39 +0000)]
[AArch64LoadStoreOptimizer] Check aliasing correctly when creating paired loads/stores.
The existing code accidentally skipped the aliasing check in edge cases.
Differential revision: https://reviews.llvm.org/D23372
llvm-svn: 278562
George Rimar [Fri, 12 Aug 2016 20:38:20 +0000 (20:38 +0000)]
[ELF] - Linkerscript: fix VA value assigned to sections when using constraints.
Previously we searched output section by name to assign VA. That did not
work in the case when multiple output sections with different constraints were defined in script.
Testcase shows the possible issue scenario, patch fixes the issue.
Differential revision: https://reviews.llvm.org/D23451
llvm-svn: 278561
Mike Aizatsky [Fri, 12 Aug 2016 20:28:05 +0000 (20:28 +0000)]
[AArch64] Registering default MCInstrAnalysis
Even in this form it is useful: it can detect branch instructions.
https://github.com/google/sanitizers/issues/706
Subscribers: aemerson, rengolin
Differential Revision: https://reviews.llvm.org/D23426
llvm-svn: 278560
Eli Friedman [Fri, 12 Aug 2016 20:28:02 +0000 (20:28 +0000)]
[AArch64LoadStoreOpt] Handle offsets correctly for post-indexed paired loads.
Trunk would try to create something like "stp x9, x8, [x0], #512", which isn't actually a valid instruction.
Differential revision: https://reviews.llvm.org/D23368
llvm-svn: 278559
Chris Bieneman [Fri, 12 Aug 2016 20:11:03 +0000 (20:11 +0000)]
Remove autoconf references from LICENSE.TXT
Since we don't actually have the autoconf subdirectories anymore, we don't need this reference here.
llvm-svn: 278558
Kevin Enderby [Fri, 12 Aug 2016 20:10:25 +0000 (20:10 +0000)]
Next set of additional error checks for invalid Mach-O files.
This contains the two missing checks for LC_SEGMENT load command fields.
And checks for the Mach-O sections fields that would make them invalid.
With the new checks, some of the existing malformed file checks now trips one
of these instead of the issue it was having before so those tests were adjusted.
llvm-svn: 278557
Mike Aizatsky [Fri, 12 Aug 2016 20:06:32 +0000 (20:06 +0000)]
[sancov] test file cleanup
llvm-svn: 278556
George Rimar [Fri, 12 Aug 2016 19:56:57 +0000 (19:56 +0000)]
[ELF] - Do not use mergeable sections when LS is used.
After latest changes we combine input sections with
different attributes into single output section.
Problem here is that regular output sections does not
support adding mergeable input sections (and vise versa).
Patch just temporarily disables merging for now at
the same way we do for -O0 for example.
This change helps for linking FreeBSD kernel.
Differential revision: https://reviews.llvm.org/D23447
llvm-svn: 278555
George Rimar [Fri, 12 Aug 2016 19:32:45 +0000 (19:32 +0000)]
[ELF] - Remove excessive loop in LinkerScript<ELFT>::assignAddresses()
After 278461 "Create only one section for a name in LinkerScript."
this loop is excessive.
Patch also reorders code slightly to use early return.
Differential revision: https://reviews.llvm.org/D23442
llvm-svn: 278554
Alexander Droste [Fri, 12 Aug 2016 19:30:31 +0000 (19:30 +0000)]
[clang-tidy] MPIBufferDerefCheck
...
This check verifies if a buffer passed to an MPI (Message Passing Interface)
function is sufficiently dereferenced. Buffers should be passed as a single
pointer or array. As MPI function signatures specify void * for their buffer
types, insufficiently dereferenced buffers can be passed, like for example
as double pointers or multidimensional arrays, without a compiler warning
emitted.
Instructions on how to apply the check can be found at:
https://github.com/0ax1/MPI-Checker/tree/master/examples
Reviewers: Haojian Wu
Differential revision: https://reviews.llvm.org/D22729
llvm-svn: 278553
Todd Fiala [Fri, 12 Aug 2016 19:27:05 +0000 (19:27 +0000)]
fix lldb-gtest target of Xcode build
Change r278527 was filtering out too many libraries.
The Xcode lldb-gtest target depends on linking libgtest*.a,
but those were not being included. This caused the lldb-gtest
linkage step to fail to find a main entry point that is present
in the filtered out libs.
This change restores the libgtest* libraries to the link list
by whitelisting them in the filter.
llvm-svn: 278552
Mike Aizatsky [Fri, 12 Aug 2016 19:25:59 +0000 (19:25 +0000)]
[sancov] MachO indirect symbols support.
Differential Revision: https://reviews.llvm.org/D23338
llvm-svn: 278551
George Rimar [Fri, 12 Aug 2016 19:25:54 +0000 (19:25 +0000)]
[ELF] - Fix for: error "invalid section index: xxx" when linking FreeBSD kernel.
We found that GNU assembler 2.17.50 [FreeBSD] 2007-07-03
could generate broken objects. STT_SECTION symbols can be
associated with SHT_REL[A]/SHT_SYMTAB/SHT_STRTAB sections.
This is PR28868, patch fixes handling of such files.
Differential revision: https://reviews.llvm.org/D23201
llvm-svn: 278550
Artem Belevich [Fri, 12 Aug 2016 18:44:01 +0000 (18:44 +0000)]
[CUDA] Place GPU binary into .nv_fatbin section and align it by 8.
This matches the way nvcc encapsulates GPU binaries into host object file.
Now cuobjdump can deal with clang-compiled object files.
Differential Revision: https://reviews.llvm.org/D23429
llvm-svn: 278549
Tim Shen [Fri, 12 Aug 2016 18:40:04 +0000 (18:40 +0000)]
[PPC] Memoize getValueBits. NFC.
Summary: It triggers exponential behavior when the DAG has many branches.
Reviewers: hfinkel, kbarton
Subscribers: iteratee, nemanjai, echristo
Differential Revision: https://reviews.llvm.org/D23428
llvm-svn: 278548
Zachary Turner [Fri, 12 Aug 2016 18:39:05 +0000 (18:39 +0000)]
Remove accidentally committed file.
llvm-svn: 278547
Zachary Turner [Fri, 12 Aug 2016 18:38:26 +0000 (18:38 +0000)]
Analyze include order on a per-file basis.
The include order check would get notified of all include
directives in a depth-first manner. This created the
possibility of an include directive from a header file
interfering with the sort order of a set of two distinct
blocks from the top level cpp file, if that include directive
was on just the right line.
With this patch we bucket the include directives by the file
in which they appear in and process one bucket at a time,
so that directives from different files do not get mixed
together into the same list.
Reviewed By: alexfh
Differential Revision: https://reviews.llvm.org/D23434
llvm-svn: 278546
Benjamin Kramer [Fri, 12 Aug 2016 18:33:50 +0000 (18:33 +0000)]
[WebAssembly] Plug MachineMemOperand leaks.
llvm-svn: 278545
Dan Liew [Fri, 12 Aug 2016 18:29:36 +0000 (18:29 +0000)]
[LibFuzzer] Fix `-jobs=<N>` where <N> > 1 and the number of workers is > 1 on macOS.
The original `ExecuteCommand()` called `system()` from the C library.
The C library implementation of this on macOS contains a mutex which
serializes calls to `system()`. This prevented the `-jobs=` flag
from running copies of the fuzzing binary in parallel which is
the opposite of what is intended.
To fix this on macOS an alternative implementation of `ExecuteCommand()`
is provided that can be used concurrently. This is provided in
`FuzzerUtilDarwin.cpp` which is guarded to only compile code on Apple
platforms. The existing implementation has been moved to a new file
`FuzzerUtilLinux.cpp` which is guarded to only compile code on Linux.
This commit includes a simple test to check that LibFuzzer is being
executed in parallel when requested.
Differential Revision: https://reviews.llvm.org/D22742
llvm-svn: 278544
Bruno Cardoso Lopes [Fri, 12 Aug 2016 18:18:24 +0000 (18:18 +0000)]
Reapply [VFS] Skip non existent files from the VFS tree
Reapply r278457 with test fixed to not abouse fs case sensitivity.
When the VFS uses a YAML file, the real file path for a
virtual file is described in the "external-contents" field. Example:
...
{
'type': 'file',
'name': 'a.h',
'external-contents': '/a/b/c/a.h'
}
Currently, when parsing umbrella directories, we use
vfs::recursive_directory_iterator to gather the header files to generate the
equivalent modules for. If the external contents for a header does not exist,
we currently are unable to build a module, since the VFS
vfs::recursive_directory_iterator will fail when it finds an entry without a
reliable real path.
Since the YAML file could be prepared ahead of time and shared among
different compiler invocations, an entry might not yet have a reliable
path in 'external-contents', breaking the iteration.
Give the VFS the capability to skip such entries whenever
'ignore-non-existent-contents' property is set in the YAML file.
rdar://problem/
27531549
llvm-svn: 278543
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 18:14:42 +0000 (18:14 +0000)]
ADT: Remove stale header comments about next/prev after r278532
Thanks to Mehdi for noticing.
llvm-svn: 278542
Teresa Johnson [Fri, 12 Aug 2016 18:12:08 +0000 (18:12 +0000)]
CodeGen: Replace ThinLTO backend implementation with a client of LTO/Resolution.
Summary:
This changes clang to use the llvm::lto::thinBackend function instead of
its own less comprehensive ThinLTO backend implementation.
Patch by Peter Collingbourne
Reviewers: tejohnson, mehdi_amini
Subscribers: cfe-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D21545
llvm-svn: 278541
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 18:10:29 +0000 (18:10 +0000)]
Hide type trait from r278532 from MSVC
The fixup from r278537 was insufficient. Just #ifdef it out for MSVC.
llvm-svn: 278539
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 17:54:54 +0000 (17:54 +0000)]
Try to appease win7 bots after r278532 by cleaning up type trait
The HasGetNext type trait was cluttered with a few things it didn't
need. Try to clean it up, hoping to fix windows bots:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/38063
I may just have to delete the trait...
llvm-svn: 278537
David Majnemer [Fri, 12 Aug 2016 17:53:06 +0000 (17:53 +0000)]
Remove whitespace
llvm-svn: 278536
Zachary Turner [Fri, 12 Aug 2016 17:47:52 +0000 (17:47 +0000)]
[Driver] Set the default driver mode based on the executable.
Currently, if --driver-mode is not passed at all, it will default
to GCC style driver. This is never an issue for clang because
it manually constructs a --driver-mode option and passes it.
However, we should still try to do as good as we can even if no
--driver-mode is passed. LibTooling, for example, does not pass
a --driver-mode option and while it could, it seems like we should
still fallback to the best possible default we can.
This is one of two steps necessary to get clang-tidy working on Windows.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D23454
llvm-svn: 278535
Alexander Droste [Fri, 12 Aug 2016 17:46:23 +0000 (17:46 +0000)]
Revert test commit
llvm-svn: 278534
Alexander Droste [Fri, 12 Aug 2016 17:43:58 +0000 (17:43 +0000)]
Test commit - first LLVM repo commit
llvm-svn: 278533
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 17:32:34 +0000 (17:32 +0000)]
ADT: Remove the ilist_nextprev_traits customization point
No one is using the capability to implement next and prev another way
(since lld stopped doing it in r278468). Remove the customization point
by moving the API from ilist_nextprev_traits<T> to ilist_node_access.
The old traits class is still useful/necessary API as a target for
friends of node types that inherit privately from ilist_node.
Eventually I plan to either remove it entirely or move the template
parameters to the methods.
(Note: if there's desire to bring back customization of next/prev
pointers in the future (e.g., to pack some bits in there), I think a
traits class like this is an awkward way to accomplish it. Instead, we
should change ilist<T> to be ilist<ilist_node<T>>, and give an extra
template parameter to ilist_node.)
llvm-svn: 278532
Michael Kuperstein [Fri, 12 Aug 2016 17:28:27 +0000 (17:28 +0000)]
[PM] Port LowerInvoke to the new pass manager
llvm-svn: 278531
Ivan Krasin [Fri, 12 Aug 2016 17:26:37 +0000 (17:26 +0000)]
Add compiler-rt side test for no_sanitize("cfi") attribute
Summary: Add a test case for __attribute__((no_sanitize("cfi"))) being effective.
Reviewers: kcc
Subscribers: dberris
Differential Revision: https://reviews.llvm.org/D23425
llvm-svn: 278530
Zachary Turner [Fri, 12 Aug 2016 17:15:38 +0000 (17:15 +0000)]
Disable TestThreadSpecificBpPlusCondition on Windows.
Test frequently times out stalling the test runner.
llvm-svn: 278529
Pete Cooper [Fri, 12 Aug 2016 17:13:28 +0000 (17:13 +0000)]
constify InstCombine::foldAllocaCmp. NFC.
This is part of an effort to constify ValueTracking.cpp. This change is
to methods which need const Value* instead of Value* to go with the upcoming
changes to ValueTracking.
llvm-svn: 278528