Commit Graph

364081 Commits

Author SHA1 Message Date
Richard Smith efeb65d53b Fix up clangd after Clang 038edf6029.
Now that Clang is able to constant-evaluate void-typed expressions,
disable showing hover-card values for them. It's not useful to say that
an expression cast to void has value '<no value>', even if we can
constant-evaluate it to that result!
2020-08-20 16:36:25 -07:00
Julian Lettner 1f3c92f968 [compiler-rt][Darwin] Refactor minimum deployment target substitutions
* Support macOS 11+ version scheme
* Standardize substitution name `%min_deployment_target=x.y`
* Remove unneeded error cases (the input version is hard-coded)
* Specify version as tuple instead of string; no need to parse it

These changes should also facilitate a future addition of a substitution
that expands to "set deployment target to current target version"
(https://reviews.llvm.org/D70151).

Reviewed By: delcypher

Differential Revision: https://reviews.llvm.org/D85925
2020-08-20 16:22:56 -07:00
Fangrui Song 9670029b6b [ELF] Keep st_type for symbol assignment
PR46970: for `alias = aliasee`, the alias can be used in relocation processing
and on ARM st_type does affect Thumb interworking. It is thus desirable for the
alias to get the same st_type.

Note that the st_size field should not be inherited because some tools use
st_size=0 as a heuristic to detect aliases. Retaining st_size can thwart such
heuristics and cause aliases to be preferred over the original symbols.

Differential Revision: https://reviews.llvm.org/D86263
2020-08-20 16:05:27 -07:00
JonChesterfield 3d82c9b696 Fix 32 bit build broken by D85990 by dropping align from filecheck pattern 2020-08-20 23:50:33 +01:00
Richard Smith 038edf6029 Don't reject uses of void-returning consteval functions. 2020-08-20 15:40:09 -07:00
Frank Laub cca3f3dd26 [MLIR] Add affine.parallel folder and normalizer
Add a folder to the affine.parallel op so that loop bounds expressions are canonicalized.

Additionally, a new AffineParallelNormalizePass is added to adjust affine.parallel ops so that the lower bound is always 0 and the upper bound always represents a range with a step size of 1.

Differential Revision: https://reviews.llvm.org/D84998
2020-08-20 22:23:21 +00:00
Eric Leese 4e266eaf13 Make DWARFExpression::GetLocationExpression public
This method is used to get the DataExtractor when the expression is a location list.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D86090
2020-08-20 15:12:28 -07:00
Jonas Devlieghere ed17b6f630 [lldb] Extract FileSystem initialization code into helper (NFC)
The FileSystem initialization depends on the reproducer mode. It has
been growing organically to the point where it deserves its own helper
function. This also allows for early returns to simplify the code.
2020-08-20 15:10:38 -07:00
Fangrui Song b587ca93be [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00
George Mitenkov dc693a036d [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion
Removed the Standard to LLVM conversion patterns that were previously
pulled in for testing purposes. This helps to separate the conversion
to LLVM dialect of the MLIR module with both SPIR-V and Standard
dialects in it (particularly helpful for SPIR-V cpu runner). Also,
tests were changed accordingly.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D86285
2020-08-21 00:26:33 +03:00
Fangrui Song 2b0f40b049 [llvm-dwarfdump] Fix a typo: witin -> within 2020-08-20 14:12:37 -07:00
Jonas Devlieghere 921c1b7df3 [lldb] Provide GetHomeDirectory wrapper in Host::FileSystem (NFC)
Provider a wrapper around llvm::sys::path::home_directory in the
FileSystem class. This will make it possible for the reproducers to
intercept the call in a central place.
2020-08-20 14:07:05 -07:00
Jon Roelofs 74ca5275e9 Fix a couple of typos. NFC 2020-08-20 14:56:57 -06:00
Simon Pilgrim cff0db0876 [X86] Enable constexpr on POPCNT intrinsics (PR31446)
This is a first step patch to enable constexpr support and testing to a large number of x86 intrinsics.

All I've done here is provide a DEFAULT_FN_ATTRS_CONSTEXPR variant to our existing DEFAULT_FN_ATTRS tag approach that adds constexpr on c++ builds. The clang cuda headers do something similar.

I've started with POPCNT mainly as its tiny and are wrappers to generic __builtin_* intrinsics which already act as constexpr.

Differential Revision: https://reviews.llvm.org/D86229
2020-08-20 21:38:04 +01:00
Matt Arsenault 79ce9bb380 CodeGen: Don't drop AA metadata when splitting MachineMemOperands
Assuming this is used to split a memory access into smaller pieces,
the new access should still have the same aliasing properties as the
original memory access. As far as I can tell, this wasn't
intentionally dropped. It may be necessary to drop this if you are
moving the operand outside of the bounds of the original object in
such a way that it may alias another IR object, but I don't think any
of the existing users are doing this. Some of the uses widen into
unused alignment padding, which I think is OK.
2020-08-20 16:17:30 -04:00
Matt Arsenault 18b218007d AMDGPU/GlobalISel: Legalize odd sized loads with widening
Custom lower and widen odd sized loads up to the alignment. The
default set of legalization actions doesn't have a way to represent
this. This fixes naturally aligned <3 x s8> and <3 x s16> loads.

This also starts moving towards eliminating the buggy and
overcomplicated legalization rules for narrowing. All the memory size
changes should be done in the lower or custom action, not NarrowScalar
/ FewerElements. These currently have redundant and ambiguous code
with the lower action.
2020-08-20 16:15:53 -04:00
vnalamot 54d8ded4b1 allSGPRSpillsAreDead() should use actual FP/BP frame indices
The SGPR spills happen in SILowerSGPRSpills() and allSGPRSpillsAreDead()
make sure there are no SGPR spills pending during PEI. But the FP/BP
spills happen during PEI and are exceptions.

Use actual frame indices of FP/BP in allSGPRSpillsAreDead() to
accommodate the exceptions.

Differential Revision: https://reviews.llvm.org/D86291
2020-08-20 16:15:53 -04:00
Kamau Bridgeman b74b80bb2d [PowerPC][PCRelative] Thread Local Storage Support for General Dynamic
This patch is the initial support for the General Dynamic Thread Local
Local Storage model to produce code sequence and relocations correct
to the ABI for the model when using PC relative memory operations.

Patch by: NeHuang

Reviewed By: stefanp

Differential Revision: https://reviews.llvm.org/D82315
2020-08-20 15:08:13 -05:00
Julian Lettner d9b062ad87 [TSan][Darwin] Remove unnecessary lit substitution
We don't test on very old versions of Apple platforms anymore.  The
following lit substitution concerning the minimum deployment target for
ARC support can be removed.

```
%darwin_min_target_with_full_runtime_arc_support -> 10.11
```

Differential Revision: https://reviews.llvm.org/D85803
2020-08-20 13:00:32 -07:00
Cameron McInally 8372e47bb9 [NFCI][SVE] Move fixed length i32/i64 SDIV tests
Move fixed length SDIV tests from sve-fixed-length-int-arith.ll to sve-fixed-length-int-div.ll. The former uses CHECK lines that verify legalization decisions. That's overkill for the i8/i16 SDIV tests, since they have a tricky legalization.
2020-08-20 14:46:26 -05:00
Julian Lettner 6222a28db5 [TSan][Darwin] Enable test on non-macOS platforms
After removing the unnecessary `-mmacosx-version-min=10.12` compiler
flag this test can run on all platforms.  I confirmed that this test is
green for iOS, iOS simulator, and watchOS simulator.

Differential Revision: https://reviews.llvm.org/D85952
2020-08-20 12:28:05 -07:00
Fangrui Song ddde8bebb0 [llvm-dwarfdump] --statistics: switch to json::OStream. NFC
Then it is trivial to make the output indented (the second parameter of
json::OStream::OStream specifies the indentation).

Reviewed By: jhenderson, echristo

Differential Revision: https://reviews.llvm.org/D86045
2020-08-20 12:24:06 -07:00
Raul Tambre 58c08c4446 Test commit 2020-08-20 22:15:01 +03:00
Gongyu Deng 22e63cba17 [lldb] tab completion for breakpoint names
1. created a common completion for breakpoint names;
2. bound the breakpoint name common completion with eArgTypeBreakpointName;
3. implemented the dedicated completion for breakpoint read -N.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D80693
2020-08-20 20:56:34 +02:00
Cameron McInally ac63959460 [SVE] Lower fixed length vXi8/vXi16 SDIV to scalable
There are no nxv16i8/nxv8i16 SDIV instructions, so these fixed width operations must be promoted to nxv4i32.

Differential Revision: https://reviews.llvm.org/D86114
2020-08-20 13:47:01 -05:00
LLVM GN Syncbot ffadd30b31 [gn build] Port 1a995a0af3 2020-08-20 18:24:44 +00:00
Jessica Clarke 3149ec07c0 [RISCV] Enable MCCodeEmitter instruction predicate verifier
This ensures that we never encode an instruction which is unavailable,
such as if we explicitly insert a forbidden instruction when lowering.
This is particularly important on RISC-V given its high degree of
modularity, and will become increasingly important as new standard
extensions appear.

Reviewed By: asb, lenary

Differential Revision: https://reviews.llvm.org/D85015
2020-08-20 18:36:54 +01:00
Roman Lebedev ea2e682cc2
[NFC][InstCombine] Tests for PHI-of-insertvalue's
Currently we don't do anything about these,
neither in InstCombine, nor in SimplifyCFG's sinking.
These happen exceedingly rarely, but i've seen them in the cases where
PHI-aware aggregate reconstruction would have fired if not for them.
2020-08-20 20:16:31 +03:00
Jay Foad 3497860203 [AMDGPU] Remove uses of Register::isPhysicalRegister/isVirtualRegister
... in favour of the isPhysical/isVirtual methods.
2020-08-20 17:59:11 +01:00
Mircea Trofin 364cd768a2 [NFC] Expose the -Oz module optimization pipeline to opt
This exposes the module optimization pipeline as a pass that can be
applied stand-alone when using 'opt'. This helps ml inliner training
scenarios, where we start with IR captured right before inlining,
perform the inlining (-scc-oz-module-inliner) and then want to continue
and observe the final IR (where this patch comes into play). We can then
apply llc on the resulting IR to continue compilation down to native.

Differential Revision: https://reviews.llvm.org/D86224
2020-08-20 09:28:58 -07:00
Jordan Rupprecht 0de3d0c612 [lldb][asan] Mark destructor as virtual to allow subclasses.
`lldb_private::ScriptInterpreterPython::CommandDataPython` inherits from `lldb_private::BreakpointOptions::CommandData`, but the latter does not have a virtual destructor. This leads to a new-delete-type-mismatch error when running certain tests (such as `functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py`) under asan.
2020-08-20 09:21:33 -07:00
Siva Chandra Reddy 87bf0b0ee9 [libc] Add a class called NormalFloat which represents normalized floats.
This class helps in dealing with normal and subnormal numbers uniformly.
Moreover, since this class has been designed to handle all floating
formats across platforms, it helps implement floating point functions in
a uniform manner.

The implementations of frexp and logb have been switched to use this new
class as it allows us to use just one implementation across all
different floating point formats.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D86241
2020-08-20 09:00:35 -07:00
Jay Foad 4aaf772542 [PeepholeOptimizer] Remove dead code
At this point we have already ruled out all def operands, so we can't
possibly see a dead implicit def operand.
2020-08-20 16:48:57 +01:00
Siva Chandra Reddy ed8982da3e [libc][NFC] Switch math tests to the new ULP based tolerance.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D86267
2020-08-20 08:31:31 -07:00
Eduardo Caldas e4e983e240 [SyntaxTree] Split tests related to Namespace
Differential Revision: https://reviews.llvm.org/D86139
2020-08-20 15:14:56 +00:00
Eduardo Caldas a4ef9e8643 [SyntaxTree] Unify logic for generating `id-expression` 2020-08-20 14:57:35 +00:00
Eduardo Caldas ba32915db2 [SyntaxTree] Add support for `MemberExpression`
Differential Revision: https://reviews.llvm.org/D86227
2020-08-20 14:57:35 +00:00
Hans Wennborg 7f00938975 lld docs config: Use a list key in html_sidebars
Otherwise the docs-lld-html target fails to build using recent Sphinx
with the following not very helpful error message:

An error happened in rendering the page index.
Reason: TemplateNotFound()

It turns out the values in the html_sidebars dictionary always need to be lists
now. See https://github.com/sphinx-doc/sphinx/issues/6186
2020-08-20 16:48:06 +02:00
Pavel Labath 8a8a2dd316 [lldb/Utility] Simplify Scalar handling of float types
Similarly to D85836, collapse all Scalar float types to a single enum
value, and use APFloat semantics to differentiate between. This
simplifies the code, and opens to door to supporting other floating
point semantics (which would be needed for fully supporting
architectures with more interesting float types such as PPC).

Differential Revision: https://reviews.llvm.org/D86220
2020-08-20 16:26:02 +02:00
Alex Bradbury 1ecf120246 [index-while-building] Fix build with -DBUILD_SHARED_LIBS=True
The dependencies in clang/lib/IndexSerialization/CMakeLists.txt were
incomplete, leading to link errors for a -DBUILD_SHARED_LIBS=True build.
2020-08-20 15:12:56 +01:00
Bevin Hansson 2bac004c90 Add triples to fixed-point tests which lacked them.
This caused failures on clang-x390x-linux.
2020-08-20 15:36:15 +02:00
David Green 816097e4e5 [LV] Allow tail folded reduction selects to remain in the loop
The normal scheme for tail folding reductions is to use:

loop:
  p = phi(0, a)
  mask = ...
  x = masked_load(..., mask)
  a = add(x, p)
s = select(mask, a, p)

This means we need to keep the register p and a alive out of the loop, plus
the mask. On a target with predicated operations we can instead generate
the phi as p = phi(0, s). This ensures the select in the loop and we can
fold select(m, add(a, b), c) to something like a vaddt c, a, b using the
m predicate. This in turn allows us to tail predicate the entire loop.

Differential Revision: https://reviews.llvm.org/D84741
2020-08-20 14:31:14 +01:00
Raphael Isemann adf0b8cc70 Revert "[compiler-rt] Compile assembly files as ASM not C"
This reverts commit d58fd4e521. This broke
compiler-rt compilation on macOS:

codesign --sign - /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lib/clang/12.0.99/lib/darwin/libclang_rt.tsan_ios_dynamic.dylib
ld: warning: ignoring file projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan_ios_dynamic.dir/rtl/tsan_rtl_amd64.S.o, building for iOS-arm64 but attempting to link with file built for iOS Simulator-x86_64
ld: warning: ignoring file projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan_ios_dynamic.dir/rtl/tsan_rtl_aarch64.S.o, building for iOS-arm64 but attempting to link with file built for iOS Simulator-x86_64
Undefined symbols for architecture arm64:
  "_wrap__setjmp", referenced from:
      substitution__setjmp in tsan_interceptors_posix.cpp.o
  "_wrap_setjmp", referenced from:
      substitution_setjmp in tsan_interceptors_posix.cpp.o
  "_wrap_sigsetjmp", referenced from:
      substitution_sigsetjmp in tsan_interceptors_posix.cpp.o
ld: symbol(s) not found for architecture arm64
2020-08-20 15:25:22 +02:00
Pavel Labath 9109311356 [lldb] Forcefully complete a type when adding typedefs
This is very similar to D85968, only more elusive to since we were not
adding the typedef type to the relevant DeclContext until D86140, which
meant that the DeclContext was populated (and the relevant assertion
hit) only after importing the type into the expression ast in a
particular way.

I haven't checked whether this situation can be hit in the gmodules
case, but my money is on "yes".

Differential Revision: https://reviews.llvm.org/D86216
2020-08-20 15:19:10 +02:00
Joachim Priesner 03ded5497a Fix -allow-enabling-analyzer-alpha-checkers always being passed to run-clang-tidy.py
The action='store_true' option of argparse.add_argument implicitly
generates a default value of False if the argument is not specified.
Thus, the allow_enabling_alpha_checkers argument of
get_tidy_invocation is never None.
2020-08-20 09:15:29 -04:00
Aleksandr Platonov 4457398265 [clangd] Don't crash on `#pragma clang __debug parser_crash`
Currently, clangd crashes when opening a file with `#pragma clang __debug parser_crash` (e.g. clang/test/Modules/Inputs/crash.h).
This patch disables these crashes.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D86279
2020-08-20 15:53:21 +03:00
Adam Czachorowski 707138d677 [clangd] Remove useless stderr logging.
This was accidentally added in 53b9199a5c

Differential Revision: https://reviews.llvm.org/D86284
2020-08-20 14:52:04 +02:00
Bjorn Pettersson ff107eed15 [AArch64] Update a code comment incorrectly referring to zero_reg. NFC
The getSrcFromCopy helper nowadays return a MachineOperand pointer,
so talking about zero_reg was incorrect as it nowadays return
a nullptr when not finding a copy like instruction.
2020-08-20 14:36:59 +02:00
Adam Czachorowski baeff989b0 [clang] When loading preamble from AST file, re-export modules in Sema.
This addresses a FIXME in ASTReader.

Modules were already re-exported for Preprocessor, but not for Sema.
The result was that, with -fmodules-local-submodule-visibility, all AST
nodes belonging to a module that was loaded in a premable where not
accesible from the main part of the file and a diagnostic recommending
importing those modules would be generated.

Differential Revision: https://reviews.llvm.org/D86069
2020-08-20 14:19:52 +02:00
Adam Czachorowski 53b9199a5c [clangd] Fix crash-bug in preamble indexing when using modules.
When preamble contains #undef, indexing code finds the matching #define
and uses that during indexing. However, it would only look for local
definitions. If the macro was defined in a module, MacroInfo
would be nullptr and clangd would crash.

This change makes clangd ignore any #undef without a matching #define
inside the same TU.

The indexing of macros happens for preamble only, so then #undef must be
in the preamble, which is why we need two .h files in a test.

Note that clangd is currently not ready for module support, but this
brings us one step closer.

This was previously attempted in
4061d9e42c, but had to be reverted due to
broken test. This version fixes that test-only bug by setting a custom module
cache path to avoid re-use of modules across test invocations.

Differential Revision: https://reviews.llvm.org/D85923
2020-08-20 14:19:52 +02:00