Commit Graph

334252 Commits

Author SHA1 Message Date
Fangrui Song 002adabb3a [AArch64][SVE] Change pattern generation code to fix -Wimplicit-fallthrough after D71483 2019-12-16 15:09:05 -08:00
Sam Clegg 0a1e349a79 [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
2019-12-16 14:48:38 -08:00
Brian Gesiak 376cf43729 [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
2019-12-16 17:43:04 -05:00
Alex Langford 3fbe518a10 [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.
2019-12-16 14:31:42 -08:00
Craig Topper 2ff251c6a3 [X86] Add x86 triple to command line in mxcsr-reg-usage.ll
I'm not sure how this hasn't been causing any issues.
2019-12-16 14:18:38 -08:00
Eric Fiselier 0fa118a9da 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
2019-12-16 17:14:02 -05:00
Erich Keane 3f22b4721e Revert "[NFC-I] Remove hack for fp-classification builtins"
This reverts commit b1e542f302.

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
2019-12-16 14:01:51 -08:00
Valentin Churavy 38dd2d5092 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
2019-12-16 16:51:43 -05:00
Danilo Carvalho Grael f933878991 [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
2019-12-16 16:18:34 -05:00
Julian Lettner f9a706a36a [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
2019-12-16 13:10:51 -08:00
John McCall 803403afc8 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.
2019-12-16 16:08:09 -05:00
Erich Keane b1e542f302 [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.
2019-12-16 12:22:55 -08:00
Kit Barton ff07fc66d9 [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
2019-12-16 15:17:29 -05:00
Craig Topper 02f644c59a [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
2019-12-16 12:12:54 -08:00
Thomas Lively 3a93756dfb [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
2019-12-16 11:48:49 -08:00
Nico Weber cc802ea67b 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.
2019-12-16 14:27:54 -05:00
Fangrui Song ee912fe6a1 [ELF] Delete unused declaration addIRelativeRelocs after D65995. NFC 2019-12-16 11:19:22 -08:00
Fangrui Song 90d195d026 [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
2019-12-16 11:10:02 -08:00
Fangrui Song 98afa2c1f1 [ELF] De-template PltSection::addEntry. NFC 2019-12-16 11:03:20 -08:00
Nico Weber 6a71355e52 gn build: (manually) merge c82e4ef69 2019-12-16 13:59:41 -05:00
Alexey Bataev 06a6b0ad65 [OPENMP][DOCS]Claim simd nontemporal clause, NFC. 2019-12-16 13:38:58 -05:00
John McCall b699fe8b95 Forward {read,write}SomeEnumType to {read,write}Enum instead of
directly to {read,write}UInt32.

This will be useful for textual formats.  NFC.
2019-12-16 13:34:00 -05:00
John McCall da74c4d2d8 Use property-based serialization for TemplateArgument. 2019-12-16 13:34:00 -05:00
John McCall 2e2d142efe Add Optional::map. 2019-12-16 13:34:00 -05:00
John McCall a9db0d9f17 Use property-based serialization for TemplateName. 2019-12-16 13:34:00 -05:00
John McCall 6887ccfcf2 Add the ability for properties to be conditional on other properties.
This will be required by TemplateName.
2019-12-16 13:34:00 -05:00
John McCall 256ec99644 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.
2019-12-16 13:34:00 -05:00
John McCall 867570a238 Use property-based serialization for DeclarationName. 2019-12-16 13:33:59 -05:00
John McCall efd0dfbd70 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.
2019-12-16 13:33:59 -05:00
John McCall 41d935f2c6 Replace tabs with spaces. 2019-12-16 13:33:59 -05:00
John McCall 00bc76eddd Move Basic{Reader,Writer} emission into ASTPropsEmitter; NFC.
I'm going to introduce some uses of the property read/write methods.
2019-12-16 13:33:59 -05:00
John McCall c82e4ef696 Always -I clang/include when tblgen'ing in Clang. 2019-12-16 13:33:59 -05:00
Alexey Bataev ec3854e58a [OPENMP][DOCS]Mark if clause on simd done, NFC. 2019-12-16 13:25:58 -05:00
Alexey Bataev 411e81a4e3 [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.
2019-12-16 13:20:57 -05:00
Julian Lettner 00ffa744f9 [lit] max_failures does not need to be stored in LitConfig 2019-12-16 10:08:57 -08:00
Sam McCall 6af1ad20d6 Revert "[clangd] Reapply b60896fad9 Fall back to selecting token-before-cursor if token-after-cursor fails."
This reverts commit a0ff8cd631.
Buildbot failures I can't chase further tonight.
2019-12-16 19:07:49 +01:00
Jonas Paulsson 49f55dda01 [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
2019-12-16 09:51:54 -08:00
Steven Wu 2597135571 [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
2019-12-16 09:50:04 -08:00
Teresa Johnson 878ab6df03 [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
2019-12-16 09:19:30 -08:00
Aaron Ballman 081f736157 Fixing a -Wcovered-switch diagnostic and changing tabs to spaces; NFC. 2019-12-16 11:38:30 -05:00
Sam Elliott ce3d1c6d61 [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
2019-12-16 16:36:56 +00:00
David Greene 055aeb5275 [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
2019-12-16 10:32:35 -06:00
JonChesterfield 69fcc6ecc1 Revert "Revert "[libomptarget] Move resource id functions into target specific code, implement for amdgcn""
Summary:
This reverts commit dd8a7fcdd7.

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
2019-12-16 16:16:14 +00:00
Miloš Stojanović d7efa6b198 [mips] Add an assert in getTargetStreamer()
Check if the TargetStreamer can be accessed.

Differential Revision: https://reviews.llvm.org/D71477
2019-12-16 17:04:55 +01:00
LLVM GN Syncbot d518f1da6d gn build: Merge 0add79aec2 2019-12-16 16:00:52 +00:00
Miloš Stojanović 0add79aec2 [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
2019-12-16 16:50:03 +01:00
Alexey Bataev fd0c91bab1 [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.
2019-12-16 10:33:56 -05:00
Erich Keane f02d6dd6c7 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.
2019-12-16 07:20:29 -08:00
Ulrich Weigand 9f99aba1cf [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 *.
2019-12-16 16:11:32 +01:00
Sam McCall a0ff8cd631 [clangd] Reapply b60896fad9 Fall back to selecting token-before-cursor if token-after-cursor fails.
This reverts commit 8f876d5105.
2019-12-16 15:58:51 +01:00