Krzysztof Parzyszek [Wed, 3 May 2017 20:10:36 +0000 (20:10 +0000)]
[Hexagon] Use automatically-generated scheduling information for HVX
Patch by Jyotsna Verma.
llvm-svn: 302073
Tobias Grosser [Wed, 3 May 2017 20:08:52 +0000 (20:08 +0000)]
[ScopInfo] Do not use LLVM names to identify statements, arrays, and parameters
LLVM-IR names are commonly available in debug builds, but often not in release
builds. Hence, using LLVM-IR names to identify statements or memory reference
results makes the behavior of Polly depend on the compile mode. This is
undesirable. Hence, we now just number the statements instead of using LLVM-IR
names to identify them (this issue has previously been brought up by Zino
Benaissa).
However, as LLVM-IR names help in making test cases more readable, we add an
option '-polly-use-llvm-names' to still use LLVM-IR names. This flag is by
default set in the polly tests to make test cases more readable.
This change reduces the time in ScopInfo from 32 seconds to 2 seconds for the
following test case provided by Eli Friedman <efriedma@codeaurora.org> (already
used in one of the previous commits):
struct X { int x; };
void a();
#define SIG (int x, X **y, X **z)
typedef void (*fn)SIG;
#define FN { for (int i = 0; i < x; ++i) { (*y)[i].x += (*z)[i].x; } a(); }
#define FN5 FN FN FN FN FN
#define FN25 FN5 FN5 FN5 FN5
#define FN125 FN25 FN25 FN25 FN25 FN25
#define FN250 FN125 FN125
#define FN1250 FN250 FN250 FN250 FN250 FN250
void x SIG { FN1250 }
For a larger benchmark I have on-hand (10000 loops), this reduces the time for
running -polly-scops from 5 minutes to 4 minutes, a reduction by 20%.
The reason for this large speedup is that our previous use of printAsOperand
had a quadratic cost, as for each printed and unnamed operand the full function
was scanned to find the instruction number that identifies the operand.
We do not need to adjust the way memory reference ids are constructured, as
they do not use LLVM values.
Reviewed by: efriedma
Tags: #polly
Differential Revision: https://reviews.llvm.org/D32789
llvm-svn: 302072
Zachary Turner [Wed, 3 May 2017 19:42:06 +0000 (19:42 +0000)]
Remove unused private field.
llvm-svn: 302069
Anna Thomas [Wed, 3 May 2017 19:25:04 +0000 (19:25 +0000)]
Avoid warning of unused variable in release builds. NFC
llvm-svn: 302068
Peter Collingbourne [Wed, 3 May 2017 19:23:30 +0000 (19:23 +0000)]
Revert r301897, "ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO."
It doesn't matter what binding we store in a non-UsedInRegularObj undefined
symbol because we should reset it when we see a real undefined symbol in
a combined LTO object. The fact that we weren't doing so before is a bug
(PR32899) which is now fixed.
llvm-svn: 302067
Tim Northover [Wed, 3 May 2017 19:20:45 +0000 (19:20 +0000)]
Tests: strengthen CHECK line to avoid picking up stray path.
A bot had "-LTO" in its working directory, which matched the regex used in this
test. Since the arg is quoted, we can exploit that instead. Still broken if
there's a path with a quote in, but I think that's pretty niche.
llvm-svn: 302066
Rafael Espindola [Wed, 3 May 2017 18:40:27 +0000 (18:40 +0000)]
Handle mixed strong and weak undefined symbols.
We were ignoring strong undefined symbols if they followed weak ones.
Fixes pr32899.
llvm-svn: 302065
Kostya Serebryany [Wed, 3 May 2017 18:38:34 +0000 (18:38 +0000)]
[asan] print the 'unexpected format specifier in printf interceptor' warning just once (came up in https://github.com/google/oss-fuzz/pull/562). Not touching a similar scanf warning -- for some reason it does not fire for me.
llvm-svn: 302064
Sanjoy Das [Wed, 3 May 2017 18:29:34 +0000 (18:29 +0000)]
Fix typos in comment
llvm-svn: 302063
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
llvm-svn: 302062
Anna Thomas [Wed, 3 May 2017 18:25:43 +0000 (18:25 +0000)]
Fix PPC64 warning for missing parantheses. NFC.
llvm-svn: 302061
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
llvm-svn: 302060
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.
llvm-svn: 302059
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
llvm-svn: 302058
Zachary Turner [Wed, 3 May 2017 17:38:49 +0000 (17:38 +0000)]
Delete dead function causing compilation failure.
llvm-svn: 302057
Davide Italiano [Wed, 3 May 2017 17:37:35 +0000 (17:37 +0000)]
[CodeView] Remove unused private field. NFCI.
llvm-svn: 302056
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>
llvm-svn: 302055
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.
llvm-svn: 302054
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.
llvm-svn: 302053
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
llvm-svn: 302052
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.
llvm-svn: 302051
Kuba Mracek [Wed, 3 May 2017 16:51:01 +0000 (16:51 +0000)]
[tsan] Detect races on modifying accesses in Swift code
This patch allows the Swift compiler to emit calls to `__tsan_external_write` before starting any modifying access, which will cause TSan to detect races on arrays, dictionaries and other classes defined in non-instrumented modules. Races on collections from the Swift standard library and user-defined structs and a frequent cause of subtle bugs and it's important that TSan detects those on top of existing LLVM IR instrumentation, which already detects races in direct memory accesses.
Differential Revision: https://reviews.llvm.org/D31630
llvm-svn: 302050
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
llvm-svn: 302049
Simon Pilgrim [Wed, 3 May 2017 16:43:57 +0000 (16:43 +0000)]
Silence a 'enum and non-enum used in conditional' warning.
llvm-svn: 302048
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
llvm-svn: 302047
Alex Lorenz [Wed, 3 May 2017 16:22:16 +0000 (16:22 +0000)]
Revert r302037
The commit caused the following two buildbot failures:
Clang :: Misc/error-limit-multiple-notes.cpp
Clang :: Misc/error-limit.c
llvm-svn: 302046
Reid Kleckner [Wed, 3 May 2017 16:11:01 +0000 (16:11 +0000)]
Revert my bad winasan coverage test fix and apply one that actually works
trace-pc doesn't work, but trace-pc-guard does. *shrug*
llvm-svn: 302045
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
llvm-svn: 302044
Reid Kleckner [Wed, 3 May 2017 15:59:07 +0000 (15:59 +0000)]
Speculative fix for WinASan after r301994
llvm-svn: 302043
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.
llvm-svn: 302042
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
llvm-svn: 302041
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
llvm-svn: 302040
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
llvm-svn: 302039
Simon Pilgrim [Wed, 3 May 2017 15:42:29 +0000 (15:42 +0000)]
Revert rL302028 due to accidental line ending changes.
llvm-svn: 302038
Alex Lorenz [Wed, 3 May 2017 15:41:16 +0000 (15:41 +0000)]
DiagnosticsEngine should clear DelayedDiagID before reporting the
delayed diagnostic
This avoids an infinite loop that was uncovered in one of our internal tests
by r301992. The testcase is the most reduced version of that auto-generated
test.
rdar://
31962618
llvm-svn: 302037
Krzysztof Parzyszek [Wed, 3 May 2017 15:36:51 +0000 (15:36 +0000)]
[Hexagon] Handle S2_storerf_io in HexagonInstrInfo
llvm-svn: 302036
Krzysztof Parzyszek [Wed, 3 May 2017 15:34:52 +0000 (15:34 +0000)]
[Hexagon] Misc fixes in HexagonInstrInfo, NFC
Formatting changes + remove unused function.
llvm-svn: 302035
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.
llvm-svn: 302034
Krzysztof Parzyszek [Wed, 3 May 2017 15:30:46 +0000 (15:30 +0000)]
[Hexagon] Handle J2_jumptpt and J2_jumpfpt in HexagonInstrInfo
llvm-svn: 302033
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.
llvm-svn: 302032
Carlo Bertolli [Wed, 3 May 2017 15:28:48 +0000 (15:28 +0000)]
[OpenMP] Extended parse for 'always' map modifier
https://reviews.llvm.org/D32807
This patch allows the map modifier 'always' to be separated by the map type (to, from, tofrom) only by a whitespace, rather than strictly by a comma as in current trunk.
llvm-svn: 302031
Krzysztof Parzyszek [Wed, 3 May 2017 15:26:13 +0000 (15:26 +0000)]
[Hexagon] Add memory operands to a rewritten load
llvm-svn: 302030
Krzysztof Parzyszek [Wed, 3 May 2017 15:23:53 +0000 (15:23 +0000)]
[Hexagon] Reset spill alignment when variable-sized objects are present
llvm-svn: 302029
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
llvm-svn: 302028
Francis Ricci [Wed, 3 May 2017 15:00:04 +0000 (15:00 +0000)]
Don't attempt to use mpx registers on unsupported platforms
Summary:
The existing cpp-level checks using PR_MPX_ENABLE_MANAGEMENT aren't sufficient,
as this isn't defined for linux kernel versions below 3.19.
Reviewers: valentinagiusti, zturner, labath
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D32719
llvm-svn: 302027
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
llvm-svn: 302026
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
llvm-svn: 302025
Oren Ben Simhon [Wed, 3 May 2017 14:05:00 +0000 (14:05 +0000)]
Reusing an existing attribute diagnostic
In a previous patch, a new generic error diagnostic for inconsistent attributes was added.
In this commit I reuse this diagnostic for ns_returns_retained attribute check.
Differential Revision: https://reviews.llvm.org/D32697
llvm-svn: 302024
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
llvm-svn: 302023
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
llvm-svn: 302022
Siddharth Bhat [Wed, 3 May 2017 13:15:27 +0000 (13:15 +0000)]
[CUDA Managed Memory] Fix regression introduced by Managed Memory
- Fixes breakage from commit 5536f.
- Interference with commit 764f3 caused testcase to fail. Reverting
764f3 allows commit 5536f to succeed.
- Generated kernel code was slightly different due to 764f3, which
caused testcase to fail.
llvm-svn: 302021
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
llvm-svn: 302020
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
llvm-svn: 302018
Dylan McKay [Wed, 3 May 2017 11:56:01 +0000 (11:56 +0000)]
[AVR] Reserve the Y register in all functions
llvm-svn: 302017
Artem Dergachev [Wed, 3 May 2017 11:47:13 +0000 (11:47 +0000)]
[analyzer] Fix memory error bug category capitalization.
It was written as "Memory Error" in most places and as "Memory error" in a few
other places, however it is the latter that is more consistent with
other categories (such as "Logic error").
rdar://problem/
31718115
Differential Revision: https://reviews.llvm.org/D32702
llvm-svn: 302016
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
llvm-svn: 302015
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.
llvm-svn: 302014
Pavel Labath [Wed, 3 May 2017 11:27:35 +0000 (11:27 +0000)]
Windows fix for TestConflictingDefinition makefile
gnuwin32 rm does not like wildcards that match nothing even if we
specify -f (probably because the wildcard expansion happens in-process
there). We could use make $(wildcard) here, but it seems safer to
explicitly list the files here, just like the normal Makefile.rules
does.
llvm-svn: 302013
Daniel Jasper [Wed, 3 May 2017 11:27:34 +0000 (11:27 +0000)]
Undo turning ExtBehavior into a bitfield.
This produces warnings that I can't explain in a GCC build:
In file included from ../tools/clang/include/clang/Lex/LexDiagnostic.h:13:0,
from /usr/local/google/home/djasper/llvm/tools/clang/lib/Lex/PTHLexer.cpp:19:
../tools/clang/include/clang/Basic/Diagnostic.h:219:34: warning: ‘clang::DiagnosticsEngine::DiagState::ExtBehavior’ is too small to hold all values of ‘enum class clang::diag::Severity’ [enabled by default]
diag::Severity ExtBehavior : 4; // Map extensions to warnings or errors?
^
While I don't think this warning makes sense, I'd like to get this back to being
warning-free. This only seems to trigger for "enum class".
Reproducer:
https://godbolt.org/g/P2ekVd
llvm-svn: 302012
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
llvm-svn: 302011
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.
llvm-svn: 302010
Daniel Jasper [Wed, 3 May 2017 10:04:25 +0000 (10:04 +0000)]
Fix tests after speculatable intrinsics patch
These were relying on the attribute group numbering
llvm-svn: 302009
Pavel Labath [Wed, 3 May 2017 10:00:00 +0000 (10:00 +0000)]
Check for lack of C++ context first when demangling
Summary: It seems that if we have no context, then it can't possibly be a method. Check that first.
Reviewers: clayborg
Reviewed By: clayborg
Subscribers: labath, lldb-commits
Differential Revision: https://reviews.llvm.org/D32708
Patch by Scott Smith <scott.smith@purestorage.com>.
llvm-svn: 302008
Peter Smith [Wed, 3 May 2017 08:44:50 +0000 (08:44 +0000)]
[ELF] Fix problems with fabricateDefaultCommands() and --section-start
The --section-start <name>=<address> needs to be translated into equivalent
linker script commands. There are a couple of problems with the existing
implementation:
- The --section-start with the lowest address is assumed to be at the start
of the map. This assumption is incorrect, we have to iterate through the
SectionStartMap to find the lowest address.
- The addresses in --section-start were being over-aligned when the
sections were marked as PageAlign. This is inconsistent with the use of
SectionStartMap in fixHeaders(), and can cause problems when the PageAlign
causes an "unable to move location counter backward" error when the
--section-start with PageAlign is aligned to an address higher than the next
--section-start. The ld.bfd and ld.gold seem to be more consistent with this
approach but this is not a well specified area.
This change fixes the problems above and also corrects a typo in which
fabricateDefaultCommands() is called with the wrong parameter, it should be
called with AllocateHeader not Config->MaxPageSize.
Differential Revision: https://reviews.llvm.org/D32749
llvm-svn: 302007
George Rimar [Wed, 3 May 2017 08:21:42 +0000 (08:21 +0000)]
[ELF] - Added testcase gdb-index-ranges.s (https://reviews.llvm.org/D32750)
Before rL301170 was landed, LLD did not produce correct entries in .gdb_index address area.
Issue was fixed on LLVM DWARF parsers side and was relative to how .debug_ranges
section was scanned. It was main problem of PR32319.
It makes sense to have testcase on LLD size too. This checks that we generate proper values
now, because we do not have any tests for .gdb_index which works with .debug_ranges atm.
Differential revision: https://reviews.llvm.org/D32750
llvm-svn: 302006
Tobias Grosser [Wed, 3 May 2017 08:02:32 +0000 (08:02 +0000)]
[ScopInfo] Remove code not needed anymore after r302004
llvm-svn: 302005
Tobias Grosser [Wed, 3 May 2017 07:57:35 +0000 (07:57 +0000)]
[ScopInfo] Do not add array name into memory reference ids
Before this change a memory reference identifier had the form:
<STMT>_<ACCESSTYPE><ID>_<MEMREF>, e.g., Stmt_bb9_Write0_MemRef_tmp11
After this change, we use the format:
<STMT>_<ACCESSTYPE><ID>, e.g., Stmt_bb9_Write0
The name of the array that is accessed through a memory reference is not
necessary to uniquely identify a memory reference, but was only added to
provide additional information for debugging. We drop this information now
for the following two reasons:
1) This shortens the names and consequently improves readability
2) This removes a second location where we decide on the name of a scop array,
leaving us only with the location where the actual scop array is created.
Having after 2) only a single location to name scop arrays will allow us to
change the naming convention of scop arrays more easily, which we will do
in a future commit to reduce compilation time.
llvm-svn: 302004
Daniel Jasper [Wed, 3 May 2017 07:48:27 +0000 (07:48 +0000)]
Silences gcc's -Wnarrowing.
I think this is a false positive in GCC's warning, but nonetheless, we
should try to be warning-free. Smaller reproducer (reproduces with GCC
6.3):
https://godbolt.org/g/cJuO2z
llvm-svn: 302003
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.
llvm-svn: 302002
Maxim Ostapenko [Wed, 3 May 2017 07:09:10 +0000 (07:09 +0000)]
[sanitizer] Intercept mcheck and mprobe on Linux
This patch addresses https://github.com/google/sanitizers/issues/804.
Users can use mcheck and mprobe functions to verify heap state so we should intercept them to avoid breakage of valid code.
Differential Revision: https://reviews.llvm.org/D32589
llvm-svn: 302001
Yuka Takahashi [Wed, 3 May 2017 06:02:45 +0000 (06:02 +0000)]
Revert rL301998: "Fix a bug that -isysroot is completely ignored on Unix"
This reverts commit because it broke
sanitizer-x86_64-linux-autoconf bot and
clang-ppc64be-linux-multistage bot.
llvm-svn: 302000
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".
llvm-svn: 301999
Yuka Takahashi [Wed, 3 May 2017 04:58:39 +0000 (04:58 +0000)]
Fix a bug that -isysroot is completely ignored on Unix
-isysroot is the flag which set the system root directory.
This bug report https://bugs.llvm.org//show_bug.cgi?id=11503
shows that -isysroot is not handled at all on Unix, so fixed this bug.
After this diff, I could get this result https://pastebin.com/TeCmn9mj .
Differential Revision: https://reviews.llvm.org/D31495
llvm-svn: 301998
Matt Arsenault [Wed, 3 May 2017 03:04:40 +0000 (03:04 +0000)]
Fix tests after speculatable intrinsics patch
These were relying on the attribute group numbering
llvm-svn: 301996
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.
llvm-svn: 301995
Kostya Serebryany [Wed, 3 May 2017 01:27:28 +0000 (01:27 +0000)]
[sanitizer-coverage] add a deprecation warning to the old sanitizer-coverage flag combinations
llvm-svn: 301994
Sean Callanan [Wed, 3 May 2017 00:41:43 +0000 (00:41 +0000)]
Fixed a bug where we did not properly use the complete versions of Objective-C classes.
Also added a test case, thanks to Greg Clayton.
<rdar://problem/
18913551>
llvm-svn: 301993
Richard Smith [Wed, 3 May 2017 00:28:49 +0000 (00:28 +0000)]
[modules] Round-trip -Werror flag through explicit module build.
The intent for an explicit module build is that the diagnostics produced within
the module are those that were configured when the module was built, not those
that are enabled within a user of the module. This includes diagnostics that
don't actually show up until the module is used (for instance, diagnostics
produced during template instantiation and weird cases like -Wpadded).
We serialized and restored the diagnostic state for individual warning groups,
but previously did not track the state for flags like -Werror and -Weverything,
which are implemented as separate bits rather than as part of the diagnostics
mapping information.
llvm-svn: 301992
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.
llvm-svn: 301991
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
llvm-svn: 301990
Richard Trieu [Tue, 2 May 2017 23:58:52 +0000 (23:58 +0000)]
[ODRHash] Add support for array and decayed types, and parameter names and types.
llvm-svn: 301989
Vedant Kumar [Tue, 2 May 2017 23:46:56 +0000 (23:46 +0000)]
[ubsan] Skip overflow checks on safe arithmetic (fixes PR32874)
Currently, ubsan emits overflow checks for arithmetic that is known to
be safe at compile-time, e.g:
1 + 1 => CheckedAdd(1, 1)
This leads to breakage when using the __builtin_prefetch intrinsic. LLVM
expects the arguments to @llvm.prefetch to be constant integers, and
when ubsan inserts unnecessary checks on the operands to the intrinsic,
this contract is broken, leading to verifier failures (see PR32874).
Instead of special-casing __builtin_prefetch for ubsan, this patch fixes
the underlying problem, i.e that clang currently emits unnecessary
overflow checks.
Testing: I ran the check-clang and check-ubsan targets with a stage2,
ubsan-enabled build of clang. I added a regression test for PR32874, and
some extra checking to make sure we don't regress runtime checking for
unsafe arithmetic. The existing ubsan-promoted-arithmetic.cpp test also
provides coverage for this change.
llvm-svn: 301988
Zachary Turner [Tue, 2 May 2017 23:41:51 +0000 (23:41 +0000)]
Fix type conversion error.
llvm-svn: 301987
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.
llvm-svn: 301986
Xin Tong [Tue, 2 May 2017 23:24:12 +0000 (23:24 +0000)]
Typo in LangRef.rst. NFC
llvm-svn: 301985
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
llvm-svn: 301984
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.
llvm-svn: 301983
Rui Ueyama [Tue, 2 May 2017 22:42:24 +0000 (22:42 +0000)]
Remove a dead function declaration.
llvm-svn: 301982
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.
llvm-svn: 301981
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
llvm-svn: 301980
Joel Jones [Tue, 2 May 2017 22:01:30 +0000 (22:01 +0000)]
Remove _NC suffix from ELF relocations TLSDESC_{LD64,ADD}_LO12
llvm-svn: 301979
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
llvm-svn: 301978
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
llvm-svn: 301977
Kuba Mracek [Tue, 2 May 2017 21:22:29 +0000 (21:22 +0000)]
[asan] Mark some more testcases as unsupported on iOS.
llvm-svn: 301976
Rui Ueyama [Tue, 2 May 2017 21:16:06 +0000 (21:16 +0000)]
Fix typo.
llvm-svn: 301975
Davide Italiano [Tue, 2 May 2017 21:11:40 +0000 (21:11 +0000)]
[NewGVN] Fix typo and format comment. NFCI.
llvm-svn: 301974
Faisal Vali [Tue, 2 May 2017 21:02:46 +0000 (21:02 +0000)]
[NFC] Add original test that triggered crash post r301735
- this is added just for completeness sake (though the general case should be represented by the test added in the revision to that patch: https://reviews.llvm.org/rL301972 )
llvm-svn: 301973
Faisal Vali [Tue, 2 May 2017 20:56:34 +0000 (20:56 +0000)]
Fix PR32831 (Try Again): 'this' capture while instantiating generic lambda call operator specialization
When computing the appropriate cv-qualifiers for the 'this' capture, we have to examine each enclosing lambda - but when using the FunctionScopeInfo stack we have to ensure that the lambda below (outer) is the decl-context of the closure-class of the current lambda.
https://bugs.llvm.org/show_bug.cgi?id=32831
This patch was initially committed here: https://reviews.llvm.org/rL301735
Then reverted here: https://reviews.llvm.org/rL301916
The issue with the original patch was a failure to check that the closure type has been created within the LambdaScopeInfo before querying its DeclContext - instead of just assuming it has (silly!). A reduced example such as this highlights the problem:
struct X {
int data;
auto foo() { return [] { return [] -> decltype(data) { return 0; }; }; }
};
When 'data' within decltype(data) tries to determine the type of 'this', none of the LambdaScopeInfo's have their closure types created at that point.
llvm-svn: 301972
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
llvm-svn: 301971
George Burgess IV [Tue, 2 May 2017 20:24:56 +0000 (20:24 +0000)]
[Sema] Update function doc; NFC
llvm-svn: 301970