Malcolm Parsons [Wed, 2 Nov 2016 10:39:27 +0000 (10:39 +0000)]
Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: aaron.ballman, mehdi_amini, dblaikie
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26206
llvm-svn: 285799
Pavel Labath [Wed, 2 Nov 2016 10:29:47 +0000 (10:29 +0000)]
Fix printf errors in ProcessMinidump
llvm-svn: 285798
Pavel Labath [Wed, 2 Nov 2016 10:27:54 +0000 (10:27 +0000)]
Remove TimeValue from UnwindLLDB.cpp
Really NFC, as the code is #ifdefed out, but I did make sure it compiles if I enable it.
llvm-svn: 285797
George Rimar [Wed, 2 Nov 2016 10:16:25 +0000 (10:16 +0000)]
[ELF] - Check that .dynsym is present in DSO if SHT_GNU_versym section is.
When we have SHT_GNU_versym section, it is should be associated with symbol table
section. Usually (and in out implementation) it is .dynsym.
In case when .dynsym is absent (due to broken object for example),
lld crashes in parseVerdefs() when accesses null pointer:
Versym = reinterpret_cast<const Elf_Versym *>(this->ELFObj.base() +
VersymSec->sh_offset) +
this->Symtab->sh_info;
DIfferential revision: https://reviews.llvm.org/D25553
llvm-svn: 285796
Pavel Labath [Wed, 2 Nov 2016 10:13:54 +0000 (10:13 +0000)]
Remove TimeValue usages from MacOSX-Kernel process plugin. NFC
llvm-svn: 285795
Kirill Bobyrev [Wed, 2 Nov 2016 10:00:40 +0000 (10:00 +0000)]
[llvm] FIx if-clause -Wmisleading-indentation issue.
While bootstrapping Clang with recent `gcc 6.2.0` I found a bug related to misleading indentation.
I believe, a pair of `{}` was forgotten, especially given the above similar piece of code:
```
if (!RDef || !HII->isPredicable(*RDef)) {
Done = coalesceRegisters(RD, RegisterRef(S1));
if (Done) {
UpdRegs.insert(RD.Reg);
UpdRegs.insert(S1.getReg());
}
}
```
Reviewers: kparzysz
Differential Revision: https://reviews.llvm.org/D26204
llvm-svn: 285794
Bjorn Pettersson [Wed, 2 Nov 2016 08:55:19 +0000 (08:55 +0000)]
[Reassociate] Skip analysis of dead code to avoid infinite loop.
Summary:
It was detected that the reassociate pass could enter an inifite
loop when analysing dead code. Simply skipping to analyse basic
blocks that are dead avoids such problems (and as a side effect
we avoid spending time on optimising dead code).
The solution is using the same Reverse Post Order ordering of the
basic blocks when doing the optimisations, as when building the
precalculated rank map. A nice side-effect of this solution is
that we now know that we only try to do optimisations for blocks
with ranked instructions.
Fixes https://llvm.org/bugs/show_bug.cgi?id=30818
Reviewers: llvm-commits, davide, eli.friedman, mehdi_amini
Subscribers: dberlin
Differential Revision: https://reviews.llvm.org/D26154
llvm-svn: 285793
Roger Ferrer Ibanez [Wed, 2 Nov 2016 08:36:43 +0000 (08:36 +0000)]
Remove spurious token from #endif
llvm-svn: 285792
Roger Ferrer Ibanez [Wed, 2 Nov 2016 08:14:57 +0000 (08:14 +0000)]
Protect tests for new/delete under libcpp-no-exceptions
Skip the tests that expect an exception be thrown and protect unreachable catch blocks.
Differential Revision: https://reviews.llvm.org/D26197
llvm-svn: 285791
Dylan McKay [Wed, 2 Nov 2016 06:47:40 +0000 (06:47 +0000)]
[AVR] Add instruction selection lowering code
Summary: This adds AVRISelLowering.cpp
Reviewers: arsenm, kparzysz
Subscribers: llvm-commits, modocache, japaric, wdng, beanz, mgorny
Differential Revision: https://reviews.llvm.org/D25034
llvm-svn: 285790
Shoaib Meenai [Wed, 2 Nov 2016 06:10:03 +0000 (06:10 +0000)]
[CMake] Set default build type correctly
At least with cmake 3.6.1, the default build type setting was having no
effect; the generated CMakeCache.txt still had an empty CMAKE_BUILD_TYPE.
Force the variable to be set to achieve the desired behavior.
Differential Revision: https://reviews.llvm.org/D26200
llvm-svn: 285789
Eric Fiselier [Wed, 2 Nov 2016 05:08:58 +0000 (05:08 +0000)]
Fix GCC test failure caused by manually defining _LIBCPP_HAS_NO_VARIADICS
llvm-svn: 285788
Dean Michael Berris [Wed, 2 Nov 2016 04:11:29 +0000 (04:11 +0000)]
[XRay][x86_64] Define a tail exit trampoline.
Summary:
We define a new trampoline that's a hybrid between the exit and entry
trampolines with the following properties:
- Saves all of the callee-saved registers according to the x86_64
calling conventions.
- Indicate to the log handler function being called that this is a
function exit event.
This fixes a bug that is a result of not saving enough of the register
states, and that the log handler is clobbering registers that would be
used by the function being tail-exited into manifesting as runtime
errors.
Reviewers: rSerge, echristo, majnemer
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D26020
llvm-svn: 285787
Eric Fiselier [Wed, 2 Nov 2016 03:57:34 +0000 (03:57 +0000)]
Fix __libcpp_is_constructible for source types with explicit conversion operators.
Previously __libcpp_is_constructible checked the validity of reference
construction using 'eat<To>(declval<From>())' but this doesn't consider
From's explicit conversion operators. This patch teaches __libcpp_is_constructible
how to handle these cases. To do this we need to check the validity
using 'static_cast<To>(declval<From>())'. Unfortunately static_cast allows
additional base-to-derived and lvalue-to-rvalue conversions, which have to be
checked for and manually rejected.
While implementing these changes I discovered that Clang incorrectly
rejects `static_cast<int&&>(declval<float&>())` even though
`int &&X(declval<float&>())` is well formed. In order to tolerate this bug
the `__eat<T>(...)` needs to be left in-place. Otherwise it could be replaced
entirely with the new static_cast implementation.
Thanks to Walter Brown for providing the test cases.
llvm-svn: 285786
Peter Collingbourne [Wed, 2 Nov 2016 02:58:47 +0000 (02:58 +0000)]
Bitcode: Fix short read implementation.
We need to zero extend the byte in order to correctly shift it into a
64-bit value.
llvm-svn: 285785
Rui Ueyama [Wed, 2 Nov 2016 02:18:01 +0000 (02:18 +0000)]
Add strings to .dynstr early.
Previously, we added strings from DynamicSection::finalize().
It was a bit tricky because finalize() is supposed to fix the final
size of the section, but adding new strings would change the size of
.dynstr section. So there was a dependency between finalize functions
of .dynamic and .dynstr.
However, I noticed that we can elimiante the dependency by simply
add strings early; we don't have to do that in finalize() but can do
from DynamicSection's ctor.
This patch defines a new function, DynamicSection::addEntries, to
add .dynamic entries that doesn't depend on other sections.
llvm-svn: 285784
Brad Smith [Wed, 2 Nov 2016 01:39:01 +0000 (01:39 +0000)]
Disable the use of std::call_once on OpenBSD with libstdc++.
It was noticed this caused performance regressions and deadlocks. PR30768.
Reorder the code to make it clearer what is tested.
PPC now disables the use of std::call_once only with libstdc++ with
the reordering of the code, as was the original intent.
llvm-svn: 285782
Jim Ingham [Wed, 2 Nov 2016 01:06:42 +0000 (01:06 +0000)]
Fix SBWatchpoint::SetEnabled to send an event.
We really shouldn't be sending events for SB API's, dunno when we started
doing that. We don't do it for other things. But first restore the status quo.
llvm-svn: 285781
Michael Gottesman [Wed, 2 Nov 2016 00:59:58 +0000 (00:59 +0000)]
[ilist_node] Add a getReverseIterator() method and a unittest for it.
This is the reverse_iterator analogue of getIterator().
llvm-svn: 285780
Richard Smith [Wed, 2 Nov 2016 00:47:52 +0000 (00:47 +0000)]
More forcibly resolve exception specifications when checking a function
redeclaration in C++1z mode. We need the exception specification in order for
the function's type to be complete.
llvm-svn: 285779
Eugene Zelenko [Wed, 2 Nov 2016 00:43:23 +0000 (00:43 +0000)]
[Documentation] Clang-tidy readability-redundant-declaration consistency.
Release notes checks order and consistent Clang-tidy readability-redundant-declaration description.
llvm-svn: 285778
Peter Collingbourne [Wed, 2 Nov 2016 00:39:11 +0000 (00:39 +0000)]
Bitcode: Check file size before reading bitcode header.
Should unbreak ocaml binding tests.
Also added an llvm-dis test that checks for the same thing.
llvm-svn: 285777
Rui Ueyama [Wed, 2 Nov 2016 00:29:06 +0000 (00:29 +0000)]
Use ArrayRef instead of const std::vector.
llvm-svn: 285776
Rui Ueyama [Wed, 2 Nov 2016 00:16:43 +0000 (00:16 +0000)]
Make a function in a header "inline" instead of "static".
llvm-svn: 285775
Peter Collingbourne [Wed, 2 Nov 2016 00:08:37 +0000 (00:08 +0000)]
Support: Remove MemoryObject and DataStreamer interfaces.
These interfaces are no longer used.
Differential Revision: https://reviews.llvm.org/D26222
llvm-svn: 285774
Peter Collingbourne [Wed, 2 Nov 2016 00:08:19 +0000 (00:08 +0000)]
Bitcode: Change reader interface to take memory buffers.
As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106595.html
This change also fixes an API oddity where BitstreamCursor::Read() would
return zero for the first read past the end of the bitstream, but would
report_fatal_error for subsequent reads. Now we always report_fatal_error
for all reads past the end. Updated clients to check for the end of the
bitstream before reading from it.
I also needed to add padding to the invalid bitcode tests in
test/Bitcode/. This is because the streaming interface was not checking that
the file size is a multiple of 4.
Differential Revision: https://reviews.llvm.org/D26219
llvm-svn: 285773
Vedant Kumar [Tue, 1 Nov 2016 23:55:50 +0000 (23:55 +0000)]
[docs] Fix some typos. NFC.
llvm-svn: 285772
Alex Bradbury [Tue, 1 Nov 2016 23:47:30 +0000 (23:47 +0000)]
[RISCV] Add bare-bones RISC-V MCTargetDesc
This is enough to compile and link but doesn't yet do anything particularly
useful. Once an ASM parser and printer are added in the next two patches, the
whole thing can be usefully tested.
Differential Revision: https://reviews.llvm.org/D23562
llvm-svn: 285770
Alex Bradbury [Tue, 1 Nov 2016 23:40:28 +0000 (23:40 +0000)]
[RISCV 4/10] Add basic RISCV{InstrFormats,InstrInfo,RegisterInfo,}.td
For now, only add instruction definitions for basic ALU operations. Our
initial target is a working MC layer rather than codegen, so appropriate
SelectionDAG patterns will come later.
Differential Revision: https://reviews.llvm.org/D23561
llvm-svn: 285769
Matt Arsenault [Tue, 1 Nov 2016 23:22:17 +0000 (23:22 +0000)]
AMDGPU: Handle CopyToReg in getOperandRegClass
llvm-svn: 285768
Rui Ueyama [Tue, 1 Nov 2016 23:17:47 +0000 (23:17 +0000)]
Inline a variable that is used only once.
llvm-svn: 285767
Rui Ueyama [Tue, 1 Nov 2016 23:17:45 +0000 (23:17 +0000)]
Split writeResult. NFC.
This is now doable because this code doesn't have to be in the
dynamic scope of Writer::run().
llvm-svn: 285766
Matt Arsenault [Tue, 1 Nov 2016 23:14:20 +0000 (23:14 +0000)]
AMDGPU: Use brev for materializing SGPR constants
This is already done with VGPR immediates and saves 4 bytes.
llvm-svn: 285765
Rui Ueyama [Tue, 1 Nov 2016 23:12:51 +0000 (23:12 +0000)]
Create Out members using make() to simplify.
llvm-svn: 285764
Rui Ueyama [Tue, 1 Nov 2016 23:09:07 +0000 (23:09 +0000)]
Remove Out::Pool and use make() instead.
llvm-svn: 285763
Matt Arsenault [Tue, 1 Nov 2016 22:55:07 +0000 (22:55 +0000)]
AMDGPU: Default to using scalar mov to materialize immediate
This is the conservatively correct way because it's easy to
move or replace a scalar immediate. This was incorrect in the case
when the register class wasn't known from the static instruction
definition, but still needed to be an SGPR. The main example of this
is inlineasm has an SGPR constraint.
Also start verifying the register classes of inlineasm operands.
llvm-svn: 285762
Jim Ingham [Tue, 1 Nov 2016 22:53:54 +0000 (22:53 +0000)]
Xfail this while I figure out why the event isn't getting sent.
llvm-svn: 285761
Rui Ueyama [Tue, 1 Nov 2016 22:53:18 +0000 (22:53 +0000)]
Provide a convenient function to allocate and initialize objects.
You can now write make<T>(Args) instead of new (alloc<T>()) T(Args).
llvm-svn: 285760
Devin Coughlin [Tue, 1 Nov 2016 22:16:39 +0000 (22:16 +0000)]
[analyzer] Fix capitalization in ObjCSuperDealloc checker diagnostic.
Change "use of 'self'..." to "Use of 'self'...". The convention is to
start diagnostics with a capital letter.
rdar://problem/
28322494
llvm-svn: 285759
Eric Christopher [Tue, 1 Nov 2016 22:15:50 +0000 (22:15 +0000)]
Move the initialization of PreferredLoopExit into runOnMachineFunction to be near the other function specific initializations.
llvm-svn: 285758
Sam McCall [Tue, 1 Nov 2016 22:02:14 +0000 (22:02 +0000)]
Fix uninitialized access in MachineBlockPlacement.
Summary:
Currently PreferredLoopExit is set only in buildLoopChains, which is
never called if there are no MachineLoops.
MSan is currently broken by this:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/145/steps/check-llvm%20msan/logs/stdio
This is a naive fix to get things green again. iteratee: you may have a better fix.
This change will also mean PreferredLoopExit will not carry over if
buildCFGChains() is called a second time in runOnMachineFunction, this
appears to be the right thing.
Reviewers: bkramer, iteratee, echristo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26069
llvm-svn: 285757
Matt Arsenault [Tue, 1 Nov 2016 21:58:07 +0000 (21:58 +0000)]
AMDGPU: Stop creating unused virtual registers
These are only used in the spill to VMEM path. Move them to
the one use.
llvm-svn: 285756
Rafael Espindola [Tue, 1 Nov 2016 21:48:00 +0000 (21:48 +0000)]
Don't fetch the section string table multiple times. NFC.
llvm-svn: 285755
Rafael Espindola [Tue, 1 Nov 2016 21:34:26 +0000 (21:34 +0000)]
Update for llvm change.
We no longer use the section names in this test.
llvm-svn: 285754
Rafael Espindola [Tue, 1 Nov 2016 21:33:55 +0000 (21:33 +0000)]
Don't compute DotShstrtab eagerly.
This saves a field that is not always used. It also avoids failing a
program that doesn't need the section names.
llvm-svn: 285753
Malcolm Parsons [Tue, 1 Nov 2016 21:26:53 +0000 (21:26 +0000)]
[clang-tidy] Handle bitfields in cppcoreguidelines-pro-type-member-init
Summary:
Unnamed bitfields cannot be initialized.
Bitfields cannot be in-class initialized.
Reviewers: alexfh, hokein, aaron.ballman
Subscribers: Prazek, nemanjai, cfe-commits
Differential Revision: https://reviews.llvm.org/D26119
llvm-svn: 285752
Rui Ueyama [Tue, 1 Nov 2016 21:26:28 +0000 (21:26 +0000)]
Remove string table offsets from tests.
<N> where "foo (<N>)" is the offset of string "foo" in the string table.
llvm-svn: 285751
George Burgess IV [Tue, 1 Nov 2016 21:17:46 +0000 (21:17 +0000)]
[MemorySSA] Tighten up types to make our API prettier. NFC.
Patch by bryant.
Differential Revision: https://reviews.llvm.org/D26126
llvm-svn: 285750
Zachary Turner [Tue, 1 Nov 2016 21:08:34 +0000 (21:08 +0000)]
Add missing #include.
llvm-svn: 285749
Rafael Espindola [Tue, 1 Nov 2016 21:06:40 +0000 (21:06 +0000)]
Replace GAlloc with a template function.
This patch replaces GAlloc<ELFT>::<sometype>.Allocate() with
alloc<sometype<ELFT>>().
Patch by Rui!
llvm-svn: 285748
Rafael Espindola [Tue, 1 Nov 2016 20:56:15 +0000 (20:56 +0000)]
Simplify getStringTableIndex.
The description in the ELF spec is just
---------------------------
If the section name string table section index is greater than or
equal to SHN_LORESERVE (0xff00), this member has the value SHN_XINDEX
(0xffff) and the actual index of the section name string table section
is contained in the sh_link field of the section header at index 0.
---------------------------
So we only have to check for it being SHN_XINDEX. Also, sh_link is
always 32 bits, so don't return an uintX_t.
llvm-svn: 285747
Eli Friedman [Tue, 1 Nov 2016 20:53:11 +0000 (20:53 +0000)]
[ScopInfo] Make memset etc. affine where possible.
We don't actually check whether a MemoryAccess is affine in very many
places, but one important one is in checks for aliasing.
Differential Revision: https://reviews.llvm.org/D25706
llvm-svn: 285746
Eli Friedman [Tue, 1 Nov 2016 20:45:28 +0000 (20:45 +0000)]
Add missing test from r284848.
Original commit title: [SCEVAffinator] Make precise modular math
more correct.
llvm-svn: 285745
Sanjay Patel [Tue, 1 Nov 2016 20:43:00 +0000 (20:43 +0000)]
[ValueTracking] remove TODO comment; NFC
InstCombine should always canonicalize patterns like the one shown in the comment
when visiting 'select' insts in adjustMinMax().
Scalars were already handled there, and vector splats are handled after:
https://reviews.llvm.org/rL285732
llvm-svn: 285744
Matt Arsenault [Tue, 1 Nov 2016 20:42:24 +0000 (20:42 +0000)]
AMDGPU: Workaround for instruction size with literals
Instructions with a 32-bit base encoding with an optional
32-bit literal encoded after them report their size as 4
for the disassembler. Consider these when computing the
MachineInstr size. This fixes problems caused by size estimate
consistency in BranchRelaxation.
llvm-svn: 285743
Jim Ingham [Tue, 1 Nov 2016 20:37:02 +0000 (20:37 +0000)]
Switch SBWatchpoint::SetEnabled over to using Process::{Enable,Disable}Watchpoint.
We don't have a good story for what happens to watchpoints when you don't
have a process, or if your process exits. Clearing that up will instruct
how to fix this for real.
Also added a test to make sure disable->enable works as well.
This resolves llvm.org/pr30789.
llvm-svn: 285742
Michal Gorny [Tue, 1 Nov 2016 20:31:52 +0000 (20:31 +0000)]
[test] Fix detecting LLVM zlib support in stand-alone builds
Fix the test run to declare missing HAVE_LIBZ value in stand-alone
builds, using the LLVM_ENABLE_ZLIB that is exported in LLVMConfig.cmake.
When using in-tree builds, HAVE_LIBZ is declared in
cmake/config-ix.cmake as a result of LLVM's CMake checks. When building
stand-alone, this value is not available and as a result caused clang to
wrongly assume that LLVM was built without zlib support.
To fix it, set it to the value of LLVM_ENABLE_ZLIB. While this variable
is originally used to control the user preference, LLVM updates its
value to 0 if zlib checks fail. Therefore, we can use it to reliably
determine whether LLVM was built with zlib support or not.
Differential Revision: https://reviews.llvm.org/D24869
llvm-svn: 285741
Rui Ueyama [Tue, 1 Nov 2016 20:28:21 +0000 (20:28 +0000)]
Create SyntheticSections.cpp.
We are going to have many more classes for linker-synthesized
input sections, so it's worth to be added to a separate file
than to the file for regular input sections.
llvm-svn: 285740
Rafael Espindola [Tue, 1 Nov 2016 20:25:27 +0000 (20:25 +0000)]
Update for llvm change.
llvm-svn: 285739
Rafael Espindola [Tue, 1 Nov 2016 20:24:22 +0000 (20:24 +0000)]
Use the existing std::error_code out parameter.
This avoids calling exit with a partially constructed object.
llvm-svn: 285738
Chris Bieneman [Tue, 1 Nov 2016 20:19:33 +0000 (20:19 +0000)]
Fix llvm-shlib cmake build
Summary:
This fixes a few things that used to work with a Makefile build, but were broken in cmake.
1. Treat MINGW like a Linux system.
2. The shlib should never contain other shared libraries.
Patch By: Valentin Churavy
Reviewers: axw, beanz
Subscribers: modocache, beanz, mgorny
Differential Revision: https://reviews.llvm.org/D25865
llvm-svn: 285737
Enrico Granata [Tue, 1 Nov 2016 20:17:14 +0000 (20:17 +0000)]
Add helpers for the notion of a type scavenger that is "either this or that" source, and one that is "both this and that" source
Use the helper to rewrite the ObjC type lookup logic (first modules, then runtime) in terms of an either scavenger
llvm-svn: 285736
Davide Italiano [Tue, 1 Nov 2016 20:11:01 +0000 (20:11 +0000)]
[ELF/GC] Fix pending references to garbage collected sections.
The example reported in PR30793 shows a case where gc reclaims
a SHF_TLS section, but it doesn't reclaim the section containing
the debug info for it.
This is expected, as we do not reclaim non-alloc sections
during the garbage collection phase (and this is not going to
change anytime soon, at least this is what I gathered last I
talked with Rafael about it).
So, we end up with a pending reference, thinking that the input
was invalid (which is not true, as it's GC that removed the
SHT_TLS section, and therefore didn't create the PT_TLS *segment*
for it). In cases like this, just assign a VA of zero at relocation
time instead of error'ing out (this is what gold does as well, FWIW).
Differential Revision: https://reviews.llvm.org/D26201
llvm-svn: 285735
Joerg Sonnenberger [Tue, 1 Nov 2016 20:09:41 +0000 (20:09 +0000)]
GC empty subdirectories.
llvm-svn: 285734
NAKAMURA Takumi [Tue, 1 Nov 2016 20:08:17 +0000 (20:08 +0000)]
clang/test/CodeGenOpenCL/convergent.cl: Satisfy -Asserts with "opt -instnamer".
llvm-svn: 285733
Sanjay Patel [Tue, 1 Nov 2016 20:08:02 +0000 (20:08 +0000)]
[InstCombine] allow splat vector folds in adjustMinMax()
llvm-svn: 285732
Malcolm Parsons [Tue, 1 Nov 2016 20:07:05 +0000 (20:07 +0000)]
[clang-query] Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: pcc, dblaikie
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26205
llvm-svn: 285731
Alex Bradbury [Tue, 1 Nov 2016 19:31:30 +0000 (19:31 +0000)]
[RISCV] Add RISCV.def to module.modulemap
llvm-svn: 285730
Sanjay Patel [Tue, 1 Nov 2016 19:19:29 +0000 (19:19 +0000)]
[InstCombine] Fold nuw left-shifts in `ugt`/`ule` comparisons.
This transforms
%a = shl nuw %x, c1
%b = icmp {ugt|ule} %a, c0
into
%b = icmp {ugt|ule} %x, (c0 >> c1)
z3:
(declare-const x (_ BitVec 64))
(declare-const c0 (_ BitVec 64))
(declare-const c1 (_ BitVec 64))
(push)
(assert (= x (bvlshr (bvshl x c1) c1))) ; nuw
(assert (not (= (bvugt (bvshl x c1) c0)
(bvugt x
(bvlshr c0 c1)))))
(check-sat)
(get-model)
(pop)
(push)
(assert (= x (bvlshr (bvshl x c1) c1))) ; nuw
(assert (not (= (bvule (bvshl x c1) c0)
(bvule x
(bvlshr c0 c1)))))
(check-sat)
(get-model)
(pop)
Patch by bryant!
Differential Revision: https://reviews.llvm.org/D25913
llvm-svn: 285729
Krzysztof Parzyszek [Tue, 1 Nov 2016 19:02:10 +0000 (19:02 +0000)]
[Hexagon] Rename operand/predicate names for unshifted integers
For example, rename s6Ext to s6_0Ext. The names for shifted integers
include the underscore and this will make the naming consistent. It
also exposed a few duplicates that were removed.
llvm-svn: 285728
Enrico Granata [Tue, 1 Nov 2016 18:50:49 +0000 (18:50 +0000)]
Implement a general type scavenger that can dig types from debug info + a filtering mechanism to accept/reject results thusly obtained
Implement the C++ type lookup support in terms of this general scavenger
The idea is that we may want other languages to do debug info based search (exclusively, or as an add-on to runtime/module based searching) and it makes sense to avoid duplicating this functionality
llvm-svn: 285727
Todd Fiala [Tue, 1 Nov 2016 18:50:34 +0000 (18:50 +0000)]
change ProcessAttach test to no-debug-info
Fixes:
https://bugs.swift.org/browse/SR-3103
llvm-svn: 285726
Yaxun Liu [Tue, 1 Nov 2016 18:45:32 +0000 (18:45 +0000)]
[OpenCL] Mark group functions as convergent in opencl-c.h
Certain OpenCL builtin functions are supposed to be executed by all threads in a work group or sub group. Such functions should not be made divergent during transformation. It makes sense to mark them with convergent attribute.
The adding of convergent attribute is based on Ettore Speziale's work and the original proposal and patch can be found at https://www.mail-archive.com/cfe-commits@lists.llvm.org/msg22271.html.
Differential Revision: https://reviews.llvm.org/D25343
llvm-svn: 285725
Matt Arsenault [Tue, 1 Nov 2016 18:34:00 +0000 (18:34 +0000)]
BranchRelaxation: Expand unconditional branches first
It's likely if a conditional branch needs to be expanded, the following
unconditional branch will also need expansion. By expanding the
unconditional branch first, the conditional branch can be simply
inverted to jump over the inserted indirect branch block. If the
conditional branch is expanded first, it results in an additional
branch.
This avoids test regressions in future commits.
llvm-svn: 285722
Eugene Zelenko [Tue, 1 Nov 2016 18:33:50 +0000 (18:33 +0000)]
[Clang-tidy] Fix copy-paste error in misc-redundant-expression detected by PVS-Studio
Also fix some Include What You Use and modernize-use-bool-literals warnings.
Differential revision: https://reviews.llvm.org/D26176
llvm-svn: 285721
Rui Ueyama [Tue, 1 Nov 2016 18:30:28 +0000 (18:30 +0000)]
Implement R_PPC_ADDR32.
Patch from Jack Andersen.
llvm-svn: 285720
Rui Ueyama [Tue, 1 Nov 2016 18:30:26 +0000 (18:30 +0000)]
Implement R_PPC_REL24 and R_PPC_REL32 relocations.
This enables LLD to relocate PC-relative R_PPC_REL32 and
R_PPC_REL24 types (as used in bl instructions).
Patch from Jack Andersen!
llvm-svn: 285719
Sanjay Patel [Tue, 1 Nov 2016 18:15:03 +0000 (18:15 +0000)]
[InstCombine] clean up adjustMinMax(); NFCI
1. Change param names for readability
2. Change pointer param to ref
3. Early exit to reduce indent
4. Change switch to if/else
llvm-svn: 285718
Erich Keane [Tue, 1 Nov 2016 17:54:05 +0000 (17:54 +0000)]
Test Commit, removed extraneous newline
llvm-svn: 285717
Konstantin Zhuravlyov [Tue, 1 Nov 2016 17:49:33 +0000 (17:49 +0000)]
[AMDGPU] Check if type transforms to i16 (VI+) when getting AMDGPUISD::FFBH_U32
This will prevent following regression when enabling i16 support (D18049):
test/CodeGen/AMDGPU/ctlz.ll
test/CodeGen/AMDGPU/ctlz_zero_undef.ll
Differential Revision: https://reviews.llvm.org/D25802
llvm-svn: 285716
Sanjay Patel [Tue, 1 Nov 2016 17:46:08 +0000 (17:46 +0000)]
[InstCombine] add helper function for adjustMinMax(); NFCI
This is just a cut and paste; clean-up and enhancements to follow.
llvm-svn: 285715
Chris Bieneman [Tue, 1 Nov 2016 17:44:58 +0000 (17:44 +0000)]
[CMake] Fix rpath construction for out-of-tree builds
This patch was produced in conjunction with Michał Górny. It should resolve the issues that were trying to be solved by D25304.
This moves rpath handling into `llvm_add_library` and `add_llvm_executable` so that it is available to all projects using AddLLVM whether built in-tree or out-of-tree.
llvm-svn: 285714
Sanjay Patel [Tue, 1 Nov 2016 17:34:29 +0000 (17:34 +0000)]
[InstCombine] add vector tests for ext+adjust min/max
llvm-svn: 285713
Alex Bradbury [Tue, 1 Nov 2016 17:27:54 +0000 (17:27 +0000)]
[RISCV] Add stub backend
This contains just enough for lib/Target/RISCV to compile. Notably a basic
RISCVTargetMachine and RISCVTargetInfo. At this point you can attempt llc
-march=riscv32 myinput.ll and will find it fails due to the lack of
MCAsmInfo.
See http://lists.llvm.org/pipermail/llvm-dev/2016-August/103748.html for
further discussion
Differential Revision: https://reviews.llvm.org/D23560
llvm-svn: 285712
Tom Stellard [Tue, 1 Nov 2016 17:20:03 +0000 (17:20 +0000)]
AMDGPU: Fix buildbots broken by r285704
llvm-svn: 285711
Eugene Zelenko [Tue, 1 Nov 2016 17:11:10 +0000 (17:11 +0000)]
Fix RHEL 6 build with missing cerrno and some other Include What You Use warnings.
Differential revision: https://reviews.llvm.org/D26171
llvm-svn: 285710
Alex Bradbury [Tue, 1 Nov 2016 17:09:49 +0000 (17:09 +0000)]
[RISCV] Add missing RISCV.def
Fix rL285708
llvm-svn: 285709
Alex Bradbury [Tue, 1 Nov 2016 16:59:37 +0000 (16:59 +0000)]
[RISCV] Add RISC-V ELF defines
Add the necessary definitions for RISC-V ELF files, including relocs. Also
make necessary trivial change to ELFYaml, llvm-objdump, and llvm-readobj in
order to work with RISC-V ELFs.
Differential Revision: https://reviews.llvm.org/D23557
llvm-svn: 285708
Alex Bradbury [Tue, 1 Nov 2016 16:47:54 +0000 (16:47 +0000)]
[RISCV] Recognise riscv32 and riscv64 in triple parsing code
This is the first in a series of 10 initial patches that incrementally add an
MC layer for RISC-V to LLVM. See
<http://lists.llvm.org/pipermail/llvm-dev/2016-August/103748.html> for more
discussion.
Differential Revision: https://reviews.llvm.org/D23557
llvm-svn: 285707
Sanjay Patel [Tue, 1 Nov 2016 16:39:30 +0000 (16:39 +0000)]
[InstCombine] move/fix tests for adjusted min/max
I think the former 'test50' had a typo making it functionally equivalent
to the former 'test49'; changed the predicate to provide more coverage.
llvm-svn: 285706
Alex Bradbury [Tue, 1 Nov 2016 16:32:05 +0000 (16:32 +0000)]
[TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.h
As it stands, the OperandMatchResultTy is only included in the generated
header if there is custom operand parsing. However, almost all backends
make use of MatchOperand_Success and friends from OperandMatchResultTy for
e.g. parseRegister. This is a pain when starting an AsmParser for a new
backend that doesn't yet have custom operand parsing. Move the enum to
MCTargetAsmParser.h.
This patch is a prerequisite for D23563
Differential Revision: https://reviews.llvm.org/D23496
llvm-svn: 285705
Tom Stellard [Tue, 1 Nov 2016 16:31:48 +0000 (16:31 +0000)]
AMDGPU: Implement expansion of f16 = FP_TO_FP16 f64
I wanted to implement this as a target independent expansion, however when
targets say they want to expand FP_TO_FP16 what they actually want is
the unsafe math expansion when possible and expansion to a libcall in all
other cases.
The only way to make this work as a target independent would be to add logic
to target's TargetLowering construction to mark theses nodes as Expand when
LegalizeDAG can use the unsafe expansion and mark them as LibCall when it
cannot. I think this would be possible, but I think it would be too fragile
and complex as it would require targets to keep their expansion logic up
to date with the code in LegalizeDAG.
Reviewers: bogner, ab, t.p.northover, arsenm
Subscribers: wdng, llvm-commits, nhaehnle
Differential Revision: https://reviews.llvm.org/D25999
llvm-svn: 285704
Andrey Churbanov [Tue, 1 Nov 2016 16:19:04 +0000 (16:19 +0000)]
Fixed problem introduced by part of https://reviews.llvm.org/D21196.
Check Task Scheduling Constraint (TSC) on stealing of untied task.
This is needed because the untied task can produce tied children
those can break TSC if untied is not a descendant of current task.
This can cause live lock on complex tyasking tests
(e.g. kastors/strassen-task-dep).
Differential Revision: https://reviews.llvm.org/D26182
llvm-svn: 285703
Pavel Labath [Tue, 1 Nov 2016 16:11:14 +0000 (16:11 +0000)]
Remove TimeValue usage from FileSpec.h
Summary:
The only usage there was in GetModificationTime(). I also took the opportunity
to move this function from FileSpec to the FileSystem class - since we are
using FileSpecs to also represent remote files for which we cannot (easily)
retrieve modification time, it makes sense to make the decision to get the
modification time more explicit.
The new function returns a llvm::sys::TimePoint<>. To aid the transition
from TimeValue, I have added a constructor to it which enables implicit
conversion from a time_point.
Reviewers: zturner, clayborg
Subscribers: mehdi_amini, tberghammer, danalbert, beanz, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D25392
llvm-svn: 285702
Sjoerd Meijer [Tue, 1 Nov 2016 15:59:37 +0000 (15:59 +0000)]
This is a 1 character fix for an ARM build attribute test (r284571): the
purpose of the test was to have 2 different function attribute sets, but due
to a typo there was only one both with number #0.
llvm-svn: 285701
Alexey Bader [Tue, 1 Nov 2016 15:50:52 +0000 (15:50 +0000)]
[OpenCL] Override supported OpenCL extensions with -cl-ext option
Summary:
This patch adds a command line option '-cl-ext' to control a set of
supported OpenCL extensions. Option accepts a comma-separated list
of extensions prefixed with '+' or '-'.
It can be used together with a target triple to override support for some
extensions:
// spir target supports all extensions, but we want to disable fp64
clang -cc1 -triple spir-unknown-unknown -cl-ext=-cl_khr_fp64
Special 'all' extension allows to enable or disable all possible
extensions:
// only fp64 will be supported
clang -cc1 -triple spir-unknown-unknown -cl-ext=-all,+cl_khr_fp64
Patch by asavonic (Andrew Savonichev).
Reviewers: joey, yaxunl
Subscribers: yaxunl, bader, Anastasia, cfe-commits
Differential Revision: https://reviews.llvm.org/D23712
llvm-svn: 285700
Sanjay Patel [Tue, 1 Nov 2016 15:48:30 +0000 (15:48 +0000)]
[InstCombine] fix tests for adjusted min/max
1. Delete identical tests
2. Rename tests to reflect actual functionality
3. Add comments
4. Add unsigned variants
5. Add vector variants with FIXME comments
6. Rename test file
llvm-svn: 285699
Dimitar Vlahovski [Tue, 1 Nov 2016 15:48:24 +0000 (15:48 +0000)]
Minidump plugin: Fix flaky test
Summary:
One of the tests was flaky, because similarly to
https://reviews.llvm.org/D18697 (rL265391) - if there is a process running
which is with the same PID as in the core file, the minidump
core file debugging will fail, because we get some information from the
running process.
The fix is routing the ProcessInfo requests through the Process class
and overriding it in ProcessMinidump to return correct data.
Reviewers: labath
Subscribers: lldb-commits, beanz
Differential Revision: https://reviews.llvm.org/D26193
llvm-svn: 285698
Roger Ferrer Ibanez [Tue, 1 Nov 2016 15:46:16 +0000 (15:46 +0000)]
Protect exceptional paths under libcpp-no-exceptions
These tests are of the form
try {
action-that-may-throw
assert(!exceptional-condition)
assert(some-other-facts)
} catch (relevant-exception) {
assert(exceptional-condition)
}
Under libcpp-no-exceptions there is still value in verifying
some-other-facts while avoiding the exceptional case. So for these tests
just conditionally check some-other-facts if exceptional-condition is
false. When exception are supported make sure that a true
exceptional-condition throws an exception
Differential Revision: https://reviews.llvm.org/D26136
llvm-svn: 285697
Simon Pilgrim [Tue, 1 Nov 2016 15:40:30 +0000 (15:40 +0000)]
[InstCombine] Folding of shifts by the sum of positive values
This patch introduces the combine:
(C1 shift (A add C2)) -> ((C1 shift C2) shift A)
iff A and C2 are both positive
If both A and C2 are know to be positive then we can safely split into 2 shifts, permitting the folding of the Inner shift.
Fix for the spec benchmark case mentioned by @nadav on PR15141 (assuming we can prove that the inputs as positive).
Differential Revision: https://reviews.llvm.org/D26000
llvm-svn: 285696