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
Rafael Espindola [Tue, 2 May 2017 20:19:42 +0000 (20:19 +0000)]
Revert "Fix misnamed #include. Remove _NC suffix from ELF relocations TLSDESC_{LD64,ADD}_LO12"
This reverts commit r301964. It broke the build.
llvm-svn: 301969
Reid Kleckner [Tue, 2 May 2017 20:10:03 +0000 (20:10 +0000)]
Simplify some va_start checking logic
Combine the logic doing the ms_abi/sysv_abi checks into one function so
that each check and its logical opposite are near each other. Now we
don't need two Sema entry points for MS va_start and regular va_start.
Refactor the code that checks if the va_start caller is a function,
block, or obj-c method. We do this in three places, and they are all
buggy for variadic lambdas (PR32737). After this change, I have one
place to apply the functional fix.
NFC
llvm-svn: 301968
Kuba Mracek [Tue, 2 May 2017 20:09:33 +0000 (20:09 +0000)]
[asan] Mark atos-symbolizer-dyld-root-path.cc testcase as unsupported on iOS.
llvm-svn: 301967
Kuba Mracek [Tue, 2 May 2017 19:37:28 +0000 (19:37 +0000)]
[asan] Mark a bunch of tests as unsupported on iOS
This patch marks a few ASan tests as unsupported on iOS. These are mostly tests that use files or paths that are invalid/inaccessible on iOS or the simulator. We currently don't have a good way of propagating/copying secondary files that individual tests need. The same problem exists on Android, so I'm just marking the tests as UNSUPPORTED now.
Differential Revision: https://reviews.llvm.org/D32632
llvm-svn: 301966
Kuba Mracek [Tue, 2 May 2017 19:35:29 +0000 (19:35 +0000)]
[asan] Disable some Darwin tests that don't work on iOS simulator
Differential Revision: https://reviews.llvm.org/D32633
llvm-svn: 301965
Joel Jones [Tue, 2 May 2017 19:31:40 +0000 (19:31 +0000)]
Fix misnamed #include. Remove _NC suffix from ELF relocations TLSDESC_{LD64,ADD}_LO12
llvm-svn: 301964
Daniel Jasper [Tue, 2 May 2017 19:21:42 +0000 (19:21 +0000)]
Revert r301822 (and dependent r301825), which tried to improve the
handling of constexprs with unknown bounds.
This triggers a corner case of the language where it's not yet clear
whether this should be an error:
struct A {
static void *const a[];
static void *const b[];
};
constexpr void *A::a[] = {&b[0]};
constexpr void *A::b[] = {&a[0]};
When discovering the initializer for A::a, the bounds of A::b aren't known yet.
It is unclear whether warning about errors should be deferred until the end of
the translation unit, possibly resolving errors that can be resolved. In
practice, the compiler can know the bounds of all arrays in this example.
Credits for reproducers and explanation go to Richard Smith. Richard, please
add more info in case my explanation is wrong.
llvm-svn: 301963
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").
llvm-svn: 301962
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.
llvm-svn: 301961
Vedant Kumar [Tue, 2 May 2017 18:51:41 +0000 (18:51 +0000)]
Revert "[docs] UBSan: Mention that print_stacktrace=1 is unsupported on Darwin"
This reverts commit r300295.
It's no longer true, print_stacktrace=1 is supported on Darwin/Windows
as of r301839.
llvm-svn: 301960
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.
llvm-svn: 301959
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.
llvm-svn: 301958
Krzysztof Parzyszek [Tue, 2 May 2017 18:29:49 +0000 (18:29 +0000)]
[Hexagon] Fix uninitialized value caught with valgrind
Patch by Colin LeMahieu.
llvm-svn: 301957
Krzysztof Parzyszek [Tue, 2 May 2017 18:19:11 +0000 (18:19 +0000)]
[Hexagon] Change iconst to emit 27bit relocation
Patch by Colin LeMahieu.
llvm-svn: 301956
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.
llvm-svn: 301955
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.
llvm-svn: 301954
Krzysztof Parzyszek [Tue, 2 May 2017 18:09:07 +0000 (18:09 +0000)]
[Hexagon] Formatting changes, NFC
llvm-svn: 301953
Krzysztof Parzyszek [Tue, 2 May 2017 18:05:36 +0000 (18:05 +0000)]
[Hexagon] Remove unused validSubtarget TSFlags
Patch by Colin LeMahieu.
llvm-svn: 301952