Commit Graph

327573 Commits

Author SHA1 Message Date
Michael Liao 566b3164c5 [Sema] Fix the atomic expr rebuilding order.
Summary:
- Rearrange the atomic expr order to the API order when rebuilding
  atomic expr during template instantiation.

Reviewers: erichkeane

Subscribers: jfb, cfe-commits

Tags: #clang

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

llvm-svn: 372640
2019-09-23 18:48:06 +00:00
Roman Lebedev 47e1ce4abe [IR] Add getExtendedType() to IntegerType and Type (dispatching to IntegerType or VectorType)
llvm-svn: 372638
2019-09-23 18:21:33 +00:00
Roman Lebedev 1972327d63 [InstCombine] dropRedundantMaskingOfLeftShiftInput(): improve comment
llvm-svn: 372637
2019-09-23 18:21:14 +00:00
David Bolvansky 8d52016155 [SLC] Convert some strndup calls to strdup calls
Summary:
Motivation:
- If we can fold it to strdup, we should (strndup does more things than strdup).
- Annotation mechanism. (Works for strdup well).

strdup and strndup are part of C 20 (currently posix fns), so we should optimize them.

Reviewers: efriedma, jdoerfert

Reviewed By: jdoerfert

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

llvm-svn: 372636
2019-09-23 18:20:01 +00:00
Alexey Bataev dba792c522 [OPENMP]Use standard parsing for 'match' clause, NFC.
Reused standard clauses parsing scheme for parsing/matching 'match'
clause in 'declare variant' directive.

llvm-svn: 372635
2019-09-23 18:13:31 +00:00
Stella Stamenova 1962122c4d [lldb-suite] TestCallOverriddenMethod.py is now passing on Windows
The test is now passing, so remove the expected failure. No other tests associated with the bug are passing, though, so only remove expected failure from this one test

llvm-svn: 372634
2019-09-23 17:51:27 +00:00
Gabor Marton 4d51c6ff23 [ASTImporter] Attempt to fix Windows buildbot test errors
llvm-svn: 372633
2019-09-23 17:29:08 +00:00
Louis Dionne 3e1480a03b [libc++] Mark CTAD tests as not failing on AppleClang 10.0.1
They do fail on AppleClang 10.0.0, but not AppleClang 10.0.1

llvm-svn: 372632
2019-09-23 17:22:13 +00:00
Erik Pilkington 2d225bbec1 NFC: Fix a poorly-written test
The author of r364954 foolishly forgot that == binds tighter than ?:

llvm-svn: 372631
2019-09-23 17:16:55 +00:00
Roman Lebedev 0a51e1f66d [InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563)
Summary:
If we have a pattern `(x & (-1 >> maskNbits)) << shiftNbits`,
we already know (have a fold) that will drop the `& (-1 >> maskNbits)`
mask iff `(shiftNbits-maskNbits) s>= 0` (i.e. `shiftNbits u>= maskNbits`).

So even if `(shiftNbits-maskNbits) s< 0`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: c, normal+mask
  %t0 = lshr i32 -1, C1
  %t1 = and i32 %t0, %x
  %r = shl i32 %t1, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = i32 ((-(C2-C1))+32)
  %n2 = zext i32 %n1 to i64
  %n3 = lshr i64 -1, %n2
  %n4 = trunc i64 %n3 to i32
  %r = and i32 %n0, %n4
```
https://rise4fun.com/Alive/gslRa

Naturally, old `%masked` will have to be one-use.
This is not valid for pattern f - where "masking" is done via `ashr`.

https://bugs.llvm.org/show_bug.cgi?id=42563

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372630
2019-09-23 17:04:28 +00:00
Roman Lebedev b4a1d8a84c [InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563)
Summary:
And this is **finally** the interesting part of that fold!

If we have a pattern `(x & (~(-1 << maskNbits))) << shiftNbits`,
we already know (have a fold) that will drop the `& (~(-1 << maskNbits))`
mask iff `(maskNbits+shiftNbits) u>= bitwidth(x)`.
But that is actually ignorant, there's more general fold here:

In this pattern, `(maskNbits+shiftNbits)` actually correlates
with the number of low bits that will remain in the final value.
So even if `(maskNbits+shiftNbits) u< bitwidth(x)`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: a, normal+mask
  %onebit = shl i32 -1, C1
  %mask = xor i32 %onebit, -1
  %masked = and i32 %mask, %x
  %r = shl i32 %masked, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = add i32 C1, C2
  %n2 = zext i32 %n1 to i64
  %n3 = shl i64 -1, %n2
  %n4 = xor i64 %n3, -1
  %n5 = trunc i64 %n4 to i32
  %r = and i32 %n0, %n5
```
https://rise4fun.com/Alive/F5R

Naturally, old `%masked` will have to be one-use.
Similar fold exists for patterns c,d,e, will post patch later.

https://bugs.llvm.org/show_bug.cgi?id=42563

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372629
2019-09-23 17:04:14 +00:00
Sanjay Patel 7414151929 [BreakFalseDeps] ignore function with minsize attribute
This came up in the x86-specific:
https://bugs.llvm.org/show_bug.cgi?id=43239
...but it is a general problem for the BreakFalseDeps pass.
Dependencies may be broken by adding some other instruction,
so that should be avoided if the overall goal is to minimize size.

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

llvm-svn: 372628
2019-09-23 17:01:01 +00:00
Shaurya Gupta 7e56dd0229 [Clang-doc] NFC: Fixed link to llvm bugs in documentation
llvm-svn: 372627
2019-09-23 16:55:13 +00:00
Alexey Bataev 6a278d9073 [SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")
Summary:
Initially SLP vectorizer replaced all going-to-be-vectorized
instructions with Undef values. It may break ScalarEvaluation and may
cause a crash.
Reworked SLP vectorizer so that it does not replace vectorized
instructions by UndefValue anymore. Instead vectorized instructions are
marked for deletion inside if BoUpSLP class and deleted upon class
destruction.

Reviewers: mzolotukhin, mkuper, hfinkel, RKSimon, davide, spatel

Subscribers: RKSimon, Gerolf, anemet, hans, majnemer, llvm-commits, sanjoy

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

llvm-svn: 372626
2019-09-23 16:25:03 +00:00
Roman Lebedev 01ac23ca62 [InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/
llvm-svn: 372625
2019-09-23 16:04:32 +00:00
Zoe Carver a9f926c8b2 Fix __is_fundamental to accept nullptr_t
Summary: This patch updates the __is_fundamental builtin type trait to return true for nullptr_t.

    Reviewers: rsmith, EricWF, efriedma, craig.topper, erichkeane

    Subscribers: cfe-commits

    Tags: #clang

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

llvm-svn: 372624
2019-09-23 16:02:46 +00:00
Alexey Bataev 4db9dc6f81 [OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targets
is not provided.

We should not emit any target-dependent code if only -fopenmp flag is
used and device targets are not provided to prevent compiler crash.

llvm-svn: 372623
2019-09-23 15:53:51 +00:00
Dmitry Preobrazhensky 6784a3cd79 [AMDGPU][MC] Corrected handling of relocatable expressions
See bug 43359: https://bugs.llvm.org//show_bug.cgi?id=43359

Reviewers: rampitec

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

llvm-svn: 372622
2019-09-23 15:41:51 +00:00
Zoe Carver 511dbd83d6 Fix __is_signed builtin
Summary: This patch fixes the __is_signed builtin type trait to work with floating point types and enums. Now, the builtin will return true if it is passed a floating point type and false for an enum type.

    Reviewers: EricWF, rsmith, erichkeane, craig.topper, efriedma

    Subscribers: cfe-commits

    Tags: #clang

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

llvm-svn: 372621
2019-09-23 15:41:20 +00:00
Louis Dionne f73ea05db0 [libc++] Mark iostreams test as XFAIL on older macOSes
llvm-svn: 372620
2019-09-23 15:40:47 +00:00
Simon Pilgrim 92fb382074 HexagonLoopIdiomRecognition - silence static analyzer dyn_cast<> null dereference warnings. NFCI.
llvm-svn: 372619
2019-09-23 15:36:24 +00:00
Cyndy Ishida d8d99d957c [TextAPI] Add New Supported Platforms
Summary: This patch introduces simulators, as well was the restriced zippered and macCatalyst to supported platforms

Reviewers: ributzka, steven_wu

Reviewed By: ributzka

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 372618
2019-09-23 15:28:02 +00:00
Haojian Wu b70323e5d3 [clangd] Simplify the callside of URI::resolve, NFC.
Summary:
- Add a overrloded URI::resolve, which accepts a string URI;
- also fixed some callside that don't check the error;

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 372617
2019-09-23 14:39:37 +00:00
Krzysztof Parzyszek f97fdf5792 [Hexagon] Bitcast v4i16 to v8i8, unify no-op casts between scalar and HVX
llvm-svn: 372616
2019-09-23 14:33:27 +00:00
Sven van Haastregt a0d84ffee8 [docs] Fix some typos in InternalsManual
llvm-svn: 372614
2019-09-23 14:24:29 +00:00
Guillaume Chatelet a06c13b1f9 [Alignment][NFC] Migrate Instructions to Align
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372613
2019-09-23 14:23:37 +00:00
David Bolvansky 84ea41fd17 [Diagnostics] Warn if '<<' in bool context with -Wint-in-bool-context (GCC compatibility)
Extracted from D63082, addressed review comments related to a warning message.

llvm-svn: 372612
2019-09-23 14:21:08 +00:00
Erich Keane a957eaad00 Fix test atomic-expr.cpp after R372422
The test tried to match a path in a printout by doing '^:' which failed
on windows, since C:\... is a path.

llvm-svn: 372611
2019-09-23 14:12:13 +00:00
Simon Pilgrim e53a724dd0 [llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library
Modify LLVMConfig to produce LLVM_USE_CRT variables in build-directory. It helps to set the same compiler debug options like in builded library.

Committed on behalf of @igorban (Igor)

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

llvm-svn: 372610
2019-09-23 14:11:48 +00:00
Alexey Bataev ec7946ea2d [OPENMP]Call __kmpc_push_tripcount in task context.
Runtime function __kmpc_push_tripcount better to call inside of the task
context for target regions. Otherwise, the libomptarget is unable to
link the provided tripcount value for nowait target regions and
completely looses this information.

llvm-svn: 372609
2019-09-23 14:06:51 +00:00
Konrad Kleine c45fe95e97 [LLDB] Fix logically dead code
Summary:
The indicated dead code may have performed some action; that action will never occur.

In lldb_private::LoadedModuleInfoList::LoadedModuleInfo::operator ==(lldb_private::LoadedModuleInfoList::LoadedModuleInfo const &): Code can never be reached because of a logical contradiction (CWE-561)

Coverity Scan: https://scan.coverity.com/projects/kwk-llvm-project?tab=overview

CID 221581

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 372608
2019-09-23 14:05:51 +00:00
Dmitri Gribenko 7964e89409 Added a test for agreement between paths used in ClangTidy's diagnostics and header filter
This test would have been broken by r372388.

llvm-svn: 372607
2019-09-23 13:44:42 +00:00
Sanjay Patel 31b9dfe23f [x86] fix assert with horizontal math + broadcast of vector (PR43402)
https://bugs.llvm.org/show_bug.cgi?id=43402

llvm-svn: 372606
2019-09-23 13:30:23 +00:00
Yitzhak Mandelbaum 0a81b4ed97 [libTooling] Add `access` and `ifBound` combinators to Stencil library.
Summary:
This revision add the `access` and `ifBound` combinators to the Stencil library:
* `access` -- constructs an idiomatic expression for accessing a member (a
  `MemberExpr`).
* `ifBound` -- chooses between two `StencilParts` based on the whether an id is
  bound in the match (corresponds to the combinator of the same name in
  RangeSelector).

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 372605
2019-09-23 13:21:42 +00:00
Simon Pilgrim 31acfe5c2c [ValueTracking] Remove unused matchSelectPattern optional argument. NFCI.
The matchSelectPattern const wrapper is never explicitly called with the optional Instruction::CastOps argument, and it turns out that it wasn't being forwarded to matchSelectPattern anyway!

Noticed while investigating clang static analyzer warnings.

llvm-svn: 372604
2019-09-23 13:20:47 +00:00
Simon Pilgrim f62293e8fe [ValueTracking] Fix uninitialized variable warnings in matchSelectPattern const wrapper. NFCI.
Static analyzer complains about const_cast uninitialized variables, we should explicitly set these to null.

Ideally that const wrapper would go away though.......

llvm-svn: 372603
2019-09-23 13:15:52 +00:00
Nico Weber da298aa913 llvm-undname: Add support for demangling typeinfo names
typeinfo names aren't symbols but string constant contents
stored in compiler-generated typeinfo objects, but llvm-cxxfilt
can demangle these for Itanium names.

In the MSVC ABI, these are just a '.' followed by a mangled
type -- this means they don't start with '?' like all MS-mangled
symbols do.

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

llvm-svn: 372602
2019-09-23 13:13:37 +00:00
Dmitri Gribenko ddc9a06e95 Revert "[clang-tidy] Fix relative path in header-filter."
This reverts commit r372388. It made '-header-filter' inconsistent with
paths printed in diagnostics.

llvm-svn: 372601
2019-09-23 13:06:25 +00:00
David Bolvansky 116e6cf36e [Diagnostics] Avoid -Wsizeof-array-div when dividing the size of a nested array by the size of the deepest base type
llvm-svn: 372600
2019-09-23 12:54:35 +00:00
Mark Murray c720f63845 Cosmetic; don't use the magic constant 35 when HASH is more readable. This matches other MCK__<THING>_* usage better.
Summary: No functional change. This fixes a magic constant in MCK__*_... macros only.

Reviewers: ostannard

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372599
2019-09-23 12:52:42 +00:00
Simon Pilgrim 0860934291 Function::BuildLazyArguments() - fix "variable used but never read" analyzer warning. NFCI.
Simplify the code by separating the masking of the SDC variable from using it.

llvm-svn: 372598
2019-09-23 12:49:39 +00:00
GN Sync Bot 09855a2b50 gn build: Merge r372595
llvm-svn: 372597
2019-09-23 12:44:45 +00:00
Guillaume Chatelet 1ae7905fc8 [Alignment][NFC] DataLayout migration to llvm::Align
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: jholewinski, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372596
2019-09-23 12:41:36 +00:00
Yitzhak Mandelbaum 1588c08735 [libTooling] Introduce new library of source-code builders.
Summary:
Introduces facilities for easily building source-code strings, including
idiomatic use of parentheses and the address-of, dereference and member-access
operators (dot and arrow) and queries about need for parentheses.

Reviewers: gribozavr

Subscribers: mgorny, cfe-commits, ilya-biryukov

Tags: #clang

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

llvm-svn: 372595
2019-09-23 12:40:10 +00:00
Dmitri Gribenko befcd660d2 Removed dead code from Stencil.h
llvm-svn: 372594
2019-09-23 12:15:48 +00:00
Dmitri Gribenko 04b34a20b9 Removed an incorred namespace-end comment
llvm-svn: 372593
2019-09-23 12:07:10 +00:00
Martin Storsjo 8b98f12a7a [LLDB] Check for _WIN32 instead of _MSC_VER for code specific to windows in general
These ifdefs contain code that isn't specific to MSVC but useful for
any windows target, like MinGW.

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

llvm-svn: 372592
2019-09-23 12:03:56 +00:00
Martin Storsjo 02d3cc97fa [LLDB] Remove a now redundant windows specific workaround
vsnprintf(NULL, 0, ...) works for measuring the needed string
size on all supported Windows variants; it's supported since
at least MSVC 2015 (and LLVM requires a newer version than that),
and works on both msvcrt.dll (since at least XP) and UCRT with MinGW.

The previous use of ifdefs was wrong as well, as __MINGW64__ only is
defined for 64 bit targets, and the define without trailing
underscores is never defined automatically (neither by clang nor
by gcc).

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

llvm-svn: 372591
2019-09-23 12:03:33 +00:00
Martin Storsjo d67b0997d2 [LLDB] Add a void* cast when passing object pointers to printf %p
This fixes build warnings in MinGW mode.

Also remove leftover if (log) {} around the log macro.

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

llvm-svn: 372590
2019-09-23 12:03:28 +00:00
Martin Storsjo 33d29a60a2 [LLDB] Avoid a warning about an unused static variable
The variable is unused on windows.

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

llvm-svn: 372589
2019-09-23 12:03:21 +00:00