Commit Graph

259541 Commits

Author SHA1 Message Date
Andrea Di Biagio 8e26936bfd [AddDiscriminators] Assign discriminators to MemIntrinsic calls.
Before this patch, pass AddDiscriminators always avoided to assign
discriminators to intrinsic calls. This was done mainly for two reasons:
 1) We wanted to minimize the number of based discriminators used.
 2) We wanted to avoid non-deterministic discriminator assignment for
    different debug levels.

Unfortunately, that approach was problematic for MemIntrinsic calls.
MemIntrinsic calls can be split by SROA into loads and stores, and each new
load/store instruction would obtain the debug location from the original
intrinsic call.
If we don't assign a discriminator to MemIntrinsic calls, then we cannot
correctly set the discriminator for the newly created loads and stores.
This may have a negative impact on the basic block weight computation
performed by the SampleLoader.

This patch fixes the issue by letting MemIntrinsic calls have a discriminator.

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

llvm-svn: 299972
2017-04-11 19:07:30 +00:00
Craig Topper 9eac2717c6 [InstCombine] Add testcases for (B&A)^A -> ~B & A and (B|A)^A -> B & ~A
llvm-svn: 299971
2017-04-11 18:50:48 +00:00
Craig Topper 957a94cc03 Fix spelling compliment->complement. Mostly refering to 2s complement. NFC
llvm-svn: 299970
2017-04-11 18:47:58 +00:00
Anna Thomas 98cbb067ce [LV] Move first order recurrence test to common folder. NFC
llvm-svn: 299969
2017-04-11 18:31:42 +00:00
Vitaly Buka ea997e10cb [libFuzzer] fix type in signal name.
Fixes PR32576.

Patch by Jakub Zawadzki.

llvm-svn: 299968
2017-04-11 18:20:05 +00:00
Peter Collingbourne 7faa60c406 llvm-lto2: Move the LTO::run() action behind a subcommand.
Move LTO::run() to a "run" subcommand so that we can introduce new subcommands
for testing different parts of the LTO implementation.

This doesn't use llvm::cl subcommands because it doesn't appear to be currently
possible to pass an argument not associated with a subcommand to a subcommand
(e.g. -lto-use-new-pm, -mcpu=yonah).

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

llvm-svn: 299967
2017-04-11 18:12:00 +00:00
Craig Topper 271b2245f4 [InstCombine] Use ConstantExpr::getBinOpIdentity to implement getIdentityValue.
This removes a TODO in getIdentityValue and may allow some transforms to occur earlier. But I was unable to find any transforms we didn't already handle.

llvm-svn: 299966
2017-04-11 17:42:40 +00:00
Yaxun Liu b34ec829be [OpenCL] Map default address space to alloca address space
For OpenCL, the private address space qualifier is 0 in AST. Before this change, 0 address space qualifier
is always mapped to target address space 0. As now target private address space is specified by
alloca address space in data layout, address space qualifier 0 needs to be mapped to alloca addr space specified by the data layout.

This change has no impact on targets whose alloca addr space is 0.

With contributions from Matt Arsenault, Tony Tye and Wen-Heng (Jack) Chung

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

llvm-svn: 299965
2017-04-11 17:24:23 +00:00
Yaxun Liu e95df719e1 [AMDGPU] Add A5 to data layout for amdgiz environment
Differential Revision: https://reviews.llvm.org/D31589

llvm-svn: 299964
2017-04-11 17:18:13 +00:00
Marshall Clow 36bc71782d Implement LWG#2873: 'Add noexcept to several shared_ptr related functions' This issue missed a couple, so I added those as well (see LWG#2942)
llvm-svn: 299963
2017-04-11 17:08:53 +00:00
Alex Lorenz a981c7d79e [ASTPrinter] Print nested name specifiers for out-of-line functions
rdar://31501863

llvm-svn: 299962
2017-04-11 16:46:03 +00:00
Sylvestre Ledru c94f320bd8 Add the definition of P in the clang tidy example
llvm-svn: 299961
2017-04-11 16:28:15 +00:00
Xinliang David Li 577b9d41d6 Revert 299954 : test failure needs to be fixed
llvm-svn: 299960
2017-04-11 16:27:26 +00:00
Xinliang David Li 93bac56bf9 Revert 299953 : test failure needs to be fixed
llvm-svn: 299959
2017-04-11 16:27:20 +00:00
Reid Kleckner 6e545ffc4e [PDB] Emit index/offset pairs for TPI and IPI streams
Summary:
This lets PDB readers lookup type record data by type index in O(log n)
time. It also enables makes `cvdump -t` work on PDBs produced by LLD.
cvdump will not dump a PDB that doesn't have an index-to-offset table.

The table is sorted by type index, and has an entry every 8KB. Looking
up a type record by index is a binary search of this table, followed by
a scan of at most 8KB.

Reviewers: ruiu, zturner, inglorion

Subscribers: llvm-commits

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

llvm-svn: 299958
2017-04-11 16:26:15 +00:00
Maxim Ostapenko 83d37dc066 [lsan] Fix typo in test/lsan/lit.common.cfg
llvm-svn: 299957
2017-04-11 16:22:19 +00:00
Vassil Vassilev c42bce8097 Revert temporarily D29877 "Warn about unused static file scope function template declarations."
We need to address cases (breaking libc++) such as

template <class _Up> static int __test(...);

template<typename _Tp>
auto v = __test<_Tp>(0);

llvm-svn: 299956
2017-04-11 16:05:23 +00:00
Sanjay Patel 28611acef9 revert r299851 - [InstCombine] fix matching of or-of-icmps constants (PR32524)
This is a candidate culprit for multiple bot fails, so reverting pending investigation.

llvm-svn: 299955
2017-04-11 15:57:32 +00:00
Xinliang David Li a53e6702d2 [Profile] PE binary coverage bug fix
PR/32584

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

llvm-svn: 299954
2017-04-11 15:51:39 +00:00
Xinliang David Li 249b75c55d [Profile] PE binary coverage bug fix
PR/32584

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

llvm-svn: 299953
2017-04-11 15:51:32 +00:00
Nico Weber 48c94a6164 [clang-format] Recognize Java logical shift assignment operator
At present, clang-format mangles Java containing logical right shift operators
('>>>=' or '>>>'), splitting them in two, resulting in invalid code:

 public class Minimal {
   public void func(String args) {
     int i = 42;
-    i >>>= 1;
+    i >> >= 1;
     return i;
   }
 }

This adds both forms of logical right shift to the FormatTokenLexer, so
clang-format won't attempt to split them and insert bogus whitespace.

https://reviews.llvm.org/D31652
Patch from Richard Bradfield <bradfier@fstab.me>!

llvm-svn: 299952
2017-04-11 15:50:04 +00:00
Alex Lorenz 46103e0ede Fix PR13910: Don't warn that __builtin_unreachable() is unreachable
Differential Revision: https://reviews.llvm.org/D25321

llvm-svn: 299951
2017-04-11 15:36:06 +00:00
Alex Lorenz f127821140 [Parser][ObjC++] Improve diagnostics and recovery when C++ keywords are used
as identifiers in Objective-C++

This commit improves the 'expected identifier' errors that are presented when a
C++ keyword is used as an identifier in Objective-C++ by mentioning that this is
a C++ keyword in the diagnostic message. It also improves the error recovery:
the parser will now treat the C++ keywords as identifiers to prevent unrelated
parsing errors.

rdar://20626062

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

llvm-svn: 299950
2017-04-11 15:01:53 +00:00
Serge Guelton 59a2d7b909 Module::getOrInsertFunction is using C-style vararg instead of variadic templates.
From a user prospective, it forces the use of an annoying nullptr to mark the end of the vararg, and there's not type checking on the arguments.
The variadic template is an obvious solution to both issues.

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

llvm-svn: 299949
2017-04-11 15:01:18 +00:00
Maxim Ostapenko de3b9a2ecc Reapply "Enable LSan for arm Linux"
This patch reapplies r299923 with typo fixed in BLX macros.

llvm-svn: 299948
2017-04-11 14:58:26 +00:00
Vassil Vassilev e1f12fadc0 Remove unused functions. Remove static qualifier from functions in header files. NFC.
llvm-svn: 299947
2017-04-11 14:55:32 +00:00
Jonathan Roelofs 5e39c44654 [AVR] Migrate to new MCAsmBackend applyFixup
https://reviews.llvm.org/D31875

Patch by Leslie Zhai!

llvm-svn: 299946
2017-04-11 14:51:49 +00:00
Sam Parker 83b64654fd [ARM] Refactor Thumb2 sat instructions
Refactor the USAT, SSAT, USAT16 and SSAT16 instruction descriptions
for Thumb2.

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

llvm-svn: 299945
2017-04-11 14:42:08 +00:00
Geoff Berry 9d597adde4 [GVNHoist] Re-enable GVNHoist by default
Turn GVNHoist back on by default now that PR32153 has been fixed.

llvm-svn: 299944
2017-04-11 14:36:30 +00:00
Nico Weber 7124b5f6f9 Revert r299923, it doesn't build in bootstrap builds.
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.dir/sanitizer_linux.cc.o 
lib/sanitizer_common/sanitizer_linux.cc:1340:24: error: invalid instruction
                       BLX(ip)
                       ^
lib/sanitizer_common/sanitizer_linux.cc:1313:19: note: expanded from macro 'BLX'
#  define BLX(R) "mov lr, pc; bx" #R "\n"
                  ^
<inline asm>:6:13: note: instantiated into assembly here
mov lr, pc; bxip
            ^~~~

llvm-svn: 299943
2017-04-11 14:28:49 +00:00
Ben Craig 3f5b5fff8a [libc++] Fix unknown pragma warning on MSVC
llvm-svn: 299942
2017-04-11 14:06:39 +00:00
Marshall Clow 220706cd6d Mark P0599 as complete. It was implemented in r298573
llvm-svn: 299941
2017-04-11 14:04:03 +00:00
Catherine Moore 82525903a4 This patch causes the installation of headers for the sanitizer and/or xray to be disabled when COMPILER_RT_BUILD_SANITIZERS=OFF and/or COMPILER_RT_BUILD_XRAY=OFF.
Reviewer: dberris

Subscribers: dberris, mgorny, llvm-commits, clm

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

llvm-svn: 299940
2017-04-11 13:45:05 +00:00
Nirav Dave a55dad3c33 [SDAG] Factor CandidateMatch check into lambda. NFC.
llvm-svn: 299939
2017-04-11 13:41:19 +00:00
Nirav Dave 83defd1902 [SDAG] Factor ChainMerge into helper function NFCI.
llvm-svn: 299938
2017-04-11 13:41:17 +00:00
Nirav Dave 233eb7a636 [SDAG] Reorder expensive StoreMerge Check after cheaper one. NFC
llvm-svn: 299937
2017-04-11 13:41:16 +00:00
Keno Fischer 30779772cf [StripDeadDebug/DIFinder] Track inlined SPs
Summary:
In rL299692 I improved strip-dead-debug-info's ability to drop CUs that are not
referenced from the current module. However, in doing so I neglected to realize
that some SPs could be referenced entirely from inlined functions. It appears
I was not the only one to make this mistake, because DebugInfoFinder, doesn't
find those SPs either. Fix this in DebugInfoFinder and then use that to make
sure not to drop those CUs in strip-dead-debug-info.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: llvm-commits

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

llvm-svn: 299936
2017-04-11 13:32:11 +00:00
Krasimir Georgiev 4714f7cba9 [clangd] Implement item kind for completion results
Summary: The patch implements the conversion method from CXCursorKind to clangd::CompletionItemKind.
Contributed by stanionascu!

Reviewers: cfe-commits, bkramer, krasimir

Reviewed By: krasimir

Tags: #clang-tools-extra

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

llvm-svn: 299935
2017-04-11 13:27:15 +00:00
Pavel Labath 0df645dda4 Add missing annotation to TestDataFormatterUnordered
llvm-svn: 299934
2017-04-11 12:26:33 +00:00
Pavel Labath f0a6d8ada3 Remove Plugins/Process/POSIX from include_directories
Summary:
The files there can always be referred to using their full path, which
is what most of the code has been doing already, so this makes the
situation more consistent. Also fix the the code in the FreeBSD plugin
to use the new paths.

Reviewers: eugene, emaste

Subscribers: lldb-commits, kettenis, mgorny, krytarowski

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

llvm-svn: 299933
2017-04-11 12:26:25 +00:00
Jan Sjodin 695e437470 Add MachineRegionInfoPassID to Passes.h.
Differential Revision: https://reviews.llvm.org/D31899

llvm-svn: 299932
2017-04-11 11:40:55 +00:00
Diana Picus 1314a2889c GlobalISel: Allow legalizing G_FADD to a libcall
Use the same handling in the generic legalizer code as for the other
libcalls (G_FREM, G_FPOW).

Enable it on ARM for float and double so we can test it.

llvm-svn: 299931
2017-04-11 10:52:34 +00:00
Vassil Vassilev e63a39d6cb Warn about unused static file scope function template declarations.
Reviewed by Richard Smith (D29877)!

llvm-svn: 299930
2017-04-11 10:13:54 +00:00
Volkan Keles 64ad85f8ba [GlobalISel] LegalizerInfo: Enable legalization of non-power-of-2 types
Summary: Legalize only if the type is marked as Legal or Custom. If not, return Unsupported as LegalizerHelper is not able to handle non-power-of-2 types right now.

Reviewers: qcolombet, aditya_nandakumar, dsanders, t.p.northover, kristof.beyls, javed.absar, ab

Reviewed By: kristof.beyls, ab

Subscribers: dberris, rovka, igorb, llvm-commits

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

llvm-svn: 299929
2017-04-11 10:10:14 +00:00
Diana Picus b050c7fbe0 Revert "Turn some C-style vararg into variadic templates"
This reverts commit r299925 because it broke the buildbots. See e.g.
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/6008

llvm-svn: 299928
2017-04-11 10:07:12 +00:00
Alexander Kornienko d4fa2e6348 [clang-format] Handle NSString literals by merging tokens.
Summary:
This fixes a few outstanding bugs:
  * incorrect breaking of NSString literals containing double-width characters;
  * inconsistent formatting of ObjC dictionary literals containing NSString
    literals;
  * AlwaysBreakBeforeMultilineStrings ignoring implicitly-concatenated NSString
    literals.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 299927
2017-04-11 09:55:00 +00:00
Sam Parker 4fc5f3c02e [SelectionDAG] Check CALLSEQ_BEGIN nodes in DelayForLiveRegs
A fix for the bug reported in PR30911.

The issue arises when multiple CALLSEQ_BEGIN nodes are unscheduled as
the last node to be unscheduled will gain access to the CallResource
register. But when a node is being picked, only CALLSEQ_END nodes are
checked against the CallResource and have their chains evaluated.
This then means that other CALLSEQ_BEGIN nodes can be scheduled
before the existing call sequence has been finalised. This patch adds
a check against the FrameSetup nodes in DelayForLiveRegs to prevent
this from happening.

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

llvm-svn: 299926
2017-04-11 08:43:32 +00:00
Serge Guelton 5fd75fb72e Turn some C-style vararg into variadic templates
Module::getOrInsertFunction is using C-style vararg instead of
variadic templates.

From a user prospective, it forces the use of an annoying nullptr
to mark the end of the vararg, and there's not type checking on the
arguments. The variadic template is an obvious solution to both
issues.

llvm-svn: 299925
2017-04-11 08:36:52 +00:00
Sylvestre Ledru 06faa9bf32 Simplify the code and remove dead code
Summary: Fix coverity cid 1374240

Reviewers: dberlin

Reviewed By: dberlin

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

llvm-svn: 299924
2017-04-11 08:21:27 +00:00
Maxim Ostapenko 950d2809d5 [lsan] Enable LSan for arm Linux
This patch enables LSan for arm Linux.

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

llvm-svn: 299923
2017-04-11 08:13:38 +00:00