Commit Graph

353663 Commits

Author SHA1 Message Date
David Green a349949f8a [ARM] Extract from a VDUP
If we get into the situation where we are extracting from a VDUP, the
extracted value is just the origin, so long as the types match or we can
bitcast between the two.

Differential Revision: https://reviews.llvm.org/D78708
2020-05-06 14:51:25 +01:00
Adam Czachorowski 319787315d [clangd] Do not offer "Add using" tweak in header files.
Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79488
2020-05-06 15:50:54 +02:00
Renato Golin 5010b5b7e6 Check type for forward reference definition
The types of forward references are checked that they match with other
uses, but they do not check they match with the definition.

    func @forward_reference_type_check() -> (i8) {
      br ^bb2

    ^bb1:
      return %1 : i8

    ^bb2:
      %1 = "bar"() : () -> (f32)
      br ^bb1
    }

Would be parsed and the use site of '%1' would be silently changed to
'f32'.

This commit adds a test for this case, and a check during parsing for
the types to match.

Patch by Matthew Parkinson <mattpark@microsoft.com>

Closes D79317.
2020-05-06 14:34:18 +01:00
David Green ed7db68c35 [ARM] Convert a bitcast VDUP to a VDUP
The idea, under MVE, is to introduce more bitcasts around VDUP's in an
attempt to get the type correct across basic block boundaries. In order
to do that without other regressions we need a few fixups, of which this
is the first. If the code is a bitcast of a VDUP, we can convert that
straight into a VDUP of the new type, so long as they have the same
size.

Differential Revision: https://reviews.llvm.org/D78706
2020-05-06 14:14:21 +01:00
Alexandre Ganea 06591b6d19 [Debug][CodeView] Emit fully qualified names for globals
Emit S_[L|G][THREAD32|DATA32] records with a fully qualified name (namespace + class scope).

Differential Revision: https://reviews.llvm.org/D79447
2020-05-06 09:12:00 -04:00
Alexandre Ganea c503d97d19 [Support] Silence warning: comparison of integers of different signs: 'const int' and 'const unsigned long' 2020-05-06 09:12:00 -04:00
Alexandre Ganea db817d15d1 [InstrProf] Silence warnings when targeting x86 with VS2019 16.5.4
Differential Revision: https://reviews.llvm.org/D79337
2020-05-06 09:12:00 -04:00
Alexandre Ganea 3483cdc834 [Sema] Silence warnings when targeting x86 with VS2019 16.5.4
Differential Revision: https://reviews.llvm.org/D79337
2020-05-06 09:11:59 -04:00
Nicolas Vasilache 94438c86ad [mlir] Add a MemRefCastOp canonicalization pattern.
Summary:
This revision adds a conservative canonicalization pattern for MemRefCastOp that are typically inserted during ViewOp and SubViewOp canonicalization.
Ideally such canonicalizations would propagate the type to consumers but this is not a local behavior. As a consequence MemRefCastOp are introduced to keep type compatibility but need to be cleaned up later, in the case where more dynamic behavior than necessary is introduced.

Differential Revision: https://reviews.llvm.org/D79438
2020-05-06 09:10:05 -04:00
Simon Pilgrim 8650b36935 [X86][SSE] Move VZEXT_MOVL removal into SimplifyDemandedVectorEltsForTargetNode
This patch replaces the VZEXT_MOVL removal from combineShuffle with a more general version based in SimplifyDemandedVectorEltsForTargetNode.

By using computeKnownBits we can always remove the VZEXT_MOVL if the upper elements of the source operand are known to be zero.

This requires us to add the conversion ops to computeKnownBitsForTargetNode as well.

Reviewed By: @craig.topper

Differential Revision: https://reviews.llvm.org/D79335
2020-05-06 14:05:07 +01:00
Simon Pilgrim 1c4f118d89 [X86][SSE] getShuffleScalarElt - minor NFC cleanup.
Use SelectionDAG::MaxRecursionDepth instead of (equal) hard coded constant.

clang-format
2020-05-06 14:05:07 +01:00
David Spickett 055ea585c7 Reland "[CodeGen] Make logic of CCState::resultsCompatible clearer"
This relands commit d782d1f898.
With a typo fixed, which was causing the x86 test failure.
2020-05-06 13:40:49 +01:00
Raphael Isemann dee4cbcd47 [lldb][NFC] Remove some redundant comment containing just the file name 2020-05-06 13:58:25 +02:00
Richard Sandiford 69ab8b46b8 [Sema][SVE] Fix handling of initialisers for built-in SVE types
The built-in SVE types are supposed to be treated as opaque types.
This means that for initialisation purposes they should be treated
as a single unit, much like a scalar type.

However, as Eli pointed out, actually using "scalar" in the diagnostics
is likely to cause confusion, given the types are logically vectors.
The patch therefore uses custom diagnostics or generalises existing
ones.  Some of the messages use the word "indivisible" to try to make
it clear(er) that these types can't be initialised elementwise.

I don't think it's possible to trigger warn_braces_around_(scalar_)init
for sizeless types as things stand, since the types can't be used as
members or elements of more complex types.  But it seemed better to be
consistent with ext_many_braces_around_(scalar_)init, so the patch
changes it anyway.

Differential Revision: https://reviews.llvm.org/D76689
2020-05-06 12:24:27 +01:00
Kadir Cetinkaya 9b509bca85
Revert "[clangd] Handle PresumedLocations in IncludeCollector"
This reverts commit 4f7917c269 as it is
breaking windows build bots.
2020-05-06 13:17:08 +02:00
Denys Petrov ba8cda989c [analyzer] Stability improvement for IteratorModeling
Summary:
Some function path may lead to crash.
Fixed using local variable outside the scope  through a pointer.
Fixed minor misspellings.
Added regression test.

This patch covers a bug https://bugs.llvm.org/show_bug.cgi?id=41485

Reviewed By: baloghadamsoftware

Differential Revision: https://reviews.llvm.org/D78289
2020-05-06 14:16:39 +03:00
Dmitry Preobrazhensky 5998baccb9 [AMDGPU][MC][GFX9+] Enabled 21-bit signed offsets for SMEM instructions
Reviewers: arsenm, rampitec

Differential Revision: https://reviews.llvm.org/D79288
2020-05-06 14:13:10 +03:00
Kadir Cetinkaya 4f7917c269
[clangd] Handle PresumedLocations in IncludeCollector
Summary:
This will enable extraction of correct line locations in preamble patch
for includes.

Reviewers: sammccall

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78740
2020-05-06 13:06:49 +02:00
Stefan Pintilie 7d507ff55f [PowerPC] Fix missing GOT indirect variant kind
The function MCSymbolRefExpr::getVariantKindForName was missing the entry for
VK_PPC_GOT_PCREL. This patch adds the missing entry.

Differential Revision: https://reviews.llvm.org/D79015
2020-05-06 05:50:56 -05:00
Raphael Isemann aaf68cd9ce [lldb] Warn the user about starting the --func-regex parameter with an asterisk
Summary:
Sometimes users think that setting a function regex for all function that contain the word 'needle' in their
name looks like this: `*needle*`. However, LLDB only searches the function name and doesn't fully match
it against the regex, so the leading and trailing '*' operators don't do anything and actually just cause the
regex engine to reject the regular expression with "repetition-operator operand invalid".

This patch makes this a bit more obvious to the user by printing a warning that a leading '*' before this
regular expression here doesn't have any purpose (and will cause an error). This doesn't attempt to detect
a case where there is only a trailing '*' as that would involve parsing the regex and it seems the most
common way to end up in this situation is by doing `rbreak *needle*`.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D78809
2020-05-06 12:37:52 +02:00
Tamás Zolnai fedd52682e [clang-tidy]: Add cert-str34-c alias for bugprone-signed-char-misuse.
Summary:
Added `DiagnoseSignedUnsignedCharComparisons` option to
filter out unrelated use cases. The SEI cert catches explicit
integer casts (two use cases), while in the case of
`signed char` \ `unsigned char` comparison, we have implicit
conversions.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79334
2020-05-06 12:36:01 +02:00
Richard Sandiford e959931092 [Sema] Put existing warning under -Wexcess-initializers
I have a follow-on patch that uses an alternative wording for
ext_excess_initializers in some cases.  This patch puts it and
a couple of related warnings under their own -W option in order
to avoid a regression in Misc/warning-flags.c.

Differential Revision: https://reviews.llvm.org/D79244
2020-05-06 11:28:40 +01:00
Jay Foad be65bb12ca Fix misleading comments. 2020-05-06 11:08:25 +01:00
Haojian Wu c6e1fd70fb [clang] Fix a crash on invalid auto.
Summary:
The crash is triggered on accessing a null InitExpr.

For group declaration, e.g. `auto c = a, &d = {a};`, what's happening:

1. each VarDecl is built separately during the parsing stage.
2. perform the semantic analysis (Sema::BuildDeclaratorGroup) to check
whether the type of the two VarDecl is the same, if not mark it as invalid.

in step 1, VarDecl c and d are built, both of them are valid (after D77395),
but d is without the InitExpr attached (under -fno-recovery-ast), crash
happens in step 2 when accessing the source range of d's InitExpr.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79473
2020-05-06 11:47:03 +02:00
Richard Sandiford fb4574df52 [docs] Regenerate DiagnosticsReference.rst
It looks like it has been a while since the checked-in version of
DiagnosticsReference.rst was regenerated.  I realise there probably
isn't any expectation that the checked-in version is kept up-to-date,
but now that the project is on github and the rst can be viewed directly
from the repo's web interface, it seemed worth having something a bit
more recent.

Differential Revision: https://reviews.llvm.org/D79236
2020-05-06 10:26:47 +01:00
Benjamin Kramer d5ea89f891 Quiet some -Wdocumentation warnings. 2020-05-06 11:23:13 +02:00
David Spickett e1022cb5d4 Revert "[CodeGen] Make logic of CCState::resultsCompatible clearer"
This reverts commit d782d1f898
which caused test CodeGen/X86/sibcall.ll to fail.
2020-05-06 10:14:17 +01:00
Jaroslav Sevcik cf5ed6dc59 Fix error handling after [<index>] in 'frame variable'
Summary:
This fixes a bug where

frame var a[0]+5

returns the value a[0] without any warning because the current logic simply ignores everything after ']' as long as there is no '.', '-' or '[' in the rest of the string.

The fix simplifies the termination condition of the expression path parsing loop to check if have a non-empty remaining string to parse. Previously, the condition checked if a separator was found. That condition coincided with the remaining string-to-parse condition except for the buggy indexed case where non-empty string was left ("+5" in the example above), but the separator index was 'npos'.

Reviewed By: teemperor, labath

Differential Revision: https://reviews.llvm.org/D79404
2020-05-06 11:03:46 +02:00
Xing GUO 0054c46095 [llvm-nm/objdump/size] Add tests for dumping symbol tables with invalid sh_size.
This change adds tests for llvm-nm, llvm-objdump and llvm-size when dumping symbol tables with invalid sh_size (sh_size % sizeof(Elf_Sym) != 0).

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D77864
2020-05-06 17:01:20 +08:00
David Spickett d782d1f898 [CodeGen] Make logic of CCState::resultsCompatible clearer 2020-05-06 09:48:58 +01:00
Paula Toth d80715d1d4 [libc] Change target name for testing benchmark utils infrastructure.
Reviewers: sivachandra

Reviewed By: sivachandra

Subscribers: gchatelet, mgorny, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D79466
2020-05-06 01:22:15 -07:00
Konstantin Schwarz e82b0e9a8e [GlobalISel][InlineAsm] Add support for basic output operand constraints
Reviewers: arsenm, dsanders, aemerson, volkan, t.p.northover, paquette

Reviewed By: arsenm

Subscribers: gargaroff, wdng, rovka, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78318
2020-05-06 10:06:13 +02:00
Dmitri Gribenko 3adaa97f01 Fix ForRangeCopyCheck not triggering on iterators returning elements by value in C++17.
Summary:
The AST is different in C++17 in that there is no MaterializeTemporaryExpr for in the AST for a loop variable that is initialized from an iterator that returns its elements by value.

Account for this by checking that the variable is not initialized by an operator* call that returns a value type.

Reviewers: gribozavr2

Reviewed By: gribozavr2

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79440
2020-05-06 09:42:13 +02:00
Uday Bondhugula ca09dab303 [MLIR][NFC] Fix/update debug messages for analysis utils and affine fusion
Drop trailing period in debug messages. Add an extra line for fusion
debug info.

Differential Revision: https://reviews.llvm.org/D79471
2020-05-06 12:27:59 +05:30
Vitaly Buka 04bd2c37ca [local-bounds] Ignore volatile operations
Summary:
-fsanitize=local-bounds is very similar to ``object-size`` and
should also ignore volatile pointers.
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#volatile

Reviewers: chandlerc, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, hiraditya, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D78607
2020-05-05 23:08:08 -07:00
Vitaly Buka d9c529c2a8 [lsan] Fix warnings lit config 2020-05-05 22:42:14 -07:00
Vitaly Buka d059d01c23 [dfsan] Remove realloc from done_abilist.txt
Summary:
Currently, realloc is marked as "discard" in done_abilist.txt. As discussed in PR#45583, this is probably not the expected behavior; a custom wrapper seems to be required. Since this wrapper has not been implemented yet, realloc should not be in the done_abilist.txt file so that a warning is displayed when it is called.

Reviewers: kcc, pcc, vitalybuka

Reviewed By: vitalybuka

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D78379
2020-05-05 22:32:45 -07:00
Craig Topper b55009df66 [X86] Add v32i16/v64i8 into the handling for 512-bit inline assembly constraints. 2020-05-05 21:41:31 -07:00
Jan Korous 02b303321d [libclang] Remove duplicate dependency on LLVMSupport
Differential Revision: https://reviews.llvm.org/D79451
2020-05-05 21:31:07 -07:00
Johannes Doerfert f014972446 [Attributor][NFC] Cleanup some AAMemoryLocation code
This is the first step to resolve a TODO in AAMemoryLocation and to fix
a bug we have when handling `byval` arguments of `readnone` call sites.

No functional change intended.
2020-05-05 23:15:33 -05:00
Johannes Doerfert 0cc9c02255 [Attributor][NFC] Minor code cleanups to minimize follow up diffs 2020-05-05 23:14:23 -05:00
Johannes Doerfert 094137a6c6 [Attributor][NFC] Avoid dependences on known information 2020-05-05 23:14:23 -05:00
Craig Topper 0fac1c1912 [X86] Allow Yz inline assembly constraint to choose ymm0 or zmm0 when avx/avx512 are enabled and type is 256 or 512 bits
gcc supports selecting ymm0/zmm0 for the Yz constraint when used with 256 or 512 bit vector types.

Fixes PR45806

Differential Revision: https://reviews.llvm.org/D79448
2020-05-05 21:12:30 -07:00
Puyan Lotfi 0c4aab27b3 [NFC] Outliner label name clean up.
Just simplifying how the label name is generated while using
std::to_string instead of Twine.

Differential Revision: https://reviews.llvm.org/D79464
2020-05-05 23:27:46 -04:00
Jessica Paquette b1b86d1c28 [AArch64][GlobalISel] Fold shifts into G_ICMP
Since G_ICMP can be selected to a SUBS, we can fold shifts into such compares.

E.g.

```
cmp	w1, w0, lsl #3
cmp	w1, w0, lsr #3
cmp	w1, w0, asr #3
```

This is done the same way as for adds and subtracts, using
`selectShiftedRegister`.

This gives some minor code size savings on CTMark.

https://reviews.llvm.org/D79365
2020-05-05 18:35:39 -07:00
Wenlei He 17fc651860 [llvm-profdata] Support -detailed-summary for Sample Profile
Summary: Add -detailed-summary support for sample profile dump to match that of instrumentation profile.

Reviewers: wmi, davidxl, hoyFB

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79291
2020-05-05 18:28:22 -07:00
Justice Adams 89c7451c35 Fix SelectionDAG Graph Printing on Windows
Currently, when compiling to IR (presumably at the clang level) LLVM
mangles symbols and sometimes they have illegal file characters
including `?`'s in them. This causes a problem when building a graph via
llc on Windows because the code currently passes the machine function
name all the way down to the Windows API which frequently returns error
123  **ERROR_INVALID_NAME**
https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-

Thus, we need to remove those illegal characters from the machine
function name before generating a graph, which is the purpose of this
patch.
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file

I've created a static helper function replace_illegal_filename_chars
which within GraphWriter.cpp to help with replacing illegal file
character names before generating a dot graph filename.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D76863
2020-05-05 17:01:05 -07:00
Jonas Devlieghere 0274c797c6 [lldb/Utils] Serialize exit code in lldb-repro.py
After 61d5b0e663 more shell test are expected to exit with a non-zero
status code. Because the exit status is computed in the driver and not
behind the SB API layer, reproducers don't know about it and always
return 0 unless replay failed.

This discrepancy means that these tests don't work with lldb-repro.py
and skipping them for this reason would be a pity. To solve this
problem, the script now serializes the exit code during capture and
returns that during replay.

These is an assert that ensures that replay exits with a zero exit
status to prevent replay failures from being silently ignored.
2020-05-05 16:05:49 -07:00
Azharuddin Mohammed b0eb7cd2be Reapply "NFC: utils/perf-training: Python 3 compatibility for lit.cfg"
This is in response to the recent move to Python 3.

This reverts commit 5f4426e517.
2020-05-05 15:56:23 -07:00
Jason Molenda 5034102b24 Log the NSError str and object description on app launch fail
Update CallBoardSystemServiceOpenApplication to unconditionally log
the NSError's localizedDescription to Console on app launch failure
(as it was already doing), and also to log the NSError object's
full description to the console, which may contain additional nested
error messages.  I'm experimenting to find cases where we will get
more detailed information from app launch failures and will start
by logging both to the console.

<rdar://problem/62709160>
2020-05-05 15:51:50 -07:00