Commit Graph

299419 Commits

Author SHA1 Message Date
Eric Fiselier 4b47cbccd4 Fix incorrectly aligned exceptions in 32 bit builds.
This patch fixes a bug where exceptions in 32 bit builds
would be incorrectly aligned because malloc only provides 8 byte aligned
memory where 16 byte alignment is needed.

This patch makes libc++abi correctly use posix_memalign when it's
available. This requires defining _LIBCPP_BUILDING_LIBRARY so that
libc++ only defines _LIBCPP_HAS_NO_ALIGNED_ALLOCATION when libc doesn't
support it and not when aligned new/delete are disable for other
reasons.

This bug somehow made it into the 7.0 release, making it a regression.
Therefore this patch should be included in the next dot release.

llvm-svn: 342815
2018-09-22 19:22:36 +00:00
Roman Lebedev 931d66cd22 [libcxx] Blind attempt to fix harmless leak in nodiscard_extensions.pass.cpp test
libcxx-libcxxabi-x86_64-linux-ubuntu-asan complains about a leak here.

llvm-svn: 342814
2018-09-22 19:09:57 +00:00
Louis Dionne 8a15c924ae [libcxx] Fix the definition of the check-cxx-abilist target on Darwin
Summary:
r342805 added support for the check-cxx-abilist target on FreeBSD, but broke
the target on macOS in doing so. The problem is that the GENERIC_TARGET_TRIPLE
gets overwritten after replacing the FreeBSD regular expression, which
nullifies the replacement done with the darwin regular expression.

Reviewers: dim, EricWF

Subscribers: emaste, mgorny, krytarowski, christof, dexonsmith, cfe-commits, libcxx-commits

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

llvm-svn: 342813
2018-09-22 18:39:38 +00:00
Caroline Tice 29f0282b3e Fix codemodels.c test case (only test mcmodel=medium on X86).
aarch64 testing is broken because "medium" is not a valid
code-model on aarch64, and codemodels.c tests that.  This fixes
that problem by adding "-triple x86_64-unknown-linux-gnu" to the
test with "-mcode-model moedium".

llvm-svn: 342812
2018-09-22 18:25:58 +00:00
Louis Dionne 2e667527c5 [libunwind][NFC] Suppress unused parameter warnings
Reviewers: EricWF

Subscribers: christof, chrib, dexonsmith, cfe-commits

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

llvm-svn: 342811
2018-09-22 18:18:34 +00:00
Zhihao Yuan dbbb4b104d Document new symbols for __u64toa and __u32toa
Summary:
They are introduced in r338479; their Linux ABI changes are recorded in r338486.

TODO: Record the Mac OS X ABI changes.

Reviewers: EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne, libcxx-commits, cfe-commits

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

llvm-svn: 342810
2018-09-22 18:05:28 +00:00
Craig Topper e79a588cac [DAGCombiner] Rewrite r331896 in a different way to address a FIXME. NFCI
llvm-svn: 342809
2018-09-22 18:03:14 +00:00
Roman Lebedev c65d39a464 [libc++] Add _LIBCPP_ENABLE_NODISCARD and _LIBCPP_NODISCARD_EXT to allow pre-C++2a [[nodiscard]]
Summary:
The `[[nodiscard]]` attribute is intended to help users find bugs where
function return values are ignored when they shouldn't be. After C++17 the
C++ standard has started to declared such library functions as `[[nodiscard]]`.
However, this application is limited and applies only to dialects after C++17.
Users who want help diagnosing misuses of STL functions may desire a more
liberal application of `[[nodiscard]]`.

For this reason libc++ provides an extension that does just that! The
extension must be enabled by defining `_LIBCPP_ENABLE_NODISCARD`. The extended
applications of `[[nodiscard]]` takes two forms:

1. Backporting `[[nodiscard]]` to entities declared as such by the
   standard in newer dialects, but not in the present one.

2. Extended applications of `[[nodiscard]]`, at the libraries discretion,
   applied to entities never declared as such by the standard.

Users may also opt-out of additional applications `[[nodiscard]]` using
additional macros.

Applications of the first form, which backport `[[nodiscard]]` from a newer
dialect may be disabled using macros specific to the dialect it was added. For
example `_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17`.

Applications of the second form, which are pure extensions, may be disabled
by defining `_LIBCPP_DISABLE_NODISCARD_EXT`.

This patch was originally written by me (Roman Lebedev),
then but then reworked by Eric Fiselier.

Reviewers: mclow.lists, thakis, EricWF

Reviewed By: thakis, EricWF

Subscribers: llvm-commits, mclow.lists, lebedev.ri, EricWF, rjmccall, Quuxplusone, cfe-commits, christof

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

llvm-svn: 342808
2018-09-22 17:54:48 +00:00
Yonghong Song 55b9156730 [bpf] Test case for symbol information in object file
This patch tests the change introduced in r342556.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
llvm-svn: 342807
2018-09-22 17:31:01 +00:00
Sanjay Patel 09e02fbf51 [InstCombine][x86] try even harder to convert blendv intrinsic to generic IR (PR38814)
Follow-up to rL342324 (D52059):

Missing optimizations with blendv are shown in:
https://bugs.llvm.org/show_bug.cgi?id=38814

This is an easier and more powerful solution than adding pattern matching for a few 
special cases in the backend. The potential danger with this transform in IR is that 
the condition value can get separated from the select, and the backend might not be 
able to make a blendv out of it again.

llvm-svn: 342806
2018-09-22 14:43:55 +00:00
Dimitry Andric f3b94728c7 Similar to the handling of darwin target triples, strip the version
numbers off of freebsd target triples, when generating the name of the
ABI list file for check-cxx-abilist target.

Also remove unnecessary parentheses in the regex for darwin, and
slightly reword the comment.

llvm-svn: 342805
2018-09-22 14:37:49 +00:00
Raphael Isemann bfc5ef6c5b Change type of m_user_expression_start_pos to size_t
AbsPosToLineColumnPos is the only reader of m_user_expression_start_pos
and actually treats it like a size_t. Also the value we store in
m_user_expression_start_pos is originally a size_t, so it makes sense
to change the type of this variable to size_t.

llvm-svn: 342804
2018-09-22 13:33:08 +00:00
Dimitry Andric 7df93310f4 Remove a bunch of empty subdirectories. NFCI.
llvm-svn: 342803
2018-09-22 13:32:37 +00:00
Sylvestre Ledru 9ea1f3554d use the current url for bugzilla
llvm-svn: 342802
2018-09-22 07:41:09 +00:00
Sylvestre Ledru b06fe489aa update the links to use https
llvm-svn: 342801
2018-09-22 07:39:44 +00:00
George Rimar ce95ac6490 [lib/MC] - Set SHF_EXCLUDE flag for .dwo sections.
DWARF5 spec says about single file split case:

"The sections that do not require relocation, however, can be written
to the relocatable object (.o) file but ignored by the
the linker or they can be written to a separate DWARF object (.dwo) file
that need not be accessed by the linker."

Nice way to make linker to ignore them is to set SHF_EXCLUDE flag.
It seems to be not harmful to always set it for .dwo sections.
That is what this patch does.

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

llvm-svn: 342800
2018-09-22 07:36:20 +00:00
Simon Atanasyan 7c9648ff89 [mips] Provide more detailed description for MIPS targets. NFC
llvm-svn: 342799
2018-09-22 06:04:32 +00:00
Simon Atanasyan 1ba42ab73a [mips] Remove obsoleted "experimental" tag from MIPS 64-bit targets. NFC
llvm-svn: 342798
2018-09-22 06:04:26 +00:00
Craig Topper 2b3f5df73a [InstCombine] Fold (min/max ~X, Y) -> ~(max/min X, ~Y) when Y is freely invertible
Summary: This restores the combine that was reverted in r341883. The infinite loop from the failing test no longer occurs due to changes from r342163.

Reviewers: spatel, dmgreen

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 342797
2018-09-22 05:53:27 +00:00
Craig Topper 082e04c61d [X86] Fix inline expansion for memset in x32
Summary: Similar to D51893 which was for memcpy

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

llvm-svn: 342796
2018-09-22 05:16:35 +00:00
Craig Topper 9995760df4 [X86] Fold (movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C)) for vXi8 vectors.
We don't have a vXi8 shift left so we need to bitcast to a vXi16 vector to perform the shift. If we let lowering legalize the vXi8 shift we get an extra and that we don't need and fail to remove.

llvm-svn: 342795
2018-09-22 05:08:38 +00:00
Richard Trieu 8d3fa39a0d Update smart pointer detection for thread safety analysis.
Objects are determined to be smart pointers if they have both a star and arrow
operator.  Some implementations of smart pointers have these overloaded
operators in a base class, while the check only searched the derived class.
This fix will also look for the operators in the base class.

llvm-svn: 342794
2018-09-22 01:50:52 +00:00
Leonard Chan b32d40417e [Lexer] Add udefined_behavior_sanitizer feature
This can be used to detect whether the code is being built with UBSan using
the __has_feature(undefined_behavior_sanitizer) predicate.

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

llvm-svn: 342793
2018-09-22 01:03:16 +00:00
Vyacheslav Zakharin 6ce2a2b48e Test commit.
llvm-svn: 342792
2018-09-22 01:01:03 +00:00
Jordan Rupprecht 8d60f9b6d2 [llvm-size] Berkeley formatting: use tabs instead of spaces as field delimeters.
This matches GNU behavior for size and allows use of cut to parse the output of llvm-size.

llvm-svn: 342791
2018-09-21 23:48:12 +00:00
Aaron Puchert 4e6afcfc11 Thread safety analysis: Make printSCFG compile again [NFC]
Not used productively, so no observable functional change.

Note that printSCFG doesn't yet work reliably, it seems to crash
sometimes.

llvm-svn: 342790
2018-09-21 23:46:35 +00:00
Caroline Tice 7fc64a69b6 Fix codemodels.c test case (only test mcmodel-kernel on x86)
A recent commit I made broke aarch64 testing, because "kernel"
apparently is not a valid code-model on aarch64, and one of my tests
tested that. This fixes the problem (hopefully) by adding "-triple
x86_64-unknown-linux-gnu" to the test build with "-mcodel-model
kernel".

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

llvm-svn: 342789
2018-09-21 23:19:49 +00:00
Craig Topper ecdab03d10 [X86] Teach fast isel to use MOV32ri64 for loading an unsigned 32 immediate into a 64-bit register.
Previously we used SUBREG_TO_REG+MOV32ri. But regular isel was changed recently to use the MOV32ri64 pseudo. Fast isel now does the same.

llvm-svn: 342788
2018-09-21 23:14:05 +00:00
Aaron Puchert 969f32d515 Thread safety analysis: Make sure FactEntrys stored in FactManager are immutable [NFC]
Since FactEntrys are stored in the FactManager, we can't manipulate them
anymore when they are stored there.

llvm-svn: 342787
2018-09-21 23:08:30 +00:00
Warren Ristow 4f27730eaf [Loop Vectorizer] Abandon vectorization when no integer IV found
Support for vectorizing loops with secondary floating-point induction
variables was added in r276554.  A primary integer IV is still required
for vectorization to be done.  If an FP IV was found, but no integer IV
was found at all (primary or secondary), the attempt to vectorize still
went forward, causing a compiler-crash.  This change abandons that
attempt when no integer IV is found.  (Vectorizing FP-only cases like
this, rather than bailing out, is discussed as possible future work
in D52327.)

See PR38800 for more information.

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

llvm-svn: 342786
2018-09-21 23:03:50 +00:00
Aaron Ballman d7e83e7362 Move individual benchmark targets into the Utils folder in IDEs.
llvm-svn: 342785
2018-09-21 23:01:32 +00:00
Zachary Turner dc39f4d834 Try moving this function to another file.
I can't reproduce this compilation failure so I can't really
test this fix.

llvm-svn: 342784
2018-09-21 23:00:37 +00:00
Lang Hames 47fc3a4550 [ORC] In RTDyldObjectLinkingLayer, only call NotifyFreed if the object file
has been finalized.

This prevents crashes on unfinalized objects for clients using
JITEventListeners.

Patch by Geoff Levner. Thanks Geoff!

llvm-svn: 342783
2018-09-21 22:59:48 +00:00
Aaron Ballman 34893e6c0f Add benchmark and benchmark_main to the Utils folder in IDEs.
llvm-svn: 342782
2018-09-21 22:55:57 +00:00
Zachary Turner a9defc348b Add missing include.
llvm-svn: 342781
2018-09-21 22:44:31 +00:00
Zachary Turner 6345e84dde [NativePDB] Add support for reading function signatures.
This adds support for parsing function signature records and returning
them through the native DIA interface.

llvm-svn: 342780
2018-09-21 22:36:28 +00:00
Zachary Turner 355ffb0032 [PDB] Add native reading support for UDT / class types.
This allows the native reader to find records of class/struct/
union type and dump them.  This behavior is tested by using the
diadump subcommand against golden output produced by actual DIA
SDK on the same PDB file, and again using pretty -native to
confirm that we actually dump the classes.  We don't find class
members or anything like that yet, for now it's just the class
itself.

llvm-svn: 342779
2018-09-21 22:36:04 +00:00
Fedor Sergeev 10febb0779 [New PM][PassInstrumentation] Adding PassInstrumentation to the AnalysisManager runs
As a prerequisite to time-passes implementation which needs to time both passes
and analyses, adding instrumentation points to the Analysis Manager.
The are two functional differences between Pass and Analysis instrumentation:
  - the latter does not increment pass execution counter
  - it does not provide ability to skip execution of the corresponding analysis

Reviewers: chandlerc, philip.pfaffe
Differential Revision: https://reviews.llvm.org/D51275

llvm-svn: 342778
2018-09-21 22:10:17 +00:00
Martin Storsjo 5f6d527f09 [COFF] Support linking to import libraries from GNU binutils
GNU binutils import libraries aren't the same kind of short import
libraries as link.exe and LLD produce, but are a plain static library
containing .idata section chunks. MSVC link.exe can successfully link
to them.

In order for imports from GNU import libraries to mix properly with the
normal import chunks, the chunks from the existing mechanism needs to
be added into named sections like .idata$2.

These GNU import libraries consist of one header object, a number of
object files, one for each imported function/variable, and one trailer.
Within the import libraries, the object files are ordered alphabetically
in this order. The chunks stemming from these libraries have to be
grouped by what library they originate from and sorted, to make sure
the section chunks for headers and trailers for the lists are ordered
as intended. This is done on all sections named .idata$*, before adding
the synthesized chunks to them.

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

llvm-svn: 342777
2018-09-21 22:01:06 +00:00
Adrian Prantl 2e102480ac llvm-dwarfdump --statistics: Unique abstract origins across multiple CUs.
Instead of indexing local variables by DIE offset, use the variable
name + the path through the lexical block tree. This makes the lookup
key consistent across duplicate abstract origins in different CUs.

llvm-svn: 342776
2018-09-21 21:59:34 +00:00
Sanjay Patel db1fb8cd20 [x86] add more tests for poetntial andnp splitting with AVX1; NFC
llvm-svn: 342775
2018-09-21 21:25:16 +00:00
Richard Trieu 5061e83295 Make compare function in r342648 have strict weak ordering.
Comparison functions used in sorting algorithms need to have strict weak
ordering.  Remove the assert and allow comparisons on all lists.

llvm-svn: 342774
2018-09-21 21:20:33 +00:00
Simon Pilgrim eabc582b62 [X86] Add AVX512 target to load scalar to vector tests
To investigate broadcast instruction codegen for D51553

llvm-svn: 342773
2018-09-21 21:08:26 +00:00
Wouter van Oortmerssen e0403f13c4 [WebAssembly] Simplified selecting asmmatcher stack instructions.
Summary:
By using the existing isCodeGenOnly bit in the tablegen defs, as
suggested by tlively in https://reviews.llvm.org/D51662

Tested: llvm-lit -v `find test -name WebAssembly`

Reviewers: tlively

Subscribers: dschuff, sbc100, jgravelle-google, aheejin, sunfish, llvm-commits

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

llvm-svn: 342772
2018-09-21 20:53:55 +00:00
Jorge Gorbe Moya a9d9836d98 Test commit. Removed a blank line.
llvm-svn: 342771
2018-09-21 20:45:08 +00:00
George Karpenkov 04553e530f [analyzer] Process state in checkEndFunction in RetainCountChecker
Modify the RetainCountChecker to perform state "adjustments" in
checkEndFunction, as performing work in PreStmt<ReturnStmt> does not
work with destructors.
The previous version made an implicit assumption that no code runs
after the return statement is executed.

rdar://43945028

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

llvm-svn: 342770
2018-09-21 20:37:20 +00:00
George Karpenkov 200e809dbd [analyzer] Highlight sink nodes in red
Differential Revision: https://reviews.llvm.org/D52337

llvm-svn: 342769
2018-09-21 20:37:01 +00:00
George Karpenkov 33e5a15896 [analyzer] Associate diagnostics created in checkEndFunction with a return statement, if possible
If not possible, use the last line of the declaration, as before.

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

llvm-svn: 342768
2018-09-21 20:36:41 +00:00
George Karpenkov 6babf2ae16 [analyzer] [NFC] Prefer make_unique over "new"
Differential Revision: https://reviews.llvm.org/D52336

llvm-svn: 342767
2018-09-21 20:36:21 +00:00
George Karpenkov a31c224bb4 [analyzer] Fix bug in isInevitablySinking
If the non-sink report is generated at the exit node, it will be
suppressed by the current functionality in isInevitablySinking, as it
only checks the successors of the block, but not the block itself.

The bug shows up in RetainCountChecker checks.

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

llvm-svn: 342766
2018-09-21 20:36:01 +00:00