]> granicus.if.org Git - llvm/log
llvm
7 years agoRemove unused private field.
Zachary Turner [Wed, 3 May 2017 19:42:06 +0000 (19:42 +0000)]
Remove unused private field.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302069 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAvoid warning of unused variable in release builds. NFC
Anna Thomas [Wed, 3 May 2017 19:25:04 +0000 (19:25 +0000)]
Avoid warning of unused variable in release builds. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302068 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix typos in comment
Sanjoy Das [Wed, 3 May 2017 18:29:34 +0000 (18:29 +0000)]
Fix typos in comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302063 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoBreak verification down into smaller functions to keep code clean.
Greg Clayton [Wed, 3 May 2017 18:25:46 +0000 (18:25 +0000)]
Break verification down into smaller functions to keep code clean.

Adrian requested that we break things down to make things clean in the DWARFVerifier. This patch breaks everything down into nice individual functions and cleans up the code quite a bit and prepares us for the next round of verifiers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302062 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix PPC64 warning for missing parantheses. NFC.
Anna Thomas [Wed, 3 May 2017 18:25:43 +0000 (18:25 +0000)]
Fix PPC64 warning for missing parantheses. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302061 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IR] Abstract away ArgNo+1 attribute indexing as much as possible
Reid Kleckner [Wed, 3 May 2017 18:17:31 +0000 (18:17 +0000)]
[IR] Abstract away ArgNo+1 attribute indexing as much as possible

Summary:
Do three things to help with that:
- Add AttributeList::FirstArgIndex, which is an enumerator currently set
  to 1. It allows us to change the indexing scheme with fewer changes.
- Add addParamAttr/removeParamAttr. This just shortens addAttribute call
  sites that would otherwise need to spell out FirstArgIndex.
- Remove some attribute-specific getters and setters from Function that
  take attribute list indices.  Most of these were only used from
  BuildLibCalls, and doesNotAlias was only used to test or set if the
  return value is malloc-like.

I'm happy to split the patch, but I think they are probably easier to
review when taken together.

This patch should be NFC, but it sets the stage to change the indexing
scheme to this, which is more convenient when indexing into an array:
  0: func attrs
  1: retattrs
  2...: arg attrs

Reviewers: chandlerc, pete, javed.absar

Subscribers: david2050, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302060 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeView] Remove constructor initialization of a removed field.
Davide Italiano [Wed, 3 May 2017 18:02:46 +0000 (18:02 +0000)]
[CodeView] Remove constructor initialization of a removed field.

I should've staged this with my last commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302059 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RuntimeLoopUnroller] Add assert that we dont unroll non-rotated loops
Anna Thomas [Wed, 3 May 2017 17:43:59 +0000 (17:43 +0000)]
[RuntimeLoopUnroller] Add assert that we dont unroll non-rotated loops

Summary:
Cloning basic blocks in the loop for runtime loop unroller depends on loop being
in rotated form (i.e. loop latch target is the exit block).
Assert that this is true, so that callers of runtime loop unroller pass in
canonical loops.
The single caller of this function has that check recently added:
https://reviews.llvm.org/rL301239

Reviewers: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302058 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDelete dead function causing compilation failure.
Zachary Turner [Wed, 3 May 2017 17:38:49 +0000 (17:38 +0000)]
Delete dead function causing compilation failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302057 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeView] Remove unused private field. NFCI.
Davide Italiano [Wed, 3 May 2017 17:37:35 +0000 (17:37 +0000)]
[CodeView] Remove unused private field. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302056 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[bpf] add relocation support
Alexei Starovoitov [Wed, 3 May 2017 17:30:56 +0000 (17:30 +0000)]
[bpf] add relocation support

  . there should be no runtime relocation inside the bpf function.
  . relocation supported here mostly for debugging.
  . a test case is added.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302055 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "CMake: Move sphinx detection into AddSphinxTarget.cmake"
Tom Stellard [Wed, 3 May 2017 17:22:23 +0000 (17:22 +0000)]
Revert "CMake: Move sphinx detection into AddSphinxTarget.cmake"

This reverts commit r302025.

clang and lld need to be updated too so they don't break with this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302054 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeView] Use actual strings for dealing with checksums and lines.
Zachary Turner [Wed, 3 May 2017 17:11:40 +0000 (17:11 +0000)]
[CodeView] Use actual strings for dealing with checksums and lines.

The raw CodeView format references strings by "offsets", but it's
confusing what table the offset refers to.  In the case of line
number information, it's an offset into a buffer of records,
and an indirection is required to get another offset into a
different table to find the final string.  And in the case of
checksum information, there is no indirection, and the offset
refers directly to the location of the string in another buffer.

This would be less confusing if we always just referred to the
strings by their value, and have the library be smart enough
to correctly resolve the offsets on its own from the right
location.

This patch makes that possible.  When either reading or writing,
all the user deals with are strings, and the library does the
appropriate translations behind the scenes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302053 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-readobj] Update readobj to re-use parsing code.
Zachary Turner [Wed, 3 May 2017 17:11:11 +0000 (17:11 +0000)]
[llvm-readobj] Update readobj to re-use parsing code.

llvm-readobj hand rolls some CodeView parsing code for string
tables, so this patch updates it to re-use some of the newly
introduced parsing code in LLVMDebugInfoCodeView.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302052 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoARM: add extra test for addrmode folding.
Tim Northover [Wed, 3 May 2017 16:54:30 +0000 (16:54 +0000)]
ARM: add extra test for addrmode folding.

I was worried we might replace a mul with a mul+shift even if there were later
uses. Turns out to be unfounded but I'd just as well add an actual test for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302051 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][LWP] Add stack folding mappings and tests for LWPINS/LWPVAL instructions
Simon Pilgrim [Wed, 3 May 2017 16:46:30 +0000 (16:46 +0000)]
[X86][LWP] Add stack folding mappings and tests for LWPINS/LWPVAL instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302049 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSilence a 'enum and non-enum used in conditional' warning.
Simon Pilgrim [Wed, 3 May 2017 16:43:57 +0000 (16:43 +0000)]
Silence a 'enum and non-enum used in conditional' warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302048 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombine] (addcarry (add|uaddo X, Y), 0, Carry) -> (addcarry X, Y, Carry)
Amaury Sechet [Wed, 3 May 2017 16:28:10 +0000 (16:28 +0000)]
[DAGCombine] (addcarry (add|uaddo X, Y), 0, Carry) -> (addcarry X, Y, Carry)

Summary: Do the transform when the carry isn't used. It's a pattern exposed when legalizing large integers.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302047 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCreate DWARFVerifier.cpp and .h and move all DWARF verification code over into it.
Greg Clayton [Wed, 3 May 2017 16:02:29 +0000 (16:02 +0000)]
Create DWARFVerifier.cpp and .h and move all DWARF verification code over into it.

Adrian requested we create a DWARFVerifier.cpp file to contain all of the DWARF verification stuff. This change simply moves the functionality over into DWARFVerifier.h and DWARFVerifier.cpp, renames the DWARFVerifier methods to start with lower case, and switches DWARFContext.cpp over to using the new functionality.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302044 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoResubmit r301986 and r301987 "Add codeview::StringTable"
Zachary Turner [Wed, 3 May 2017 15:58:37 +0000 (15:58 +0000)]
Resubmit r301986 and r301987 "Add codeview::StringTable"

This was reverted due to a "missing" file, but in reality
what happened was that I renamed a file, and then due to
a merge conflict both the old file and the new file got
added to the repository.  This led to an unused cpp file
being in the repo and not referenced by any CMakeLists.txt
but #including a .h file that wasn't in the repo.  In an
even more unfortunate coincidence, CMake didn't report the
unused cpp file because it was in a subdirectory of the
folder with the CMakeLists.txt, and not in the same directory
as any CMakeLists.txt.

The presence of the unused file was then breaking certain
tools that determine file lists by globbing rather than
by what's specified in CMakeLists.txt

In any case, the fix is to just remove the unused file from
the patch set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302042 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][LWP] Add llvm support for LWP instructions (reapplied).
Simon Pilgrim [Wed, 3 May 2017 15:51:39 +0000 (15:51 +0000)]
[X86][LWP] Add llvm support for LWP instructions (reapplied).

This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4).

Reapplied - this time without changing line endings of existing files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302041 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[APInt] Give the value union a name so we can remove assumptions on VAL being the...
Craig Topper [Wed, 3 May 2017 15:46:24 +0000 (15:46 +0000)]
[APInt] Give the value union a name so we can remove assumptions on VAL being the larger member

Currently several places assume the VAL member is always at least the same size as pVal. In particular for a memcpy in the move assignment operator. While this is a true assumption, it isn't good practice to assume this.

This patch gives the union a name so we can write the memcpy in terms of the union itself. This also adds a similar memcpy to the move constructor where we previously just copied using VAL directly.

This patch is mostly just a mechanical addition of the U in front of VAL and pVAL everywhere. But several constructors had to be modified since we can't directly initializer a field of named union from the initializer list.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302040 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoVerify that no compile units share the same line table in "llvm-dwarfdump --verify"
Greg Clayton [Wed, 3 May 2017 15:45:31 +0000 (15:45 +0000)]
Verify that no compile units share the same line table in "llvm-dwarfdump --verify"

Check to make sure no compile units have the same DW_AT_stmt_list values. Report a verification error if they do.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302039 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert rL302028 due to accidental line ending changes.
Simon Pilgrim [Wed, 3 May 2017 15:42:29 +0000 (15:42 +0000)]
Revert rL302028 due to accidental line ending changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302038 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Handle S2_storerf_io in HexagonInstrInfo
Krzysztof Parzyszek [Wed, 3 May 2017 15:36:51 +0000 (15:36 +0000)]
[Hexagon] Handle S2_storerf_io in HexagonInstrInfo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302036 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Misc fixes in HexagonInstrInfo, NFC
Krzysztof Parzyszek [Wed, 3 May 2017 15:34:52 +0000 (15:34 +0000)]
[Hexagon] Misc fixes in HexagonInstrInfo, NFC

Formatting changes + remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302035 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Adjust latency between allocframe and the first store on stack
Krzysztof Parzyszek [Wed, 3 May 2017 15:33:09 +0000 (15:33 +0000)]
[Hexagon] Adjust latency between allocframe and the first store on stack

Allocframe and the following stores on the stack have a latency of 2 cycles
when not in the same packet. This happens because R29 is needed early by the
store instruction. Since one of such stores can be packetized along with
allocframe and use old value of R29, we can assign it 0 cycle latency
while leaving latency of other stores to the default value of 2 cycles.

Patch by Jyotsna Verma.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302034 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Handle J2_jumptpt and J2_jumpfpt in HexagonInstrInfo
Krzysztof Parzyszek [Wed, 3 May 2017 15:30:46 +0000 (15:30 +0000)]
[Hexagon] Handle J2_jumptpt and J2_jumpfpt in HexagonInstrInfo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302033 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Implement undoing .cur instructions in packetizer
Krzysztof Parzyszek [Wed, 3 May 2017 15:28:56 +0000 (15:28 +0000)]
[Hexagon] Implement undoing .cur instructions in packetizer

The packetizer needs to convert .cur instruction to its regular form if
the use is not in the same packet as the .cur. The code in the packetizer
handles one type of .cur, which is the vector load case. This patch
updates the packetizer so that it can undo all the .cur instructions.
In the test case, the .cur is the 128B version, but there are also the
post-increment versions.

Patch by Brendon Cahoon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302032 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Add memory operands to a rewritten load
Krzysztof Parzyszek [Wed, 3 May 2017 15:26:13 +0000 (15:26 +0000)]
[Hexagon] Add memory operands to a rewritten load

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302030 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Reset spill alignment when variable-sized objects are present
Krzysztof Parzyszek [Wed, 3 May 2017 15:23:53 +0000 (15:23 +0000)]
[Hexagon] Reset spill alignment when variable-sized objects are present

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302029 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][LWP] Add llvm support for LWP instructions.
Simon Pilgrim [Wed, 3 May 2017 15:18:34 +0000 (15:18 +0000)]
[X86][LWP] Add llvm support for LWP instructions.

This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302028 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCMake: Add LLVM_DYLIB_SYMBOL_VERSIONING option
Tom Stellard [Wed, 3 May 2017 14:43:44 +0000 (14:43 +0000)]
CMake: Add LLVM_DYLIB_SYMBOL_VERSIONING option

Summary:
When apps or other libraries link against a library with symbol
versions, the version string is recorded in the import table, and used
at runtime to resolve the symbol back to a library that provides that
version (vaguely like how two-level namespaces work in Mach-O).  ld's
--default-symver flag tags every exported symbol with a symbol version
string equal to the library's soname.  Using --default-symver means
multiple versions of libLLVM can coexist within the same process, at
least to the extent that they don't try to pass data between each
other's llvms.

As an example, imagine a language like Rust using llvm for CPU codegen,
binding to OpenGL, with Mesa as the OpenGL implementation using llvm for
R600 codegen.  With --default-symver Rust and Mesa will resolve their
llvm usage to the version each was linked against, which need not match.

(Other ELF platforms like BSD and Solaris might have similar semantics,
I've not checked.)

This is based on an autoconf version of this patch by Adam Jackson.

This new option can be used to add --default-symver to the linker flags
for libLLVM.so.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302026 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCMake: Move sphinx detection into AddSphinxTarget.cmake
Tom Stellard [Wed, 3 May 2017 14:29:56 +0000 (14:29 +0000)]
CMake: Move sphinx detection into AddSphinxTarget.cmake

Reviewers: chandlerc, beanz, mgorny

Reviewed By: beanz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302025 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512] remove unnecessary case. NFC
Guy Blank [Wed, 3 May 2017 13:34:05 +0000 (13:34 +0000)]
[X86][AVX512] remove unnecessary case. NFC

VFPCLASS is for vector types and not scalar, so it cannot get here.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302023 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SystemZ] Properly check number of operands in getCmpOpsType()
Jonas Paulsson [Wed, 3 May 2017 13:33:45 +0000 (13:33 +0000)]
[SystemZ]  Properly check number of operands in getCmpOpsType()

It is needed to check that the number of operands are 2 when
finding the case of a logic combination, e.g. 'and' of two compares.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302022 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Support of no_caller_saved_registers attribute
Oren Ben Simhon [Wed, 3 May 2017 13:07:19 +0000 (13:07 +0000)]
[X86] Support of no_caller_saved_registers attribute

This patch implements the LLVM part for no_caller_saved_registers attribute as appears here: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5ed3cc7b66af4758f7849ed6f65f4365be8223be.
In order to implement the attribute, we use the dynamic CSR mechanism to remove returned/passed arguments from the function regmask/CSR list.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302020 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSupport arbitrary address space pointers in masked gather/scatter intrinsics.
Elad Cohen [Wed, 3 May 2017 12:28:54 +0000 (12:28 +0000)]
Support arbitrary address space pointers in masked gather/scatter intrinsics.

Fixes PR31789 - When loop-vectorize tries to use these intrinsics for a
non-default address space pointer we fail with a "Calling a function with a
bad singature!" assertion. This patch solves this by adding the 'vector of
pointers' argument as an overloaded type which will determine the address
space.

Differential revision: https://reviews.llvm.org/D31490

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302018 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVR] Reserve the Y register in all functions
Dylan McKay [Wed, 3 May 2017 11:56:01 +0000 (11:56 +0000)]
[AVR] Reserve the Y register in all functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302017 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Loop Deletion] Delete loops that are never executed
Anna Thomas [Wed, 3 May 2017 11:47:11 +0000 (11:47 +0000)]
[Loop Deletion] Delete loops that are never executed

Summary:
Currently, loop deletion deletes loop where the only values
that are used outside the loop are loop-invariant.
This patch adds logic to delete loops where the loop is proven to be
never executed (i.e. the only predecessor of the loop preheader has a
constant conditional branch as terminator, and the preheader is not the
taken target). This will remove loops that become dead after
loop-unswitching generates constant conditional branches.

The next steps are:
1. moving the loop deletion implementation to LoopUtils.
2. Add logic in loop-simplifyCFG which will support changing conditional
constant branches to unconditional branches. If loops become unreachable in this
process, they can be removed using `deleteDeadLoop` function.

Reviewers: chandlerc, efriedma, sanjoy, reames

Reviewed by: sanjoy

Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302015 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[AVR] Enable the frame pointer for all functions"
Dylan McKay [Wed, 3 May 2017 11:36:42 +0000 (11:36 +0000)]
Revert "[AVR] Enable the frame pointer for all functions"

This reverts commit 358ad02d999e88853d2cfc954bd2f668308a51f7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302014 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Triple] Add a "macos" OS type that acts as a synonym for "macosx"
Alex Lorenz [Wed, 3 May 2017 10:42:35 +0000 (10:42 +0000)]
[Triple] Add a "macos" OS type that acts as a synonym for "macosx"

The "macosx" OS type is still the canonical type. In the future "macos" will
become the canonical OS type (but we will still support "macosx").

rdar://27043820

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302011 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Refactored LowerINTRINSIC_W_CHAIN to use a switch statament. NFCI.
Simon Pilgrim [Wed, 3 May 2017 10:40:18 +0000 (10:40 +0000)]
[X86] Refactored LowerINTRINSIC_W_CHAIN to use a switch statament. NFCI.

Pre-commit as requested in D32769.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302010 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r301986 (and subsequent r301987).
Daniel Jasper [Wed, 3 May 2017 07:29:25 +0000 (07:29 +0000)]
Revert r301986 (and subsequent r301987).

The patch is failing to add StringTableStreamBuilder.h, but that isn't
even discovered because the corresponding StringTableStreamBuilder.cpp
isn't added to any CMakeLists.txt file and thus never built. I think
this patch is just incomplete.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302002 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix use after free in BinaryStream library.
Zachary Turner [Wed, 3 May 2017 05:34:00 +0000 (05:34 +0000)]
Fix use after free in BinaryStream library.

This was reported by the ASAN bot, and it turned out to be
a fairly fundamental problem with the design of VarStreamArray
and the way it passes context information to the extractor.

The fix was cumbersome, and I'm not entirely pleased with it,
so I plan to revisit this design in the future when I'm not
pressed to get the bots green again.  For now, this fixes
the issue by storing the context information by value instead
of by reference, and introduces some impossibly-confusing
template magic to make things "work".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301999 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReplace hardcoded intrinsic list with speculatable attribute.
Matt Arsenault [Wed, 3 May 2017 02:26:10 +0000 (02:26 +0000)]
Replace hardcoded intrinsic list with speculatable attribute.

No change in which intrinsics should be speculated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301995 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r295861, "[ModuleSummaryAnalysis] Don't crash when referencing unnamed globals."
Peter Collingbourne [Wed, 3 May 2017 00:18:48 +0000 (00:18 +0000)]
Revert r295861, "[ModuleSummaryAnalysis] Don't crash when referencing unnamed globals."

We should always expect values to be named before running the module summary
analysis (see NameAnonGlobals pass), so it's fine if we crash in that case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301991 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PowerPC, DAGCombiner] Fold a << (b % (sizeof(a) * 8)) back to a single instruction
Tim Shen [Wed, 3 May 2017 00:07:02 +0000 (00:07 +0000)]
[PowerPC, DAGCombiner] Fold a << (b % (sizeof(a) * 8)) back to a single instruction

Summary:
This is the corresponding llvm change to D28037 to ensure no performance
regression.

Reviewers: bogner, kbarton, hfinkel, iteratee, echristo

Subscribers: nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301990 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix type conversion error.
Zachary Turner [Tue, 2 May 2017 23:41:51 +0000 (23:41 +0000)]
Fix type conversion error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301987 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake codeview::StringTable.
Zachary Turner [Tue, 2 May 2017 23:36:17 +0000 (23:36 +0000)]
Make codeview::StringTable.

Previously we had knowledge of how to serialize and deserialize
a string table inside of DebugInfo/PDB, but the string table
that it serializes contains a piece that is actually considered
CodeView and can appear outside of a PDB.  We already have logic
in llvm-readobj and MCCodeView to read and write this format,
so it doesn't make sense to duplicate the logic in DebugInfoPDB
as well.

This patch makes codeview::StringTable (for writing) and
codeview::StringTableRef (for reading), updates DebugInfoPDB
to use these classes for its own writing, and updates llvm-readobj
to additionally use StringTableRef for reading.

It's a bit more difficult to get MCCodeView to use this for
writing, but it's a logical next step.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301986 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTypo in LangRef.rst. NFC
Xin Tong [Tue, 2 May 2017 23:24:12 +0000 (23:24 +0000)]
Typo in LangRef.rst. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301985 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd line table verification to lldb-dwarfdump --verify
Greg Clayton [Tue, 2 May 2017 22:48:52 +0000 (22:48 +0000)]
Add line table verification to lldb-dwarfdump --verify

This patch verifies the .debug_line:
- verify all addresses in a line table sequence have ascending addresses
- verify that all line table file indexes are valid

Unit tests added for both cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301984 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoARM: avoid handing a deleted node back to TableGen during ISel.
Tim Northover [Tue, 2 May 2017 22:45:19 +0000 (22:45 +0000)]
ARM: avoid handing a deleted node back to TableGen during ISel.

When we replaced the multiplicand the destination node might already exist.
When that happens the original gets CSEd and deleted. However, it's actually
used as the offset so nonsense is produced.

Should fix PR32726.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301983 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRe-land r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of Attribute...
Reid Kleckner [Tue, 2 May 2017 22:07:37 +0000 (22:07 +0000)]
Re-land r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"

This time, I fixed, built, and tested clang.

This reverts r301712.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301981 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] ILP32 Backend Relocation Support
Joel Jones [Tue, 2 May 2017 22:01:48 +0000 (22:01 +0000)]
[AArch64] ILP32 Backend Relocation Support

Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
  TLSDESC_ADD_LO12 relocations
Rearrange ordering in AArch64.def to follow relocation encoding
Fix name:
  R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC
Add support for several "TLS", "TLSGD", and "TLSLD" relocations for
  ILP32
Fix return values from isNonILP32reloc
Add implementations for
  R_AARCH64_ADR_PREL_PG_HI21_NC, R_AARCH64_P32_LD32_GOT_LO12_NC,
  R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC,
  R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC,
  *TLSLD_LDST128_DTPREL_LO12, *TLSLD_LDST128_DTPREL_LO12_NC,
  *TLSLE_LDST128_TPREL_LO12, *TLSLE_LDST128_TPREL_LO12_NC
Modify error messages to give name of equivalent relocation in the
  ABI not being used, along with better checking for non-existent
  requested relocations.
Added assembler support for "pg_hi21_nc"
Relocation definitions added without implementations:
  R_AARCH64_P32_TLSDESC_ADR_PREL21, R_AARCH64_P32_TLSGD_ADR_PREL21,
  R_AARCH64_P32_TLSGD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_ADR_PREL21,
  R_AARCH64_P32_TLSLD_ADR_PAGE21, R_AARCH64_P32_TLSLD_ADD_LO12_NC,
  R_AARCH64_P32_TLSLD_LD_PREL19, R_AARCH64_P32_TLSDESC_LD_PREL19,
  R_AARCH64_P32_TLSGD_ADR_PAGE21, R_AARCH64_P32_TLS_DTPREL,
  R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_TPREL,
  R_AARCH64_P32_TLSDESC
Fix encoding:
  R_AARCH64_P32_TLSDESC_ADR_PAGE21

Reviewers: Peter Smith

Patch by: Joel Jones (jjones@cavium.com)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301980 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DWARFv5] Parse new line-table header format.
Paul Robinson [Tue, 2 May 2017 21:40:47 +0000 (21:40 +0000)]
[DWARFv5] Parse new line-table header format.

The directory and file tables now have form-based content descriptors.
Parse these and extract the per-directory/file records based on the
descriptors.  For now we support only DW_FORM_string (inline) for the
path names; follow-up work will add support for indirect forms (i.e.,
DW_FORM_strp, strx<N>, and line_strp).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301978 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agorevert r301766: InstructionSimplify: Canonicalize shuffle operands. NFC-ish
Sanjay Patel [Tue, 2 May 2017 21:37:28 +0000 (21:37 +0000)]
revert r301766: InstructionSimplify: Canonicalize shuffle operands. NFC-ish

Turns out this wasn't NFC-ish at all because there's a bug processing shuffles
that change the size of their input vectors (that case always seems to trip us
up).

This should fix PR32872 while we investigate how it failed and reduce a testcase:
https://bugs.llvm.org/show_bug.cgi?id=32872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301977 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NewGVN] Fix typo and format comment. NFCI.
Davide Italiano [Tue, 2 May 2017 21:11:40 +0000 (21:11 +0000)]
[NewGVN] Fix typo and format comment. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301974 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoVerify that all references point to actual DIEs in "llvm-dwarfdump --verify"
Greg Clayton [Tue, 2 May 2017 20:28:33 +0000 (20:28 +0000)]
Verify that all references point to actual DIEs in "llvm-dwarfdump --verify"

LTO and other fancy linking previously led to DWARF that contained invalid references. We already validate that CU relative references fall into the CU, and the DW_FORM_ref_addr references fall inside the .debug_info section, but we didn't validate that the references pointed to correct DIE offsets. This new verification will ensure that all references refer to actual DIEs and not an offset in between.

This caught a bug in DWARFUnit::getDIEForOffset() where if you gave it any offset, it would match the DIE that mathes the offset _or_ the next DIE. This has been fixed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301971 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoARM: add arm1176j-f processor
Tim Northover [Tue, 2 May 2017 19:06:13 +0000 (19:06 +0000)]
ARM: add arm1176j-f processor

I doubt anyone actually uses it, and I'm not even entirely convinced it exists
myself; but it is our default for "clang -arch armv6". Functionally, if it does
exist it's identical to the arm1176jz-f from LLVM's point of view (the
difference is apparently in the "Security Extensions").

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301962 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoPEI: Skip dead objects when looking at CSRs
Matt Arsenault [Tue, 2 May 2017 18:56:28 +0000 (18:56 +0000)]
PEI: Skip dead objects when looking at CSRs

On AMDGPU if an SGPR is spilled to a VGPR, the frame index
is deleted. If there were any CSR SGPRs, this woudl
assert when setting the offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301961 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PartialInlining] Add more early filtering
Xinliang David Li [Tue, 2 May 2017 18:43:21 +0000 (18:43 +0000)]
[PartialInlining] Add more early filtering

This is a follow up to the previous
inline cost patch for quicker filtering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301959 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Don't promote alloca to LDS for leaf functions
Matt Arsenault [Tue, 2 May 2017 18:33:18 +0000 (18:33 +0000)]
AMDGPU: Don't promote alloca to LDS for leaf functions

LDS use in leaf functions not currently handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301958 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Fix uninitialized value caught with valgrind
Krzysztof Parzyszek [Tue, 2 May 2017 18:29:49 +0000 (18:29 +0000)]
[Hexagon] Fix uninitialized value caught with valgrind

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301957 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Change iconst to emit 27bit relocation
Krzysztof Parzyszek [Tue, 2 May 2017 18:19:11 +0000 (18:19 +0000)]
[Hexagon] Change iconst to emit 27bit relocation

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301956 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Add extenders for GD_PLT_B22_PCREL and LD_PLT_B22_PCREL
Krzysztof Parzyszek [Tue, 2 May 2017 18:15:33 +0000 (18:15 +0000)]
[Hexagon] Add extenders for GD_PLT_B22_PCREL and LD_PLT_B22_PCREL

Patch by Sid Manning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301955 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Don't ignore mult-cycle latency information
Krzysztof Parzyszek [Tue, 2 May 2017 18:12:19 +0000 (18:12 +0000)]
[Hexagon] Don't ignore mult-cycle latency information

The compiler was generating code that ends up ignoring a multiple
latency dependence between two instructions by scheduling the
intructions in back-to-back packets.

The packetizer needs to end a packet if the latency of the current
current insruction and the source in the previous packet is
greater than 1 cycle. This case occurs when there is still room in
the current packet, but scheduling the instruction causes a stall.
Instead, the packetizer should start a new packet. Also, if the
current packet already contains a stall, then it is okay to add
another instruction to the packet that also causes a stall. This
occurs when there are no instructions that can be scheduled in
between the producer and consumer instructions.

This patch changes the latency for loads to 2 cycles from 3 cycles.
This change refects that a load only needs to be separated by
one extra packet to eliminate the stall.

Patch by Ikhlas Ajbar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301954 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Formatting changes, NFC
Krzysztof Parzyszek [Tue, 2 May 2017 18:09:07 +0000 (18:09 +0000)]
[Hexagon] Formatting changes, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301953 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Remove unused validSubtarget TSFlags
Krzysztof Parzyszek [Tue, 2 May 2017 18:05:36 +0000 (18:05 +0000)]
[Hexagon] Remove unused validSubtarget TSFlags

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301952 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Make sure duplexed dealloc_returns are checked for double jumps
Krzysztof Parzyszek [Tue, 2 May 2017 18:03:08 +0000 (18:03 +0000)]
[Hexagon] Make sure duplexed dealloc_returns are checked for double jumps

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301951 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSpeculativeExecution: Stop using whitelist for costs
Matt Arsenault [Tue, 2 May 2017 18:02:18 +0000 (18:02 +0000)]
SpeculativeExecution: Stop using whitelist for costs

Just let TTI's cost do this instead of arbitrarily restricting
this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301950 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Move checking AXOK to checker
Krzysztof Parzyszek [Tue, 2 May 2017 18:00:37 +0000 (18:00 +0000)]
[Hexagon] Move checking AXOK to checker

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301949 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRename pdb::StringTable -> pdb::PDBStringTable.
Zachary Turner [Tue, 2 May 2017 18:00:13 +0000 (18:00 +0000)]
Rename pdb::StringTable -> pdb::PDBStringTable.

With the forthcoming codeview::StringTable which a pdb::StringTable
would hold an instance of as one member, this ambiguity becomes
confusing.  Rename to PDBStringTable to avoid this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301948 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Remove unneeded code from HexagonShuffler
Krzysztof Parzyszek [Tue, 2 May 2017 17:58:52 +0000 (17:58 +0000)]
[Hexagon] Remove unneeded code from HexagonShuffler

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301947 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Extract function that checks endloops with other branches
Krzysztof Parzyszek [Tue, 2 May 2017 17:56:11 +0000 (17:56 +0000)]
[Hexagon] Extract function that checks endloops with other branches

Change location number to point to conflicting branch instruction.

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301946 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Add new packet iterator which will iterate through duplexes
Krzysztof Parzyszek [Tue, 2 May 2017 17:53:51 +0000 (17:53 +0000)]
[Hexagon] Add new packet iterator which will iterate through duplexes

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301945 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and"
Zachary Turner [Tue, 2 May 2017 17:51:27 +0000 (17:51 +0000)]
Revert "Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and"

This reverts commit c08155afc5d3230792da2ad30a046a8617735a73.

This is causing undefined symbol errors with some of the constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301944 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Check for .cur def without use without using a map data structure
Krzysztof Parzyszek [Tue, 2 May 2017 17:51:14 +0000 (17:51 +0000)]
[Hexagon] Check for .cur def without use without using a map data structure

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301943 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoBitcode: Simplify how we enumerate summaries in the index. NFCI.
Peter Collingbourne [Tue, 2 May 2017 17:48:39 +0000 (17:48 +0000)]
Bitcode: Simplify how we enumerate summaries in the index. NFCI.

Instead of defining a custom iterator class, just use a function with a
callback, which is much easier to understand and less error prone.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301942 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[lit] Try to exit more cleanly
Reid Kleckner [Tue, 2 May 2017 17:45:16 +0000 (17:45 +0000)]
[lit] Try to exit more cleanly

If all jobs complete successfully, use pool.close() instead of
pool.terminate() before waiting for the workers. Zach Turner reported
that he was getting "access denied" exceptions from pool.terminate().

Make the workers abort immediately without printing to stderr when they
are interrupted.

Finally, catch exceptions when attempting to remove our temporary
testing directory. On abnormal exit, there can often be open handles
that haven't been cleaned up yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301941 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake DWARFDebugLine use StringRef for directory/file tables. NFC
Paul Robinson [Tue, 2 May 2017 17:37:32 +0000 (17:37 +0000)]
Make DWARFDebugLine use StringRef for directory/file tables. NFC

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301940 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
Joel Jones [Tue, 2 May 2017 17:14:31 +0000 (17:14 +0000)]
Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
  TLSDESC_ADD_LO12 relocations
Rearrange ordering in AArch64.def to follow relocation encoding
Fix name:
  R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC
Add support for several "TLS", "TLSGD", and "TLSLD" relocations for
  ILP32
Fix return values from isNonILP32reloc
Add implementations for
  R_AARCH64_ADR_PREL_PG_HI21_NC, R_AARCH64_P32_LD32_GOT_LO12_NC,
  R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC,
  R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC,
  *TLSLD_LDST128_DTPREL_LO12, *TLSLD_LDST128_DTPREL_LO12_NC,
  *TLSLE_LDST128_TPREL_LO12, *TLSLE_LDST128_TPREL_LO12_NC
Modify error messages to give name of equivalent relocation in the
  ABI not being used, along with better checking for non-existent
  requested relocations.
Added assembler support for "pg_hi21_nc"
Relocation definitions added without implementations:
  R_AARCH64_P32_TLSDESC_ADR_PREL21, R_AARCH64_P32_TLSGD_ADR_PREL21,
  R_AARCH64_P32_TLSGD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_ADR_PREL21,
  R_AARCH64_P32_TLSLD_ADR_PAGE21, R_AARCH64_P32_TLSLD_ADD_LO12_NC,
  R_AARCH64_P32_TLSLD_LD_PREL19, R_AARCH64_P32_TLSDESC_LD_PREL19,
  R_AARCH64_P32_TLSGD_ADR_PAGE21, R_AARCH64_P32_TLS_DTPREL,
  R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_TPREL,
  R_AARCH64_P32_TLSDESC
Fix encoding:
  R_AARCH64_P32_TLSDESC_ADR_PAGE21

Reviewers: Peter Smith

Patch by: Joel Jones (jjones@cavium.com)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301939 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Refactor AsmPrinter
Matt Arsenault [Tue, 2 May 2017 17:14:00 +0000 (17:14 +0000)]
AMDGPU: Refactor AsmPrinter

Avoid analyzing functions multiple times. This allows
asserting that each function is only analyzed once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301938 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Make intrinsics speculatable
Matt Arsenault [Tue, 2 May 2017 16:57:44 +0000 (16:57 +0000)]
AMDGPU: Make intrinsics speculatable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301937 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PDB/CodeView] Read/write codeview inlinee line information.
Zachary Turner [Tue, 2 May 2017 16:56:09 +0000 (16:56 +0000)]
[PDB/CodeView] Read/write codeview inlinee line information.

Previously we wrote line information and file checksum
information, but we did not write information about inlinee
lines and functions.  This patch adds support for that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301936 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCMake: Silence more stderr when running git.
Tim Northover [Tue, 2 May 2017 16:37:37 +0000 (16:37 +0000)]
CMake: Silence more stderr when running git.

It can confuse bots collecting errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301934 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd new test case for addcarry. NFC.
Amaury Sechet [Tue, 2 May 2017 16:07:32 +0000 (16:07 +0000)]
Add new test case for addcarry. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301932 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Add AMDGPU_HS calling convention
Marek Olsak [Tue, 2 May 2017 15:41:10 +0000 (15:41 +0000)]
AMDGPU: Add AMDGPU_HS calling convention

Reviewers: arsenm, nhaehnle

Subscribers: mehdi_amini, kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301930 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] don't use DeMorgan's Law on integer constants (2nd try)
Sanjay Patel [Tue, 2 May 2017 15:31:40 +0000 (15:31 +0000)]
[InstCombine] don't use DeMorgan's Law on integer constants (2nd try)

This was originally checked in here:
https://reviews.llvm.org/rL301923

And reverted here:
https://reviews.llvm.org/rL301924

Because there's a clang test that would fail after this. I fixed/removed the
offending CHECK lines in:
https://reviews.llvm.org/rL301928

So let's try this again. Original commit message:

This is the fold that causes the infinite loop in BoringSSL
(https://github.com/google/boringssl/blob/master/crypto/cipher/e_rc2.c)
when we fix instcombine demanded bits to prefer 'not' ops as in https://reviews.llvm.org/D32255.

There are 2 or 3 problems with dyn_castNotVal, and I don't think we can
reinstate https://reviews.llvm.org/D32255 until dyn_castNotVal is completely eliminated.

1. As shown here, it transforms 'not' into random xor. This transform is harmful to SCEV and codegen because 'not' can often be folded while random xor cannot.
2. It does not transform vector constants. This is actually a good thing, but if you don't believe the above argument, then we shouldn't have excluded vectors.
3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't match the greedy nature of instcombine. If we DeMorganize a pattern that has an extra 'not' in it: ~(~(~X) & Y) --> (~X | ~Y)

  That's just another case of DeMorgan, so we should trust that we'll fold that pattern too: (~X | ~ Y) --> ~(X & Y)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301929 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agorevert r301923 : [InstCombine] don't use DeMorgan's Law on integer constants
Sanjay Patel [Tue, 2 May 2017 14:48:23 +0000 (14:48 +0000)]
revert r301923 : [InstCombine] don't use DeMorgan's Law on integer constants

There's a clang test that is wrongly using -O1 and failing after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301924 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] don't use DeMorgan's Law on integer constants
Sanjay Patel [Tue, 2 May 2017 14:31:30 +0000 (14:31 +0000)]
[InstCombine] don't use DeMorgan's Law on integer constants

This is the fold that causes the infinite loop in BoringSSL
(https://github.com/google/boringssl/blob/master/crypto/cipher/e_rc2.c)
when we fix instcombine demanded bits to prefer 'not' ops as in D32255.

There are 2 or 3 problems with dyn_castNotVal, and I don't think we can
reinstate D32255 until dyn_castNotVal is completely eliminated.
1. As shown here, it transforms 'not' into random xor. This transform is
   harmful to SCEV and codegen because 'not' can often be folded while
   random xor cannot.
2. It does not transform vector constants. This is actually a good thing,
   but if you don't believe the above argument, then we shouldn't have
   excluded vectors.
3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't
   match the greedy nature of instcombine. If we DeMorganize a pattern
   that has an extra 'not' in it:
   ~(~(~X) & Y) --> (~X | ~Y)

   That's just another case of DeMorgan, so we should trust that we'll fold
   that pattern too:
   (~X | ~ Y) --> ~(X & Y)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301923 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombine] (uaddo X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)
Amaury Sechet [Tue, 2 May 2017 14:15:48 +0000 (14:15 +0000)]
[DAGCombine] (uaddo X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)

Summary: This is a common pattern that arise when legalizing large integers operations. Only do it when Y + 1 cannot overflow as this would change the carry behavior of uaddo .

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301922 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd llvm::object::getELFSectionTypeName().
Rafael Espindola [Tue, 2 May 2017 14:04:52 +0000 (14:04 +0000)]
Add llvm::object::getELFSectionTypeName().

This is motivated by https://reviews.llvm.org/D32488 where I am trying
to add printing of the section type for incompatible sections to LLD
error messages. This patch allows us to use the same code in
llvm-readobj and LLD instead of duplicating the function inside LLD.

Patch by Alexander Richardson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301921 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoImprovements to TableGen/LangIntro.rst
Alex Bradbury [Tue, 2 May 2017 13:47:10 +0000 (13:47 +0000)]
Improvements to TableGen/LangIntro.rst

Document the 'code' data type, and that value{15-17} is different to
value{17-15}.

Patch by @chenwj (Wei-Ren Chen).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301920 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombine] (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)
Amaury Sechet [Tue, 2 May 2017 13:34:25 +0000 (13:34 +0000)]
[DAGCombine] (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)

Summary: Common pattern when legalizing large integers operations. Similar to D32687, when the carry isn't used.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301919 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Add test for PR30264 (combining multiple constants inputs in a shuffle)
Simon Pilgrim [Tue, 2 May 2017 12:25:17 +0000 (12:25 +0000)]
[X86][SSE] Add test for PR30264 (combining multiple constants inputs in a shuffle)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301915 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Tidyup subvector insert/extract helpers. NFCI.
Simon Pilgrim [Tue, 2 May 2017 11:08:15 +0000 (11:08 +0000)]
[X86] Tidyup subvector insert/extract helpers. NFCI.

Use getConstantOperandVal where possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301912 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix typo in comment. NFCI.
Simon Pilgrim [Tue, 2 May 2017 10:43:33 +0000 (10:43 +0000)]
Fix typo in comment. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301911 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SelectionDAG] Improve support for promotion of <1 x fX> floating point argument...
Simon Pilgrim [Tue, 2 May 2017 10:33:08 +0000 (10:33 +0000)]
[SelectionDAG] Improve support for promotion of <1 x fX> floating point argument types (PR31088)

PR31088 demonstrated that we were assuming that only integers require promotion from <1 x iX> types, when in fact float types may require it as well - in this case half floats.

This patch adds support for extension/truncation for both integer and float types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301910 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombiner] Improve MatchBswapHword logic (PR31357)
Simon Pilgrim [Tue, 2 May 2017 10:16:19 +0000 (10:16 +0000)]
[DAGCombiner] Improve MatchBswapHword logic (PR31357)

The existing code only looks at half of the tree when matching bswap + rol patterns ending in an OR tree (as opposed to a cascade).

Patch originally introduced by Jim Lewis.

Submitted on the behalf of Dinar Temirbulatov.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301907 91177308-0d34-0410-b5e6-96231b3b80d8