Commit Graph

246205 Commits

Author SHA1 Message Date
Malcolm Parsons 883ebacd78 [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
2016-11-01 21:26:53 +00:00
Rui Ueyama 5fc84a1828 Remove string table offsets from tests.
<N> where "foo (<N>)" is the offset of string "foo" in the string table.

llvm-svn: 285751
2016-11-01 21:26:28 +00:00
George Burgess IV 66837aba0a [MemorySSA] Tighten up types to make our API prettier. NFC.
Patch by bryant.

Differential Revision: https://reviews.llvm.org/D26126

llvm-svn: 285750
2016-11-01 21:17:46 +00:00
Zachary Turner 857086edda Add missing #include.
llvm-svn: 285749
2016-11-01 21:08:34 +00:00
Rafael Espindola 5c9e8f5e52 Replace GAlloc with a template function.
This patch replaces GAlloc<ELFT>::<sometype>.Allocate() with
alloc<sometype<ELFT>>().

Patch by Rui!

llvm-svn: 285748
2016-11-01 21:06:40 +00:00
Rafael Espindola 7fc4f50838 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
2016-11-01 20:56:15 +00:00
Eli Friedman b9c6f01a81 [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
2016-11-01 20:53:11 +00:00
Eli Friedman 6768285dcc Add missing test from r284848.
Original commit title: [SCEVAffinator] Make precise modular math
more correct.

llvm-svn: 285745
2016-11-01 20:45:28 +00:00
Sanjay Patel 9840cdad4c [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
2016-11-01 20:43:00 +00:00
Matt Arsenault 2d8c289b4b 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
2016-11-01 20:42:24 +00:00
Jim Ingham 306b62b4ae 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
2016-11-01 20:37:02 +00:00
Michal Gorny f77a9889c0 [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
2016-11-01 20:31:52 +00:00
Rui Ueyama 6dc7fcbec4 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
2016-11-01 20:28:21 +00:00
Rafael Espindola 4a2055bef9 Update for llvm change.
llvm-svn: 285739
2016-11-01 20:25:27 +00:00
Rafael Espindola 120dca3b63 Use the existing std::error_code out parameter.
This avoids calling exit with a partially constructed object.

llvm-svn: 285738
2016-11-01 20:24:22 +00:00
Chris Bieneman 3603e61238 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
2016-11-01 20:19:33 +00:00
Enrico Granata f60216733f 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
2016-11-01 20:17:14 +00:00
Davide Italiano 1da3a52d11 [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
2016-11-01 20:11:01 +00:00
Joerg Sonnenberger 1c329c123e GC empty subdirectories.
llvm-svn: 285734
2016-11-01 20:09:41 +00:00
NAKAMURA Takumi 5a8949caa2 clang/test/CodeGenOpenCL/convergent.cl: Satisfy -Asserts with "opt -instnamer".
llvm-svn: 285733
2016-11-01 20:08:17 +00:00
Sanjay Patel c3d89842ad [InstCombine] allow splat vector folds in adjustMinMax()
llvm-svn: 285732
2016-11-01 20:08:02 +00:00
Malcolm Parsons d03c254662 [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
2016-11-01 20:07:05 +00:00
Alex Bradbury 0b02945c98 [RISCV] Add RISCV.def to module.modulemap
llvm-svn: 285730
2016-11-01 19:31:30 +00:00
Sanjay Patel c0339c77ef [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
2016-11-01 19:19:29 +00:00
Krzysztof Parzyszek 654dc11b79 [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
2016-11-01 19:02:10 +00:00
Enrico Granata 63db2395f6 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
2016-11-01 18:50:49 +00:00
Todd Fiala 4190199568 change ProcessAttach test to no-debug-info
Fixes:
https://bugs.swift.org/browse/SR-3103

llvm-svn: 285726
2016-11-01 18:50:34 +00:00
Yaxun Liu 7d07ae7c85 [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
2016-11-01 18:45:32 +00:00
Matt Arsenault cb578f84e0 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
2016-11-01 18:34:00 +00:00
Eugene Zelenko 90c117a61b [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
2016-11-01 18:33:50 +00:00
Rui Ueyama 035c4f14e0 Implement R_PPC_ADDR32.
Patch from Jack Andersen.

llvm-svn: 285720
2016-11-01 18:30:28 +00:00
Rui Ueyama 7fd5c84f46 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
2016-11-01 18:30:26 +00:00
Sanjay Patel 644d7c3b8a [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
2016-11-01 18:15:03 +00:00
Erich Keane cf8a59e449 Test Commit, removed extraneous newline
llvm-svn: 285717
2016-11-01 17:54:05 +00:00
Konstantin Zhuravlyov d971a1123f [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
2016-11-01 17:49:33 +00:00
Sanjay Patel 7ce658388b [InstCombine] add helper function for adjustMinMax(); NFCI
This is just a cut and paste; clean-up and enhancements to follow.

llvm-svn: 285715
2016-11-01 17:46:08 +00:00
Chris Bieneman 61e900b405 [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
2016-11-01 17:44:58 +00:00
Sanjay Patel 700193ae05 [InstCombine] add vector tests for ext+adjust min/max
llvm-svn: 285713
2016-11-01 17:34:29 +00:00
Alex Bradbury b2e5472d85 [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
2016-11-01 17:27:54 +00:00
Tom Stellard 9677b60288 AMDGPU: Fix buildbots broken by r285704
llvm-svn: 285711
2016-11-01 17:20:03 +00:00
Eugene Zelenko a0b67bbed9 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
2016-11-01 17:11:10 +00:00
Alex Bradbury acf6c82de2 [RISCV] Add missing RISCV.def
Fix rL285708

llvm-svn: 285709
2016-11-01 17:09:49 +00:00
Alex Bradbury 1524f62b97 [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
2016-11-01 16:59:37 +00:00
Alex Bradbury b6e784a240 [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
2016-11-01 16:47:54 +00:00
Sanjay Patel 586aeee341 [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
2016-11-01 16:39:30 +00:00
Alex Bradbury 58eba09949 [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
2016-11-01 16:32:05 +00:00
Tom Stellard 94c21bc088 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
2016-11-01 16:31:48 +00:00
Andrey Churbanov 51107e0abc 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
2016-11-01 16:19:04 +00:00
Pavel Labath 1408bf7231 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
2016-11-01 16:11:14 +00:00
Sjoerd Meijer b187f5d988 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
2016-11-01 15:59:37 +00:00