Sam Clegg [Fri, 13 Dec 2019 22:44:06 +0000 (14:44 -0800)]
[WebAssembly] Setting export_name implies llvm.used
This change updates the clang front end to add symbols to llvm.used
when they have explicit export_name attribute.
Differential Revision: https://reviews.llvm.org/D71493
Brian Gesiak [Mon, 16 Dec 2019 22:19:16 +0000 (17:19 -0500)]
[coroutines][PR41909] Generalize fix from D62550
Summary:
In https://reviews.llvm.org/D62550 @rsmith pointed out that there are
many situations in which a coroutine body statement may be
transformed/rebuilt as part of a template instantiation, and my naive
check whether the coroutine was a generic lambda was insufficient.
This is indeed true, as I've learned by reading more of the
TreeTransform code. Most transformations are written in a way that
doesn't assume the resulting types are not dependent types. So the
assertion in 'TransformCoroutineBodyStmt', that the promise type must no
longer be dependent, is out of place.
This patch removes the assertion, spruces up some code comments, and
adds a test that would have failed with my naive check from
https://reviews.llvm.org/D62550.
Reviewers: GorNishanov, rsmith, lewissbaker
Reviewed By: rsmith
Subscribers: junparser, EricWF, rsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70579
Alex Langford [Mon, 16 Dec 2019 22:29:46 +0000 (14:29 -0800)]
[lldb] Respect previously set values of LLDB_TABLEGEN_EXE
If you set LLDB_TABLEGEN_EXE in a CMake cache file or in the CMake
invocation line, your setting isn't respected. Setting up the tablegen
for the host will overwrite the value that we set LLDB_TABLEGEN_EXE to,
which defeats the whole point of setting it in the first place.
Craig Topper [Mon, 16 Dec 2019 22:17:30 +0000 (14:17 -0800)]
[X86] Add x86 triple to command line in mxcsr-reg-usage.ll
I'm not sure how this hasn't been causing any issues.
Eric Fiselier [Mon, 16 Dec 2019 22:00:10 +0000 (17:00 -0500)]
Add default initialization to compressed_pair.
This change introduces the __default_init_tag to memory, and a corresponding
element constructor to allow for default initialization of either of the pair
values. This is useful for classes such as std::string where most (all)
constructors explicitly initialize the values in the constructor.
Patch by Martijn Vels (mvels@google.com)
Reviewed as https://reviews.llvm.org/D70617
Erich Keane [Mon, 16 Dec 2019 22:01:51 +0000 (14:01 -0800)]
Revert "[NFC-I] Remove hack for fp-classification builtins"
This reverts commit
b1e542f302c1ed796ad9f703d4d36e010afcb914.
The original 'hack' didn't chop out fp-16 to double conversions, so
systems that use FP16ConversionIntrinsics end up in IR-CodeGen with an
i16 type isntead of a float type (like PPC64-BE). The bots noticed
this.
Reverting until I figure out how to fix this
Valentin Churavy [Mon, 16 Dec 2019 09:35:14 +0000 (04:35 -0500)]
git-llvm: Add option to push to Github with SSH
Summary:
For users with 2FA Github password challenge can be rather cumbersome
and I personally use key based authentication through SSH. This fixes
the SSH feature that was present and exposes it as a command line
option.
Reviewers: tstellar
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71534
Danilo Carvalho Grael [Fri, 13 Dec 2019 19:01:03 +0000 (14:01 -0500)]
[AArch64][SVE] Add patterns for logical immediate operations.
Summary:
Add pattern matching for the following SVE logical vector and immediate instructions:
- and/bic, orr/orn, eor/eon.
Reviewers: sdesmalen, huntergr, rengolin, efriedma, c-rhodes, mgudim, kmclaughlin
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits, amehsan
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71483
Julian Lettner [Thu, 12 Dec 2019 19:51:55 +0000 (11:51 -0800)]
[TSan][Darwin] Avoid calling pthread_self() before libpthread is initialized
This skips calling `pthread_self` when `main_thread_identity` hasn't
been initialized yet. `main_thread_identity` is only ever assigned in
`__tsan::InitializePlatform`. This change should be relatively safe; we
are not changing behavior other than skipping the call to `pthread_self`
when `main_thread_identity == 0`.
rdar://
57822138
Reviewed By: kubamracek
Differential Revision: https://reviews.llvm.org/D71559
John McCall [Mon, 16 Dec 2019 21:04:31 +0000 (16:04 -0500)]
Fix a bug in the property-based serialization of
dependent template names.
Apparently we didn't test this in the test suite because we have
a lot of redundant ways of representing this situation that kick
in in the more common situations. For example, DependentTST stores
a qualifier + identifier pair rather than a TemplateName.
Erich Keane [Mon, 16 Dec 2019 19:15:48 +0000 (11:15 -0800)]
[NFC-I] Remove hack for fp-classification builtins
The FP-classification builtins (__builtin_isfinite, etc) use variadic
packs in the definition file to mean an overload set. Because of that,
floats were converted to doubles, which is incorrect. There WAS a patch
to remove the cast after the fact.
THis patch switches these builtins to just be custom type checking,
calls the implicit conversions for the integer members, and makes sure
the correct L->R casts are put into place, then does type checking like
normal.
A future direction (that wouldn't be NFC) would consider making
conversions for the floating point parameter legal.
Kit Barton [Mon, 16 Dec 2019 16:57:52 +0000 (11:57 -0500)]
[LoopFusion] Restrict loop fusion to rotated loops.
Summary:
This patch restricts loop fusion to only consider rotated loops as valid candidates.
This simplifies the analysis and transformation and aligns with other loop optimizations.
Reviewers: jdoerfert, Meinersbur, dmgreen, etiotto, Whitney, fhahn, hfinkel
Reviewed By: Meinersbur
Subscribers: ormris, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71025
Craig Topper [Mon, 16 Dec 2019 20:03:21 +0000 (12:03 -0800)]
[InstCombine] Teach removeBitcastsFromLoadStoreOnMinMax not to change the size of a store.
We can change the type as long as we don't change the size.
Fixes PR44306
Differential Revision: https://reviews.llvm.org/D71532
Thomas Lively [Sat, 14 Dec 2019 01:08:04 +0000 (17:08 -0800)]
[WebAssembly] Replace SIMD int min/max builtins with patterns
Summary:
The instructions were originally implemented via builtins and
intrinsics so users would have to explicitly opt-in to using
them. This was useful while were validating whether these instructions
should have been merged into the spec proposal. Now that they have
been, we can use normal codegen patterns, so the intrinsics and
builtins are no longer useful.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71500
Nico Weber [Mon, 16 Dec 2019 19:26:31 +0000 (14:26 -0500)]
Only run mangled_names.test if python3 is available.
The %update_cc_test_checks substitution only gets added if python3
is on path, so the test fails if it isn't. Don't run the test
when it would fail.
Also include the '%' in the arg to add_update_script_substition(),
to help greppability.
Fangrui Song [Mon, 16 Dec 2019 19:19:22 +0000 (11:19 -0800)]
[ELF] Delete unused declaration addIRelativeRelocs after D65995. NFC
Fangrui Song [Sat, 14 Dec 2019 23:09:43 +0000 (15:09 -0800)]
[ELF] Delete relOff from TargetInfo::writePLT
This change only affects EM_386. relOff can be computed from `index`
easily, so it is unnecessarily passed as a parameter.
Both in.plt and in.iplt entries are written by writePLT. For in.iplt,
the instruction `push reloc_offset` will change because `index` is now
different. Fortunately, this does not matter because `push; jmp` is only
used by PLT. IPLT does not need the code sequence.
Reviewed By: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D71518
Fangrui Song [Mon, 16 Dec 2019 18:58:48 +0000 (10:58 -0800)]
[ELF] De-template PltSection::addEntry. NFC
Nico Weber [Mon, 16 Dec 2019 18:59:41 +0000 (13:59 -0500)]
gn build: (manually) merge
c82e4ef69
Alexey Bataev [Mon, 16 Dec 2019 18:38:12 +0000 (13:38 -0500)]
[OPENMP][DOCS]Claim simd nontemporal clause, NFC.
John McCall [Mon, 16 Dec 2019 18:31:44 +0000 (13:31 -0500)]
Forward {read,write}SomeEnumType to {read,write}Enum instead of
directly to {read,write}UInt32.
This will be useful for textual formats. NFC.
John McCall [Mon, 16 Dec 2019 16:57:23 +0000 (11:57 -0500)]
Use property-based serialization for TemplateArgument.
John McCall [Mon, 16 Dec 2019 16:57:03 +0000 (11:57 -0500)]
Add Optional::map.
John McCall [Mon, 16 Dec 2019 08:59:21 +0000 (03:59 -0500)]
Use property-based serialization for TemplateName.
John McCall [Mon, 16 Dec 2019 08:51:16 +0000 (03:51 -0500)]
Add the ability for properties to be conditional on other properties.
This will be required by TemplateName.
John McCall [Mon, 16 Dec 2019 07:56:32 +0000 (02:56 -0500)]
Add the ability to declare helper variables when reading
properties from a value.
This is useful when the properties of a case are actually
read out of a specific structure, as with TemplateName.
John McCall [Mon, 16 Dec 2019 07:11:49 +0000 (02:11 -0500)]
Use property-based serialization for DeclarationName.
John McCall [Mon, 16 Dec 2019 07:10:15 +0000 (02:10 -0500)]
Add the ability to use property-based serialization for "cased" types.
This patch doesn't actually use this serialization for anything,
but follow-ups will move the current handling of various standard
types over to this.
John McCall [Mon, 16 Dec 2019 04:51:44 +0000 (23:51 -0500)]
Replace tabs with spaces.
John McCall [Sun, 15 Dec 2019 07:39:13 +0000 (02:39 -0500)]
Move Basic{Reader,Writer} emission into ASTPropsEmitter; NFC.
I'm going to introduce some uses of the property read/write methods.
John McCall [Sun, 15 Dec 2019 07:27:27 +0000 (02:27 -0500)]
Always -I clang/include when tblgen'ing in Clang.
Alexey Bataev [Mon, 16 Dec 2019 18:25:58 +0000 (13:25 -0500)]
[OPENMP][DOCS]Mark if clause on simd done, NFC.
Alexey Bataev [Mon, 16 Dec 2019 16:16:46 +0000 (11:16 -0500)]
[OPENMP50]Add if clause in target teams idistribute simd directive.
According to OpenMP 5.0, if clause can be used in for simd directive. If
condition in the if clause if false, the non-vectorized version of the
loop must be executed.
Julian Lettner [Tue, 26 Feb 2019 07:00:17 +0000 (23:00 -0800)]
[lit] max_failures does not need to be stored in LitConfig
Sam McCall [Mon, 16 Dec 2019 18:07:49 +0000 (19:07 +0100)]
Revert "[clangd] Reapply
b60896fad926 Fall back to selecting token-before-cursor if token-after-cursor fails."
This reverts commit
a0ff8cd631add513423fc2d8afa49e9650d01fe3.
Buildbot failures I can't chase further tonight.
Jonas Paulsson [Fri, 13 Dec 2019 16:06:28 +0000 (08:06 -0800)]
[SystemZ] Improve verification of MachineOperands.
Now that the machine verifier will check for cases of register/immediate
MachineOperands and their correspondence to the MC instruction descriptor,
this patch adds the operand types to the descriptors where they were
previously missing. All MCOI::OPERAND_UNKNOWN operand types have been handled
to get a known type, except for G_... (global isel) instructions.
Review: Ulrich Weigand
https://reviews.llvm.org/D71494
Steven Wu [Mon, 16 Dec 2019 17:48:00 +0000 (09:48 -0800)]
[llvm-cxxfilt] Correctly demangle COFF import thunk
Summary:
llvm-cxxfilt wasn't correctly demangle COFF import thunk in those two
cases before:
* demangle in split mode (multiple words from commandline)
* the import thunk prefix was added no matter the later part of the
string can be demangled or not
Now llvm-cxxfilt should handle both case correctly.
Reviewers: compnerd, erik.pilkington, jhenderson
Reviewed By: jhenderson
Subscribers: jkorous, dexonsmith, ributzka, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71425
Teresa Johnson [Mon, 4 Nov 2019 21:48:44 +0000 (13:48 -0800)]
[TLI] Support for per-Function TLI that overrides available libfuncs
Summary:
Follow-on to D66428 and D71193, to build the TLI per-function so
that -fno-builtin* handling can be migrated to use function attributes.
See discussion on D61634 for background. This is an enabler for fixing
handling of these options for LTO, for example.
With D71193, the -fno-builtin* flags are converted to function
attributes, so we can now set this information per-function on the TLI.
In this patch, the TLI constructor is changed to take a Function, which
can be used to override the available builtins. The TLI is augmented
with an array that can be used to specify which builtins are not
available for the corresponding function. The available function checks
are changed to consult this override before checking the underlying
module level baseline TLII. New code is added to set this override
array based on the attributes.
I also removed the code that sets availability in the TLII in clang from
the options, which is no longer needed.
I removed a per-Triple caching of TLII objects in the analysis object,
as it is based on the Module's Triple which is the same for all
functions in any case. Is there a case where we would be compiling
multiple Modules with different Triples in one compilation?
Finally, I have changed the legacy analysis wrapper to create and use
the new PM analysis class (TargetLibraryAnalysis) in getTLI. This is
consistent with the behavior of getTTI for the legacy
TargetTransformInfo analysis. This change means that getTLI now creates
a new TLI on each call (although that should be very cheap as we cache
the module level TLII, and computing the per-function
attribute based availability should also be reasonably efficient).
I measured the compile time for a large C++ file with tens of thousands
of functions and as expected there was no increase.
Reviewers: chandlerc, hfinkel, gchatelet
Subscribers: mehdi_amini, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67923
Aaron Ballman [Mon, 16 Dec 2019 16:37:51 +0000 (11:37 -0500)]
Fixing a -Wcovered-switch diagnostic and changing tabs to spaces; NFC.
Sam Elliott [Mon, 16 Dec 2019 16:35:17 +0000 (16:35 +0000)]
[libunwind][RISCV] Add 64-bit RISC-V support
Summary:
Add unwinding support for 64-bit RISC-V.
This is from the FreeBSD implementation with the following minor
changes:
- Renamed and renumbered DWARF registers to match the RISC-V ABI [1]
- Use the ABI mneumonics in getRegisterName() instead of the exact
register names
- Include checks for __riscv_xlen == 64 to facilitate adding the 32-bit
ABI in the future.
[1] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md
Patch by Mitchell Horne (mhorne)
Reviewers: lenary, luismarques, compnerd, phosek
Reviewed By: lenary, luismarques
Subscribers: arichardson, sameer.abuasal, abidh, asb, aprantl, krytarowski, simoncook, kito-cheng, christof, shiva0217, rogfer01, rkruppe, PkmX, psnobl, benna, lenary, s.egerton, luismarques, emaste, cfe-commits
Differential Revision: https://reviews.llvm.org/D68362
David Greene [Mon, 28 Oct 2019 18:21:29 +0000 (13:21 -0500)]
[Bugpoint] Do not create illegal function attribute combos
If a function requires optnone to trigger a crash, it must also have noline,
otherwise it will fail a verifier check.
Differential revision: https://reviews.llvm.org/D69522
JonChesterfield [Mon, 16 Dec 2019 16:16:13 +0000 (16:16 +0000)]
Revert "Revert "[libomptarget] Move resource id functions into target specific code, implement for amdgcn""
Summary:
This reverts commit
dd8a7fcdd73dd63529b81bf9f72c7529dfe99ec3.
Alexey reports undefined symbols for the new inline functions defined in target_impl.h
This does not reproduce for me for nvptx, or amdgcn, under release or debug builds.
I believe the patch is fine, based on:
- the semantics of an inline function in C++ (the cuda INLINE functions end
up as linkonce_odr in IR), which are only legal to drop if they have no uses
- the code generated from a debug build of clang 9 does not show these undef symbols
- the tests pass
- the code is trivial
To progress from here I either need:
- A tie break - someone to play the role of CI in determining whether the patch works
- Alexey to provide sufficient information about his build for me to reproduce the failure
- Alexey to debug why the symbols are disappearing for him and report back
Reviewers: ABataev, jdoerfert, grokos
Subscribers: jvesely, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D71502
Miloš Stojanović [Mon, 16 Dec 2019 16:03:18 +0000 (17:03 +0100)]
[mips] Add an assert in getTargetStreamer()
Check if the TargetStreamer can be accessed.
Differential Revision: https://reviews.llvm.org/D71477
LLVM GN Syncbot [Mon, 16 Dec 2019 16:00:52 +0000 (16:00 +0000)]
gn build: Merge
0add79aec2e
Miloš Stojanović [Mon, 16 Dec 2019 15:49:09 +0000 (16:49 +0100)]
[llvm-exegesis][mips] Add SnippetGeneratorTest unit test
Test latency with explicit register dependency, without and with
forbidden registers.
Differential Revision: https://reviews.llvm.org/D71471
Alexey Bataev [Mon, 16 Dec 2019 15:27:39 +0000 (10:27 -0500)]
[OPENMP50]Add if clause in target teams distribute parallel for simd directive.
According to OpenMP 5.0, if clause can be used in for simd directive. If
condition in the if clause if false, the non-vectorized version of the
loop must be executed.
Erich Keane [Mon, 16 Dec 2019 15:18:18 +0000 (07:18 -0800)]
Fix floating point builtins to not promote float->double
As brought up in D71467, a group of floating point builtins
automatically promoted floats to doubles because they used the variadic
builtin tag to support an overload set. The result is that the
parameters were treated as a variadic pack, which always promots
float->double.
This resulted in the wrong answer being given in cases with certain
values of NaN.
Ulrich Weigand [Mon, 16 Dec 2019 15:09:09 +0000 (16:09 +0100)]
[clang][SystemZ] Add support for -march=native
Handle -march=native in systemz::getSystemZTargetCPU, similar to
how this is done on other platforms. Also change the return type
to std::string instead of const char *.
Sam McCall [Mon, 16 Dec 2019 14:58:03 +0000 (15:58 +0100)]
[clangd] Reapply
b60896fad926 Fall back to selecting token-before-cursor if token-after-cursor fails.
This reverts commit
8f876d5105507f874c0fb86bc779c9853eab3fe2.
Sam McCall [Mon, 16 Dec 2019 14:57:43 +0000 (15:57 +0100)]
Revert "[clangd] Reapply
b60896fad926 Fall back to selecting token-before-cursor if token-after-cursor fails."
This reverts commit
2500a8d5d8813a3e31fc9ba8dd45e211439a1e3d.
Sam McCall [Mon, 16 Dec 2019 14:46:40 +0000 (15:46 +0100)]
[clangd] Reapply
b60896fad926 Fall back to selecting token-before-cursor if token-after-cursor fails.
This reverts commit
f0604e73a4daa35a10eb17a998657d6c4bd0e971
The issue with movability of Tweak::Selection was addressed in
7dc388bd9596bbf42633f8a8e450224e39740b60
Sam McCall [Mon, 16 Dec 2019 14:46:40 +0000 (15:46 +0100)]
[clangd] Make Tweak::Selection movable. NFC
Aaron Ballman [Mon, 16 Dec 2019 14:34:45 +0000 (09:34 -0500)]
Silence an MSVC "not all control paths" diagnostic; NFC.
Dmitri Gribenko [Mon, 16 Dec 2019 14:21:51 +0000 (15:21 +0100)]
Revert "[clangd] Implement "textDocument/documentLink" protocol support"
This reverts commit
d6417f5584aa7673fa0212029a96cc9cacb1aad5. The tests
depend on builtin headers, which is not intentionally supported in
clangd tests; these tests are broken in some build environments.
Guillaume Chatelet [Mon, 16 Dec 2019 14:19:09 +0000 (15:19 +0100)]
Revert "[Alignment][NFC] Deprecate CreateMemCpy/CreateMemMove"
This reverts commit
181ab91efc9fb08dedda10a2fbc5fccb83ce8799.
Nico Weber [Mon, 16 Dec 2019 14:02:41 +0000 (09:02 -0500)]
gn build: (manually, belatedly) merge r358832
Nico Weber [Mon, 16 Dec 2019 14:01:55 +0000 (09:01 -0500)]
gn build: (manually, belatedly) merge r371898
David Tellenbach [Mon, 16 Dec 2019 12:19:54 +0000 (13:19 +0100)]
Reland [AArch64][MachineOutliner] Return address signing for outlined functions
Summary:
Reland after fixing a bug that allowed outlining of SP modifying instructions
that invalidated return address signing.
During AArch64 frame lowering instructions to enable return address
signing are inserted into functions if needed. Functions generated during
machine outlining don't run through target frame lowering and hence are
missing such instructions.
This patch introduces the following changes:
1. If not all functions that potentially participate in function outlining agree
on their return address signing scope and their return address signing key,
outlining is disabled for these functions.
2. If not all functions that potentially participate in function outlining agree
on their support for v8.3A features, outlining is disabled for these
functions.
3. If an outlining candidate would outline instructions that modify sp in a way
that invalidates return address signing, outlining is disabled for that
particular candidate.
4. If all candidate functions agree on the signing scope, signing key and their
support for v8.3 features, the outlined function behaves as if it had the
same scope and key attributes and as if it would provide the same v8.3A
support as the original functions.
Reviewers: ostannard, paquette
Reviewed By: ostannard
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70635
Kristof Beyls [Mon, 16 Dec 2019 13:31:12 +0000 (13:31 +0000)]
find_interesting_reviews.py: adapt to github monorepo
Pavel Labath [Mon, 16 Dec 2019 13:09:09 +0000 (14:09 +0100)]
[lldb] Use file-based synchronization in TestVSCode_attach
The is the best method we have at the moment for attach-style tests.
Guillaume Chatelet [Fri, 13 Dec 2019 15:14:39 +0000 (16:14 +0100)]
[llvm-exegesis] Set up AsmTargetStreamer in readSnippets
Summary: This is a follow up on D71137 properly setting up the AsmTargetStreamer prior to AsmParser::Run call.
Reviewers: courbet, mstojanovic
Subscribers: tschuett, mikhail.ramalho, llvm-commits, petarj, atanasyan
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71468
Guillaume Chatelet [Fri, 13 Dec 2019 16:54:50 +0000 (17:54 +0100)]
[Alignment][NFC] Deprecate CreateMemCpy/CreateMemMove
Summary:
This patch introduces a set of functions to enable deprecation of IRBuilder functions without breaking out of tree clients.
Functions will be deprecated one by one and as in tree code is cleaned up.
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: arsenm, jvesely, nhaehnle, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71473
Andrzej Warzynski [Mon, 16 Dec 2019 12:22:42 +0000 (12:22 +0000)]
[AArch64][SVE2] Add intrinsics for binary narrowing operations
Summary:
The following intrinsics for binary narrowing add and sub operations are
added:
* @llvm.aarch64.sve.addhnb
* @llvm.aarch64.sve.addhnt
* @llvm.aarch64.sve.raddhnb
* @llvm.aarch64.sve.raddhnt
* @llvm.aarch64.sve.subhnb
* @llvm.aarch64.sve.subhnt
* @llvm.aarch64.sve.rsubhnb
* @llvm.aarch64.sve.rsubhnt
Reviewers: sdesmalen, rengolin, efriedma
Reviewed By: sdesmalen, efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71424
Kristof Beyls [Mon, 16 Dec 2019 11:57:05 +0000 (11:57 +0000)]
[AArch64] Enable emission of stack maps for non-Mach-O binaries on AArch64.
The emission of stack maps in AArch64 binaries has been disabled for all
binary formats except Mach-O since rL206610, probably mistakenly, as far
as I can tell. This patch reverts this to its intended state.
Differential Revision: https://reviews.llvm.org/D70069
Patch by Loic Ottet.
Andrzej Warzynski [Mon, 16 Dec 2019 11:51:10 +0000 (11:51 +0000)]
[Aarch64][SVE] Add intrinsics for scatter stores
Summary:
This patch adds the following SVE intrinsics for scatter stores:
* 64-bit offsets:
* @llvm.aarch64.sve.st1.scatter (unscaled)
* @llvm.aarch64.sve.st1.scatter.index (scaled)
* 32-bit unscaled offsets:
* @llvm.aarch64.sve.st1.scatter.uxtw (zero-extended offset)
* @llvm.aarch64.sve.st1.scatter.sxtw (sign-extended-offset)
* 32-bit scaled offsets:
* @llvm.aarch64.sve.st1.scatter.uxtw.index (zero-extended offset)
* @llvm.aarch64.sve.st1.scatter.sxtw.index (sign-extended offset)
* vector base + immediate:
* @llvm.aarch64.sve.st1.scatter.imm
Reviewers: rengolin, efriedma, sdesmalen
Reviewed By: efriedma, sdesmalen
Subscribers: kmclaughlin, eli.friedman, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71074
Raphael Isemann [Mon, 16 Dec 2019 09:06:38 +0000 (10:06 +0100)]
[lldb] Add unit test for ClangASTImporter
Alex Richardson [Fri, 13 Dec 2019 10:25:15 +0000 (10:25 +0000)]
Add initial tests for update_{llc_,cc_,}test_checks.py
Summary:
This commit adds basic tests for these update script to validate that
they still work as expected. In the future we could extend these tests
whenever new features are added to avoid introducing regressions.
Reviewers: xbolva00, MaskRay, jdoerfert
Reviewed By: jdoerfert
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70660
Raphael Isemann [Mon, 16 Dec 2019 10:52:36 +0000 (11:52 +0100)]
[lldb][NFC] Remove all overloads of Copy/DeportType in ClangASTImporter
The overloads that don't take a CompilerType serve no purpose as we
always have a CompilerType in the scope where we call them. Instead
just call the overload that takes a CompilerType and delete the
now unused other overloaded methods.
Pavel Labath [Tue, 10 Dec 2019 13:54:41 +0000 (14:54 +0100)]
[lldb] Centralize desugaring of decltype-like types in ClangASTContext
Summary:
These types were handled in some places, but not others. This resulted
in (for example) not being able to display members of structs whose
types were defined using these constructs.
Using getLocallyUnqualifiedSingleStepDesugaredType for these types is
not fully equivalent, as it will only desugar them if the types are not
instantiation-dependent, whereas previously we did that unconditionally.
It's not clear to me which behavior is correct here, but the test suite
does not seem to care either way.
Reviewers: teemperor, shafik
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71405
Jay Foad [Mon, 16 Dec 2019 10:41:38 +0000 (10:41 +0000)]
Fix whitespace.
Bjorn Pettersson [Fri, 13 Dec 2019 14:53:40 +0000 (15:53 +0100)]
[BasicBlockUtils] Fix dbg.value elimination problem in MergeBlockIntoPredecessor
Summary:
In commit
d60f34c20a2f31335c8d5626e (llvm-svn 317128,
PR35113) MergeBlockIntoPredecessor was changed into
discarding some dbg.value intrinsics referring to
PHI values, post-splice due to loop rotation.
That elimination of dbg.value intrinsics did not
consider which dbg.value to keep depending on the
context (e.g. if the variable is changing its value
several times inside the basic block).
In the past that hasn't been such a big problem since
CodeGenPrepare::placeDbgValues has moved the dbg.value
to be next to the PHI node anyway. But after commit
00e238896cd8ad3a7d7 CodeGenPrepare isn't doing that
any longer, so we need to be more careful when avoiding
duplicate dbg.value intrinsics in MergeBlockIntoPredecessor.
This patch replaces the code that tried to avoid duplicate
dbg.values by using the RemoveRedundantDbgInstrs helper.
Reviewers: aprantl, jmorse, vsk
Reviewed By: aprantl, vsk
Subscribers: jholewinski, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71480
Bjorn Pettersson [Fri, 13 Dec 2019 14:44:29 +0000 (15:44 +0100)]
[LoopRotate] Add test case to show dbg value problem
Summary:
In commit
d60f34c20a2f31335c8d5626e (llvm-svn 317128,
PR35113) MergeBlockIntoPredecessor was changed into
discarding some dbg.value intrinsics referring to
PHI values, post-splice due to loop rotation.
That elimination of dbg.value intrinsics does not
consider which dbg.value to keep based on the context.
Such as always keeping the one that comes first textually,
or the need to keep several of them in case the variable
is changing it's value several times inside the basic block.
In the past that hasn't been such a big problem since
CodeGenPrepare::placeDbgValues has moved the dbg.value
to be next to the PHI node anyway. But after commit
00e238896cd8ad3a7d7 CodeGenPrepare isn't doing that
any longer, so we need to be more careful when avoiding
duplicate dbg.value intrinsics in MergeBlockIntoPredecessor.
This patch is just a pre commit of the test case.
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71479
Bjorn Pettersson [Thu, 12 Dec 2019 19:51:13 +0000 (20:51 +0100)]
[BasicBlockUtils] Add utility to remove redundant dbg.value instrs
Summary:
Add a RemoveRedundantDbgInstrs to BasicBlockUtils with the
goal to remove redundant dbg intrinsics from a basic block.
This can be useful after various transforms, as it might
be simpler to do a filtering of dbg intrinsics after the
transform than during the transform.
One primary use case would be to replace a too aggressive
removal done by MergeBlockIntoPredecessor, seen at loop
rotate (not done in this patch).
The elimination algorithm currently focuses on dbg.value
intrinsics and is doing two iterations over the BB.
First we iterate backward starting at the last instruction
in the BB. Whenever a consecutive sequence of dbg.value
instructions are found we keep the last dbg.value for
each variable found (variable fragments are identified
using the {DILocalVariable, FragmentInfo, inlinedAt}
triple as given by the DebugVariable helper class).
Next we iterate forward starting at the first instruction
in the BB. Whenever we find a dbg.value describing a
DebugVariable (identified by {DILocalVariable, inlinedAt})
we save the {DIValue, DIExpression} that describes that
variables value. But if the variable already was mapped
to the same {DIValue, DIExpression} pair we instead drop
the second dbg.value.
To ease the process of making lit tests for this utility a
new pass is introduced called RedundantDbgInstElimination.
It can be executed by opt using -redundant-dbg-inst-elim.
Reviewers: aprantl, jmorse, vsk
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71478
Jay Foad [Mon, 16 Dec 2019 10:21:54 +0000 (10:21 +0000)]
Fix for AMDGPU MUL_I24 known bits calculation
Summary:
At present, the code calculating known bits of AMDGPU MUL_I24 confuses the concepts of "non-negative number" and "positive number".
In some situations, it results in incorrect code. I have a case where the optimizer replaces the result of calculating MUL_I24(-5, 0) with -8.
Reviewers: foad, arsenm
Reviewed By: arsenm
Subscribers: foad, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Patch by Eugene Kuznetsov.
Differential Revision: https://reviews.llvm.org/D70367
Kirill Bobyrev [Mon, 16 Dec 2019 09:33:56 +0000 (10:33 +0100)]
[NFC] Fix typos in Clangd and Clang
Reviewed by: Jim
Differential Revision: https://reviews.llvm.org/D71455
Raphael Isemann [Mon, 16 Dec 2019 09:37:06 +0000 (10:37 +0100)]
[lldb][NFC] Move definition of ClangASTMetadata out of ClangExternalASTSourceCommon.h
Changing metadata of a ClangASTContext currently requires to include
the unrelated ClangExternalASTSourceCommon.h header because it actually defines
the ClangASTMetadata class.
This also removes the dependency from ClangASTImporter to ClangExternalASTSourceCommon.
Valentin Churavy [Sat, 14 Dec 2019 15:33:30 +0000 (10:33 -0500)]
[CodegenPrepare] Guard against degenerate branches
Summary:
Guard against a potential crash observed in https://github.com/JuliaLang/julia/issues/32994#issuecomment-
524249628
If two branches are collapsed we can encounter a degenerate conditional branch `TBB==FBB`.
The subsequent code assumes that they differ, so we exit out early.
Reviewers: ributzka, spatel
Subscribers: loladiro, dexonsmith, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66657
Sjoerd Meijer [Mon, 16 Dec 2019 09:11:47 +0000 (09:11 +0000)]
[ARM] Move MVE opcode helper functions to ARMBaseInstrInfo. NFC.
In ARMLowOverheadLoops.cpp, MVETailPredication.cpp, and MVEVPTBlock.cpp we have
quite a few helper functions all looking at the opcodes of MVE instructions.
This moves all these utility functions to ARMBaseInstrInfo.
Diferential Revision: https://reviews.llvm.org/D71426
Raphael Isemann [Mon, 16 Dec 2019 08:34:16 +0000 (09:34 +0100)]
[lldb][NFC] Fix file header of TestClangASTContext.cpp
Kadir Cetinkaya [Mon, 16 Dec 2019 08:17:24 +0000 (09:17 +0100)]
[clangd] Get rid of raw string literals in macro calls
Raphael Isemann [Mon, 16 Dec 2019 08:00:58 +0000 (09:00 +0100)]
[lldb][NFC] Remove ClangASTImporter::ResolveDeclOrigin
ResolveDeclOrigin was just an inconvenience method around GetDeclOrigin.
Dmitri Gribenko [Fri, 13 Dec 2019 21:33:53 +0000 (22:33 +0100)]
Fix title underline in LangRef
The docs didn't compile:
http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/38906
Raphael Isemann [Mon, 16 Dec 2019 07:36:25 +0000 (08:36 +0100)]
[lldb][NFC] Remove unnecessary includes in source/Commands
Summary: This removes most of unnecessary includes in the `source/Commands` directory. This was generated by IWYU and a script that fixed all the bogus reports from IWYU. Patch is tested on Linux and macOS.
Reviewers: JDevlieghere
Reviewed By: JDevlieghere
Subscribers: krytarowski, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71489
Raphael Isemann [Mon, 16 Dec 2019 07:16:56 +0000 (08:16 +0100)]
[lldb][NFC] Replace ClangASTImporter's use of map/set with SmallPtrSet and DenseMap
We have several pointer->pointer mappings in the ClangASTImporter implemented using
STL data structures. This moves these variables to the appropriate LLVM data structures
that are intended for mapping pointers.
Richard Smith [Mon, 16 Dec 2019 06:20:06 +0000 (22:20 -0800)]
Mark the major papers for C++20 consistent comparisons as "done", and
start publishing the corresponding feature-test macro.
Richard Smith [Fri, 13 Dec 2019 22:11:04 +0000 (14:11 -0800)]
[c++20] Compute exception specifications for defaulted comparisons.
This requires us to essentially fully form the body of the defaulted
comparison, but from an unevaluated context. Naively this would require
generating the function definition twice; instead, we ensure that the
function body is implicitly defined before performing the check, and
walk the actual body where possible.
Richard Smith [Fri, 13 Dec 2019 22:10:13 +0000 (14:10 -0800)]
Properly compute whether statement expressions can throw, rather than
conservatively assuming they always can.
Also fix cases where we would not consider the computation of a VLA type
when determining whether an expression can throw. We don't yet properly
determine whether a VLA can throw, but no longer incorrectly claim it
can never throw.
Richard Smith [Fri, 13 Dec 2019 22:06:24 +0000 (14:06 -0800)]
Resolve exception specifications after marking the corresponding
function as referenced, not before.
No functionality change intended. This is groundwork for computing the
exception specification of a defaulted comparison, for which we'd like
to use the implicit body where possible.
Fangrui Song [Mon, 16 Dec 2019 05:40:11 +0000 (21:40 -0800)]
[ELF] Delete redundant isLive() check. NFC
Lang Hames [Mon, 16 Dec 2019 04:30:01 +0000 (20:30 -0800)]
[examples] Rename LLJITWithJITLink to LLJITWithCustomObjectLinkingLayer.
LLJIT now uses JITLink/ObjectLinkingLayer by default where available, so
these steps aren't required to use it. The tutorial is still useful though:
Clients can use it to test altervative linking layer implementations (e.g.
handing off to the system linker) or to test implementations of JITLink that
are still under development.
Lang Hames [Mon, 16 Dec 2019 03:51:35 +0000 (19:51 -0800)]
[Orc][LLJIT] Automatically use JITLink for LLJIT on supported platforms.
JITLink (which underlies ObjectLinkingLayer) is a replacement for RuntimeDyld.
It supports the native code model, and linker plugins that enable a wider range
of features than RuntimeDyld.
Currently only enabled for MachO/x86-64 and MachO/arm64. New architectures will
be added as JITLink support for them is developed.
Lang Hames [Mon, 16 Dec 2019 04:24:17 +0000 (20:24 -0800)]
[examples] Update LLJITWithJITLink example for change in
c0143f37dab.
Fangrui Song [Wed, 4 Dec 2019 21:48:19 +0000 (13:48 -0800)]
[llvm-objcopy][ELF] -O binary: use LMA instead of sh_offset to decide where to write section contents
.text sh_address=0x1000 sh_offset=0x1000
.data sh_address=0x3000 sh_offset=0x2000
In an objcopy -O binary output, the distance between two sections equal
their LMA differences (0x3000-0x1000), instead of their sh_offset
differences (0x2000-0x1000). This patch changes our behavior to match
GNU.
This rule gets more complex when the containing PT_LOAD has
p_vaddr!=p_paddr. GNU objcopy essentially computes
sh_offset-p_offset+p_paddr for each candidate section, and removes the
gap before the first address.
Added tests to binary-paddr.test to catch the compatibility problem.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D71035
Seiya Nuta [Mon, 16 Dec 2019 05:05:06 +0000 (14:05 +0900)]
[llvm-objcopy][MachO] Implement --add-section
Reviewers: alexshap, rupprecht, jhenderson
Reviewed By: alexshap, jhenderson
Subscribers: mgorny, jakehehrlich, abrachet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66283
Fangrui Song [Mon, 16 Dec 2019 04:32:08 +0000 (20:32 -0800)]
[MC] Delete STT_SECTION special cases from MCSymbolELF::setType and setBinding
The special cases added by rL293936 were no longer needed after rL296180
disallowed redefinition of section symbols.
Jim Lin [Mon, 16 Dec 2019 02:18:50 +0000 (10:18 +0800)]
[PowerPC] Fix %llvm.ppc.altivec.vc* lowering
Summary:
r372285 changed LLVM to use a `TargetConstant` for parameters of intrinsics that are required to be immediates.
Since that commit, use of `%llvm.ppc.altivec.vc{fsx,fux,tsxs,tuxs}` intrinsics has not worked, and resulted in a `LLVM ERROR: Cannot select: intrinsic %llvm.ppc.altivec.vc*` error. The intrinsics' TableGen definitions matched on `imm` instead of `timm`.
This commit updates those definitions to use `timm`.
Fixes: https://llvm.org/PR44239
Reviewers: hfinkel, nemanjai, #powerpc, Jim
Reviewed By: Jim
Subscribers: qiucf, wuzish, Jim, hiraditya, kbarton, jsji, shchenz, llvm-commits
Tags: #llvm
Patched by vddvss (Colin Samples).
Differential Revision: https://reviews.llvm.org/D71138
Lang Hames [Mon, 16 Dec 2019 01:23:36 +0000 (17:23 -0800)]
[ORC] Make ObjectLinkingLayer own its jitlink::MemoryManager.
This relieves ObjectLinkingLayer clients of the responsibility of holding the
memory manager. This makes it easier to select between RTDyldObjectLinkingLayer
(which already owned its memory manager factory) and ObjectLinkingLayer at
runtime as clients aren't required to hold a jitlink::MemoryManager field just
in case ObjectLinkingLayer is selected.
Fangrui Song [Mon, 16 Dec 2019 00:18:23 +0000 (16:18 -0800)]
[MC] Assume CommentStream is non-null in MCDisassembler::tryAdding*
AArch64/ARM/X86 call the two functions. CommentStream is always
initialized.
Fangrui Song [Mon, 16 Dec 2019 00:03:56 +0000 (16:03 -0800)]
[MC] Ignore VK_WEAKREF in MCValue::getAccessVariant
MCSymbolRefExpr::getVariantKindForName does not return VK_WEAKREF, so this code path is not exercised. Moreoever, .weakref is probably a feature that nobody uses.
Fangrui Song [Sun, 15 Dec 2019 23:39:30 +0000 (15:39 -0800)]
[MC] Delete unused MCAsmInfoELF::UsesNonexecutableStackSection after EM_WEBASSEMBLY was removed in D48744
This removes remnant of D15969 which hasn't been removed by D48744.