Commit Graph

310872 Commits

Author SHA1 Message Date
Craig Topper 611a36b48b [X86] Add 'znver2' and 'cascadelake' to the __builtin_cpu_is test.
These are supported by at least libgcc trunk so we can include them now.

llvm-svn: 354915
2019-02-26 19:20:04 +00:00
Jim Ingham cbf575a5a0 Mention predicting exception catch at throw site
llvm-svn: 354914
2019-02-26 19:18:09 +00:00
Craig Topper d44db7e486 [X86] Use X86_CPU_SUBTYPE_COMPAT for 'cascadelake' cpu.
This CPU is supported by at least libgcc trunk now so we should make it available to __builtin_cpu_is.

llvm-svn: 354913
2019-02-26 19:17:12 +00:00
Julian Lettner eb38a70d11 [lit] Allow setting parallelism groups to None
Check that we do not crash if a parallelism group is explicitly set to
None. Permits usage of the following pattern.

[lit.common.cfg]
  lit_config.parallelism_groups['my_group'] = None
  if <condition>:
    lit_config.parallelism_groups['my_group'] = 3

[project/lit.cfg]
  config.parallelism_group = 'my_group'

Reviewers: rnk

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

llvm-svn: 354912
2019-02-26 19:03:26 +00:00
Kristina Brooks 76eb4b02d9 Update docs of memcpy/move/set wrt. align and len
Fix https://bugs.llvm.org/show_bug.cgi?id=38583: Describe
how memcpy/memmove/memset behave when len=0. Also fix
some fallout from when the alignment parameter was
replaced by an attribute.

This closes PR38583.

Patch by RalfJung (Ralf)

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

llvm-svn: 354911
2019-02-26 18:53:13 +00:00
Andrew Ng f38b005321 [TableGen] Make OpcodeMappings sort comparator deterministic NFCI
The previous sort comparator was not deterministic, i.e. in some
situations it would be possible for lhs < rhs && rhs < lhs. This was
discovered by an STL assertion in a Windows debug build of llvm-tblgen.

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

llvm-svn: 354910
2019-02-26 18:50:49 +00:00
Michael Liao 7557afa000 [AMDGPU] Allow using integral non-type template parameters
Summary:
- Allow using integral non-type template parameters in the following
  attributes

  __attribute__((amdgpu_flat_work_group_size(<min>, <max>)))
  __attribute__((amdgpu_waves_per_eu(<min>[, <max>])))

Reviewers: kzhuravl, yaxunl

Subscribers: jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354909
2019-02-26 18:49:36 +00:00
Mitch Phillips c0ffe705c5 Fixed a minor merge error with this patch.
llvm-svn: 354908
2019-02-26 18:41:55 +00:00
Mitch Phillips 83899d1f39 [compiler-rt] Provide better llvm-lit failure when llvm-config fails.
Summary:
The current error message can cause confusion if llvm-config can't be
executed for reasons other than "not found". In my example, cross
compiling generated an llvm-config binary for aarch64 which couldn't be
executed natively. Instead of telling me that the error was with the
file architecture, it reports the file as not being present.

Reviewers: pcc

Subscribers: dberris, javed.absar, kristof.beyls, jdoerfert, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 354907
2019-02-26 18:41:54 +00:00
Vlad Tsyrklevich 443e00a51b Revert "[compiler-rt] Intercept the bcmp() function."
This reverts commits r354851, 354852, 354853 and r354888. They were
causing build failures on the android sanitizer bot.

llvm-svn: 354906
2019-02-26 18:28:15 +00:00
Sanjay Patel 9dada83d6c [InstSimplify] remove zero-shift-guard fold for general funnel shift
As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2019-February/130491.html

We can't remove the compare+select in the general case because
we are treating funnel shift like a standard instruction (as
opposed to a special instruction like select/phi).

That means that if one of the operands of the funnel shift is
poison, the result is poison regardless of whether we know that
the operand is actually unused based on the instruction's
particular semantics.

The motivating case for this transform is the more specific
rotate op (rather than funnel shift), and we are preserving the
fold for that case because there is no chance of introducing
extra poison when there is no anonymous extra operand to the
funnel shift.

llvm-svn: 354905
2019-02-26 18:26:56 +00:00
Marshall Clow c0170de222 Remove P1272R1, it was not moved in Kona
llvm-svn: 354904
2019-02-26 18:17:30 +00:00
Jonas Toth c1e8cbd5c3 [clang-tidy] undo bitfields in ExceptionAnalyzer
Scoped enums do induce some problems with some MSVC and GCC versions
if used as bitfields. Therefor this is deactivated for now.

llvm-svn: 354903
2019-02-26 18:15:17 +00:00
Jonathan Metzman 7821f892bf [libFuzzer] Remove extra semicolons
Summary:
Remove extra semicolons so that libFuzzer can compile with
-Werror -Wextra-semi

Reviewers: Dor1s, morehouse, thakis

Reviewed By: Dor1s, morehouse

Subscribers: jdoerfert, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 354902
2019-02-26 17:46:13 +00:00
Marshall Clow a04143ee27 Put a 'first implemented' version into the entry for P1357
llvm-svn: 354901
2019-02-26 17:22:47 +00:00
Petar Avramovic bd39569913 [MIPS GlobalISel] Select G_UADDO
Lower G_UADDO.
Legalize G_UADDO for MIPS32

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

llvm-svn: 354900
2019-02-26 17:22:42 +00:00
Ganesh Gopalasubramanian 4f171d2761 [X86] AMD znver2 enablement
This patch enables the following

1) AMD family 17h "znver2" tune flag (-march, -mcpu).
2) ISAs that are enabled for "znver2" architecture.
3) For the time being, it uses the znver1 scheduler model.
4) Tests are updated.
5) This patch is the clang counterpart to D58343

Reviewers: craig.topper
Tags: #clang

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

llvm-svn: 354899
2019-02-26 17:15:36 +00:00
Marshall Clow 7b4ab3b9e4 Mark several issues (and one paper) as complete. Reviewed as D58099; but I added LWG3101 and LWG3144 and P1357R1 as well.
llvm-svn: 354898
2019-02-26 17:01:00 +00:00
Ganesh Gopalasubramanian e172d7008d [X86] AMD znver2 enablement
This patch enables the following

1) AMD family 17h "znver2" tune flag (-march, -mcpu).
2) ISAs that are enabled for "znver2" architecture.
3) For the time being, it uses the znver1 scheduler model.
4) Tests are updated.
5) Scheduler descriptions are yet to be put in place.

Reviewers: craig.topper

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

llvm-svn: 354897
2019-02-26 16:55:10 +00:00
Jonas Paulsson c110b5b69f [SystemZ] Wait with selection of legal vector/FP constants until Select().
This patch aims to make sure that any such constant that can be generated
with a vector instruction (for example VGBM) is recognized as such during
legalization and kept as a target independent node through post-legalize
DAGCombining.

Two new functions named isVectorConstantLegal() and loadVectorConstant()
replace old ways of handling vector/FP constants.

A new struct named SystemZVectorConstantInfo is used to cache the results of
isVectorConstantLegal() and pass them onto loadVectorConstant().

Support for fp128 constants in the presence of FeatureVectorEnhancements1
(z14) has been added.

Review: Ulrich Weigand
https://reviews.llvm.org/D58270

llvm-svn: 354896
2019-02-26 16:47:59 +00:00
Kostya Kortchinsky 41aba567d9 [scudo][standalone] Introduce platform specific code & mutexes
Summary:
This CL adds the platform specific code for Fuchsia, Linux & Android,
as well as some tests related to those (more tests to come later).
While some of it is pretty much a straight port of the existing scudo &
sanitizer_common code, the memory mapping functions have been reworked
a bit to fit the limited usage scenario that Scudo has for them.

For Fuchsia, I can now track the Vmar/Vmo pair for memory mappings if
there is an intent to grow or decommit some mapping (that will be
useful for the Primary).

Reviewers: eugenis, vitalybuka, mcgrathr, phosek, flowerhack, morehouse, dmmoore415

Reviewed By: vitalybuka, morehouse

Subscribers: kcc, dvyukov, srhines, mgorny, delcypher, jfb, jdoerfert, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 354895
2019-02-26 16:47:25 +00:00
Sanjay Patel 421c6e6864 [InstSimplify] add tests for rotate; NFC
Rotate is a special-case of funnel shift that has different
poison constraints than the general case. That's not visible
yet in the existing tests, but it needs to be corrected.

llvm-svn: 354894
2019-02-26 16:44:08 +00:00
Yaxun Liu d83c74028d [OpenCL] Fix assertion due to blocks
A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called.

There is code

  Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee());
getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle
BlockExpr and returns nullptr, which causes isa to assert.

This patch fixes that.

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

llvm-svn: 354893
2019-02-26 16:20:41 +00:00
Marshall Clow 46c719ddcd Implement P1357: Traits for [Un]bounded Arrays; adopted in Kona
llvm-svn: 354891
2019-02-26 16:07:03 +00:00
Tatyana Krasnukha 9e1929305c Fix short options syntax in Minidump test
llvm-svn: 354890
2019-02-26 15:38:30 +00:00
Sanjay Patel 840f5d6dce [InstCombine] remove duplicate (but not updated) tests; NFC
Not sure how it happened, but rL354886 was a duplicate of rL354881,
but not updated with rL354887.

llvm-svn: 354889
2019-02-26 15:25:42 +00:00
Clement Courbet ea7bd2f016 [compiler-rt] Disable failing test on darwin during investigation.
/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/projects/compiler-rt/test/asan/TestCases/Posix/bcmp_test.cc:14:12: error: CHECK: expected string not found in input
 // CHECK: {{#1.*bcmp}}
           ^
<stdin>:2:57: note: scanning from here
==34677==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffee93777c4 at pc 0x0001068a7285 bp 0x7ffee9377770 sp 0x7ffee9376ef8
                                                        ^
<stdin>:6:20: note: possible intended match here
 #2 0x106888e77 in main bcmp_test.cc:12
                   ^

llvm-svn: 354888
2019-02-26 15:25:04 +00:00
Sanjay Patel e8bf0f79bd [InstCombine] canonicalize more unsigned saturated add with 'not'
Yet another pattern variation suggested by:
https://bugs.llvm.org/show_bug.cgi?id=14613

There are 8 more potential commuted patterns here on top of the
8 that were already handled (rL354221, rL354276, rL354393).
We have the obvious commute of the 'add' + commute of the cmp
predicate/operands (ugt/ult) + commute of the select operands:

Name: base
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ult i32 %x, %y
%r = select i1 %c, i32 -1, i32 %a
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: ugt
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ugt i32 %y, %x
%r = select i1 %c, i32 -1, i32 %a
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: commute select
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ult i32 %y, %x
%r = select i1 %c, i32 %a, i32 -1
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: ugt + commute select
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ugt i32 %x, %y
%r = select i1 %c, i32 %a, i32 -1
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/den

llvm-svn: 354887
2019-02-26 15:18:49 +00:00
Sanjay Patel c9af54bb55 [InstCombine] add more tests for saturated add; NFC
llvm-svn: 354886
2019-02-26 15:18:44 +00:00
Emilio Cobos Alvarez 0d76dc285c [libclang] Avoid crashing when getting layout info of an undeduced type.
When the type is not deducible, return an error instead of crashing.

This fixes https://bugs.llvm.org/show_bug.cgi?id=40813.

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

llvm-svn: 354885
2019-02-26 15:04:18 +00:00
Nirav Dave 582d46328c [DAG] Fix constant store folding to handle non-byte sizes.
Avoid crashes from zero-byte values due to sub-byte store sizes.

Reviewers: uabelho, courbet, rnk

Reviewed By: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 354884
2019-02-26 15:02:32 +00:00
Tatyana Krasnukha f388d17d7c Fix error handling in Options::Parse
Moved `if (error.Fail())` to correct place to catch all faulty cases such as
"unknown or ambiguous option" which was ignored before.

llvm-svn: 354883
2019-02-26 14:50:40 +00:00
Simon Atanasyan 8cb497027d [mips] Emit `.module softfloat` directive
This change fixes crash on an assertion in case of using
`soft float` ABI for mips32r6 target.

llvm-svn: 354882
2019-02-26 14:45:17 +00:00
Sanjay Patel 0d4f9216aa [InstCombine] add more tests for saturated add; NFC
llvm-svn: 354881
2019-02-26 14:40:23 +00:00
Andrew Ng 301f304949 [clang-format] SpaceBeforeParens for lambda expressions
Add support for lambda expressions to the SpaceBeforeParens formatting
option.

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

llvm-svn: 354880
2019-02-26 14:34:49 +00:00
Kadir Cetinkaya 60ec08f067 [clangd] Index UsingDecls
Summary:
D58340 enables indexing of USRs, this makes sure test in clangd are
aligned with the change

Reviewers: hokein

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354879
2019-02-26 14:23:47 +00:00
Kadir Cetinkaya a87ada0dad [clang][Index] Visit UsingDecls and generate USRs for them
Summary:
Add indexing of UsingDecl itself.
Also enable generation of USRs for UsingDecls, using the qualified name of the
decl.

Reviewers: ilya-biryukov, akyrtzi

Subscribers: arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 354878
2019-02-26 14:23:12 +00:00
Andrea Di Biagio c032e2ab7c [MCA] Always check if scheduler resources are unavailable when reporting dispatch stalls.
Dispatch stall cycles may be associated to multiple dispatch stall events.
Before this patch, each stall cycle was associated with a single stall event.
This patch also improves a couple of code comments, and adds a helper method to
query the Scheduler for dispatch stalls.

llvm-svn: 354877
2019-02-26 14:19:00 +00:00
George Rimar b75bf8784e [yaml2obj][obj2yaml] - Add support for the architecture specific dynamic tags.
This allows tools to parse/dump the architecture specific tags
like DT_MIPS_*, DT_PPC64_* and DT_HEXAGON_*

Also fixes a bug in DynamicTags.def which was revealed in this patch.

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

llvm-svn: 354876
2019-02-26 14:14:49 +00:00
Pierre Gousseau 40ad3d2aa4 revert r354873 as this breaks lldb builds.
llvm-svn: 354875
2019-02-26 13:50:29 +00:00
Pavel Labath 89ae290b58 [Sanitizer] Add interceptor for pthread_sigmask
Summary:
pthread_sigmask is just like sigprocmask, except that its behavior in
multithreaded programs is explicitly specified. Sanitizers were lacking
a common interceptor for pthread_sigmask (although some specific
sanitizers defined custom version), which lead to false positives
(at least in msan) when using this function.

The interceptor implementation, and its test are based on the equivalent
code for sigprocmask.

Reviewers: eugenis, vitalybuka

Subscribers: kubamracek, delcypher, jfb, jdoerfert, llvm-commits, #sanitizers

Tags: #llvm, #sanitizers

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

llvm-svn: 354874
2019-02-26 13:38:23 +00:00
Pierre Gousseau 44fad947a5 [Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer checks, NFC.
enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks.
This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare".

Fixes: https://llvm.org/PR39425

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

llvm-svn: 354873
2019-02-26 13:30:14 +00:00
Simon Pilgrim d4a406e499 [AArch64] Add arithmetic zext bswap tests.
As requested on D58017.

llvm-svn: 354872
2019-02-26 13:22:35 +00:00
Xing GUO 85b50a7679 [llvm-objdump] Add `Version Definitions` dumper
Summary: `llvm-objdump` needs a `Version Definitions` dumper.

Reviewers: grimar, jhenderson

Reviewed By: grimar, jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 354871
2019-02-26 13:06:16 +00:00
Igor Kudrin 2d3faad706 [llvm-objdump] Implement -Mreg-names-raw/-std options.
The --disassembler-options, or -M, are used to customize
the disassembler and affect its output.

The two implemented options allow selecting register names on ARM:
* With -Mreg-names-raw, the disassembler uses rNN for all registers.
* With -Mreg-names-std it prints sp, lr and pc for r13, r14 and r15,
  which is the default behavior of llvm-objdump.

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

llvm-svn: 354870
2019-02-26 12:15:14 +00:00
Simon Pilgrim e42be1eae2 [AArch64] Add 'free' zext bswap tests.
As requested on D58017.

llvm-svn: 354869
2019-02-26 12:04:37 +00:00
Luke Cheeseman 9e285bef2b [ARM] Add Cortex-M35P
- Add LLVM backend support for Cortex-M35P
- Documentation can be found at
  https://developer.arm.com/products/processors/cortex-m/cortex-m35p

Differentail Revision: https://reviews.llvm.org/D57763

llvm-svn: 354868
2019-02-26 12:02:12 +00:00
Simon Pilgrim 566177c3d5 [LegalizeDAG] Use APInt::getSplat helper to create bitreverse masks. NFCI.
llvm-svn: 354867
2019-02-26 11:44:23 +00:00
Simon Pilgrim 810fa04ac7 [LegalizeDAG] Expand SADDO/SSUBO using SADDSAT/SSUBSAT (PR37763)
If SADDSAT/SSUBSAT are legal, then we can expand SADDO/SSUBO by performing a ADD/SUB and a SADDO/SSUBO and then compare the results.

I looked at doing this for UADDO/USUBO as well but as we don't have to do as many range comparisons I didn't see any/much benefit.

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

llvm-svn: 354866
2019-02-26 11:27:53 +00:00
Kadir Cetinkaya 8335fd1923 [clangd] Update docs to mention YCM integration and new LSP features
Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 354865
2019-02-26 11:08:04 +00:00