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
Todd Fiala [Fri, 12 Aug 2016 17:01:19 +0000 (17:01 +0000)]
Link LLDB only against libclang and libLLVM .a files to fix macOS build
The Xcode macOS build of LLDB is currently broken after
https://reviews.llvm.org/D23232 landed, see
http://lab.llvm.org:8080/green/job/lldb_build_test/20014/console,
because we’re trying to link against all .a files found in the
llvm-build/lib directory. Let’s be more specific in what we link
against. This patch applies a regexp to only use “libclang.*”,
“libLLVM.*” and not “libclang_rt.*” static archives.
Change by Kuba Mracek (formerly Kuba Brecka)
See review here:
https://reviews.llvm.org/D23444
Reviewers: tfiala, compnerd
llvm-svn: 278527
Zachary Turner [Fri, 12 Aug 2016 16:52:31 +0000 (16:52 +0000)]
Fix build on Windows.
llvm-svn: 278526
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 16:46:25 +0000 (16:46 +0000)]
BugReporter: Use ilist_half_embedded_sentinel_traits, NFC
This avoids duplicated code with llvm/ADT/ilist.h. No functionality
change.
llvm-svn: 278525
Greg Clayton [Fri, 12 Aug 2016 16:46:18 +0000 (16:46 +0000)]
Switch over to using socketpair for local debugserver connections as they are twice as fast as TCP sockets (on macOS at least).
This change opens a socket pair and passes the second socket pair file descriptor down to the debugserver binary using a new option: "--fd=N" where N is the file descriptor. This file descriptor gets passed via posix_spawn() so that there is no need to do any bind/listen or bind/accept calls and eliminates the hanshake unix socket that is used to pass the result of the actual port that ends up being used so it can save time on launch as well as being faster.
This is currently only enabled on __APPLE__ builds. Other OSs should try modifying the #define from ProcessGDBRemote.cpp but the first person will need to port the --fd option over to lldb-server. Any OSs that enable USE_SOCKETPAIR_FOR_LOCAL_CONNECTION in their native builds can use the socket pair stuff. The #define is Apple only right now, but looks like:
#if defined (__APPLE__)
#define USE_SOCKETPAIR_FOR_LOCAL_CONNECTION 1
#endif
<rdar://problem/
27814880>
llvm-svn: 278524
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 16:25:04 +0000 (16:25 +0000)]
MachO: Use ilist_half_embedded_sentinel_traits, NFC
Use ilist_half_embedded_sentinel_traits for the list of
lld::mach_o::normalized::TrieEdge, rather than duplicating the code.
llvm-svn: 278523
Dehao Chen [Fri, 12 Aug 2016 16:22:12 +0000 (16:22 +0000)]
Fine tuning of sample profile propagation algorithm.
Summary: The refined propagation algorithm is more accurate and robust.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23224
llvm-svn: 278522
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 16:19:34 +0000 (16:19 +0000)]
Core: Use ilist_full_embedded_sentinel_traits for SimpleReference
Avoid custom code for sentinel traits in SimpleReference (the ilist node
for references to a SimpleDefinedAtom), since they'll soon/eventually
disappear from ilist entirely.
Rather than using a BumpPtrAllocator, this drops the lazy sentinel
characteristics and stores the sentinel directly in the ilist. This
unconditionally allocates the sentinel.
At first glance, this looks like it might increase memory usage
slightly, since an unreferenced SimpleDefinedAtom pays for a
6-pointer-sized sentinel even when its list of references is empty. In
practice, the sentinel was being lazily allocated at the first call to
DefinedAtom::begin/end anyway. I don't expect any real memory effects
here.
Moreover, this is an intermediate state. The ilist_*sentinel_traits are
being phased out.
As a preview of the final state: in lieu of a NodeTy sentinel, the ilist
will have a single, untemplated list_node_base that has next/prev
pointers. This base node will serve both as a sentinel and as a pointer
to the head of the list (the same memory layout as
ilist_half_embedded_sentinel_traits, but without the UB).
llvm-svn: 278521
Artur Pilipenko [Fri, 12 Aug 2016 16:08:30 +0000 (16:08 +0000)]
[x86] X86ISelLowering zext(add_nuw(x, C)) --> add(zext(x), C_zext)
Currently X86ISelLowering has a similar transformation for sexts:
sext(add_nsw(x, C)) --> add(sext(x), C_sext)
In this change I extend this code to handle zexts as well.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D23359
llvm-svn: 278520
Ehsan Amiri [Fri, 12 Aug 2016 16:05:03 +0000 (16:05 +0000)]
[BasicAA] Avoid calling GetUnderlyingObject, when the result of a previous call can be reused.
Recursive calls to aliasCheck from alias[GEP|Select|PHI] may result in a second call to GetUnderlyingObject for a Value, whose underlying object is already computed. This patch ensures that in this situations, the underlying object is not computed again, and the result of the previous call is resued.
https://reviews.llvm.org/D22305
llvm-svn: 278519
Artur Pilipenko [Fri, 12 Aug 2016 15:52:23 +0000 (15:52 +0000)]
[LVI] Take guards into account
Teach LVI to gather control dependant constraints from guards.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D23358
llvm-svn: 278518
Teresa Johnson [Fri, 12 Aug 2016 15:39:26 +0000 (15:39 +0000)]
Add move ops to satisfy MSVC.
Try to appease Windows bots after r278508:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/27250
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/14776
llvm-svn: 278517
Daniel Sanders [Fri, 12 Aug 2016 15:34:35 +0000 (15:34 +0000)]
[mips] Remove obstack.cc XFAIL added in r278504 since it broke X86 and PPC somehow.
Adding the XFAIL has caused msan to report a different line number in the call
stack (@LINE-3 rather than @LINE-30). The new line number looks more correct
at first glance since it's the line that uses uninitialized memory rather than
the first non-whitespace line of the file but this needs investigating.
llvm-svn: 278516
Geoff Berry [Fri, 12 Aug 2016 15:26:00 +0000 (15:26 +0000)]
[AArch64] Re-factor code shared by AArch64LoadStoreOpt and AArch64InstrInfo.
This re-factoring could cause the following slight changes in generated
code, though none were observed during testing:
- MachineScheduler could decide not to cluster some loads/stores if
there are other load/stores with non-pairable opcodes that have the
same base register and offset as a pairable set of load/stores. One
case of different MachineScheduler pairing did show up in my testing,
but it wasn't due to this issue, but due
BaseMemOpClusterMutation::clusterNeighboringMemOps() being unstable
w.r.t. the order it considers memory operations. See PR28942.
- The ImplicitNullChecks optimization could be done for more load/store
opcodes. This optimization isn't done for C/C++ code, so it didn't
show up in my testing.
Reviewers: mcrosier, t.p.northover
Subscribers: aemerson, rengolin, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D23365
llvm-svn: 278515
Artur Pilipenko [Fri, 12 Aug 2016 15:08:15 +0000 (15:08 +0000)]
[LVI] Fix potential memory corruption in getValueFromCondition
Rewrite Visited[Cond] = getValueFromConditionImpl(..., Visited) statement which can lead to a memory corruption since getValueFromConditionImpl changes Visited map and invalidates the iterators.
llvm-svn: 278514
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 15:00:55 +0000 (15:00 +0000)]
ADT: Share code for embedded sentinel traits, NFC
Share code for the (mostly problematic) embedded sentinel traits.
- Move the LLVM_NO_SANITIZE("object-size") attribute to
ilist_half_embedded_sentinel_traits and ilist_embedded_sentinel_traits
(previously it spread throughout the code duplication).
- Add an ilist_full_embedded_sentinel_traits which has no UB (but has
the downside of storing the complete node).
- Replace all the custom sentinel traits in LLVM with a declaration of
ilist_sentinel_traits that inherits from one of the embedded sentinel
traits classes.
There are still custom sentinel traits in other LLVM subprojects. I'll
remove those in a follow-up.
Nothing at all should be changing here, this is just rearranging code.
Note that the final goal here is to remove the sentinel traits
altogether, settling on the memory layout of
ilist_half_embedded_sentinel_traits without the UB. This intermediate
step moves the logic into ilist.h.
llvm-svn: 278513
Teresa Johnson [Fri, 12 Aug 2016 14:55:43 +0000 (14:55 +0000)]
Fix type to avoid problems on 32-bit builds
lto::InputFile::Symbol::getCommonSize should return uint64_t instead of
size_t since it is returning the result of DataLayout::getTypeAllocSize
which returns uint64_t, and the result of getCommonSize is assigned to a
uint64_t variable. On 32-bit builds size_t is unsigned int and there are
type errors. This was introduced in r278338.
llvm-svn: 278512
James Y Knight [Fri, 12 Aug 2016 14:48:09 +0000 (14:48 +0000)]
Revert "[Sparc] Leon errata fix passes."
...and the two followup commits:
Revert "[Sparc][Leon] Missed resetting option flags from check-in 278489."
Revert "[Sparc][Leon] Errata fixes for various errata in different
versions of the Leon variants of the Sparc 32 bit processor."
This reverts commit r274856, r278489, and r278492.
llvm-svn: 278511
Tamas Berghammer [Fri, 12 Aug 2016 14:17:05 +0000 (14:17 +0000)]
Skip 2 android test what is broken because of debuggerd
debuggerd is a crash reporting system on android what installs some
signal handler for SEGV to print a backtrace in the log. Its behavior
breaks tests where the test tries to continue after a SEGV so we skip
them as this behavior isn't required on android anyway.
llvm-svn: 278510
Teresa Johnson [Fri, 12 Aug 2016 14:03:36 +0000 (14:03 +0000)]
[PM] Port NameAnonFunction pass to new pass manager
Summary:
Port the NameAnonFunction pass and add a test.
Depends on D23439.
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23440
llvm-svn: 278509
Teresa Johnson [Fri, 12 Aug 2016 13:53:02 +0000 (13:53 +0000)]
[PM] Port ModuleSummaryIndex analysis to new pass manager
Summary:
Port the ModuleSummaryAnalysisWrapperPass to the new pass manager.
Use it in the ported BitcodeWriterPass (similar to how we use the
legacy ModuleSummaryAnalysisWrapperPass in the legacy WriteBitcodePass).
Also, pass the -module-summary opt flag through to the new pass
manager pipeline and through to the bitcode writer pass, and add
a test that uses it.
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23439
llvm-svn: 278508
Martin Bohme [Fri, 12 Aug 2016 13:51:00 +0000 (13:51 +0000)]
[ASTMatchers] Add templateTypeParmDecl() to Registry.cpp
Summary:
This appears to have been forgotten when templateTypeParmDecl() was initially
added.
Reviewers: alexfh, aaron.ballman
Subscribers: aaron.ballman, klimek, aemerson, rengolin, samparker, cfe-commits
Differential Revision: https://reviews.llvm.org/D23448
llvm-svn: 278507
Davide Italiano [Fri, 12 Aug 2016 12:37:23 +0000 (12:37 +0000)]
[Core] Retire yet another unused member function.
The code in lib/ could use a lot of love :(
llvm-svn: 278506
Davide Italiano [Fri, 12 Aug 2016 12:34:39 +0000 (12:34 +0000)]
[Core] Simplify a bit. NFCI.
llvm-svn: 278505
Daniel Sanders [Fri, 12 Aug 2016 11:56:36 +0000 (11:56 +0000)]
[mips] XFAIL the new mips64el compiler-rt tests that fail on clang-cmake-mipsel.
The mips64el compiler-rt build has recently been enabled. XFAIL the failing
tests to make the buildbot green again.
The two asan tests require the integrated assembler. This will be fixed soon
for Debian mips64el but not for any other mips64el targets since doing so
requires triple-related issues to be fixed..
The msan tests are largely failing because caused by a kernel update (a patch
has already been posted for this).
I'm not sure why the dfsan test fails yet.
llvm-svn: 278504
Simon Pilgrim [Fri, 12 Aug 2016 11:43:57 +0000 (11:43 +0000)]
Fix Wdocumentation unknown parameter warning
llvm-svn: 278503
Simon Pilgrim [Fri, 12 Aug 2016 11:24:34 +0000 (11:24 +0000)]
[X86][SSE] Add support for combining target shuffles to PSLLDQ/PSRLDQ byte shifts
llvm-svn: 278502
Andrey Bokhanko [Fri, 12 Aug 2016 11:22:12 +0000 (11:22 +0000)]
Fix For pr28288 - Error message in shift of vector values
This fixes an error in type checking of shift of vector values.
Patch by Vladimir Yakovlev.
Differential Revision: https://reviews.llvm.org/D21678
llvm-svn: 278501
Pavel Labath [Fri, 12 Aug 2016 11:20:21 +0000 (11:20 +0000)]
Fix-up r278299 for windows
FD_SETSIZE on windows limits the number of file descriptors, rather than their individual
magnitude (the underlying implementation uses an array rather than a bitset). This meant that the
assert in the SelectHelper was incorrect, and failing all the time. Fix that.
I am not sure whether this should be #ifdef MSVC, or #ifdef WINDOWS, but my feeling is that a
more posix-conforming implementation on windows would choose the bitset implementation, so I'm
sticking with the former.
llvm-svn: 278500
Krzysztof Parzyszek [Fri, 12 Aug 2016 11:12:02 +0000 (11:12 +0000)]
[Hexagon] Standardize pseudo-instructions for calls and returns
- CALLv3nr PS_call_nr
- CALLRv3nr PS_callr_nr
- CALLstk PS_call_stk
- TCRETURNi PS_tailcall_i
- TCRETURNr PS_tailcall_r
- JMPret PS_jmpret
- JMPrett PS_jmprett
- JMPretf PS_jmpretf
- JMPrettnew PS_jmprettnew
- JMPretfnew PS_jmpretfnew
- JMPrettnewpt PS_jmprettnewpt
- JMPretfnewpt PS_jmpretfnewpt
llvm-svn: 278499
Krzysztof Parzyszek [Fri, 12 Aug 2016 11:01:10 +0000 (11:01 +0000)]
[Hexagon] Treat non-returning indirect calls as scheduling boundaries
llvm-svn: 278498
Jonas Hahnfeld [Fri, 12 Aug 2016 10:36:04 +0000 (10:36 +0000)]
Fix cuda-detect.cu when CLANG_DEFAULT_CXX_STDLIB is set
Reported by Ismail Donmez!
llvm-svn: 278497
Artur Pilipenko [Fri, 12 Aug 2016 10:14:11 +0000 (10:14 +0000)]
[LVI] Take range metadata into account while calculating icmp condition constraints
Take range metadata into account for conditions like this:
%length = load i32, i32* %length_ptr, !range !{i32 0, i32
2147483647}
%cmp = icmp ult i32 %a, %length
This is a common pattern for range checks where the length of the array is dynamically loaded.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D23267
llvm-svn: 278496
Benjamin Kramer [Fri, 12 Aug 2016 10:13:45 +0000 (10:13 +0000)]
[Webassembly] disable unstable test.
It reads uninitialized memory and crashes randomly.
llvm-svn: 278495
Simon Pilgrim [Fri, 12 Aug 2016 10:10:51 +0000 (10:10 +0000)]
[X86][SSE] Fixed PALIGNR target shuffle decode
The PALIGNR target shuffle decode was not taking into account that DecodePALIGNRMask (rather oddly) expects the operands to be in reverse order, nor was it detecting unary patterns, causing combines to combine with the incorrect input.
The cgbuiltin, auto upgrade and instruction comments code correctly swap the operands so are not affected.
llvm-svn: 278494
Artur Pilipenko [Fri, 12 Aug 2016 10:05:11 +0000 (10:05 +0000)]
[LVI] Handle any predicate in comparisons like icmp <pred> (add Val, Offset), ...
Currently LVI can only gather value constraints from comparisons like:
* icmp <pred> Val, ...
* icmp ult (add Val, Offset), ...
In fact we can handle any predicate in latter comparisons.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D23357
llvm-svn: 278493
Chris Dewhurst [Fri, 12 Aug 2016 09:54:39 +0000 (09:54 +0000)]
[Sparc][Leon] Missed resetting option flags from check-in 278489.
llvm-svn: 278492
Pavel Labath [Fri, 12 Aug 2016 09:52:14 +0000 (09:52 +0000)]
XFAIL TestNamespaceDefinitions on gcc-4.8 and below
llvm-svn: 278491
Pavel Labath [Fri, 12 Aug 2016 09:39:22 +0000 (09:39 +0000)]
Make TestCallStopAndContinue clang-format-resilient
llvm-svn: 278490