Commit Graph

362924 Commits

Author SHA1 Message Date
Vang Thao 04bd5b5286 [AMDGPU] Fix not rescheduling without clustering
Regions are sometimes skipped which should be rescheduled without memory op
clustering. RegionIdx is not incremented when iterating over regions that
are flagged to be skipped, causing the index to be incorrect.

Thanks to Vang Thao for discovering this bug!

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D85498
2020-08-07 11:15:58 -07:00
Jonas Devlieghere f1d525734f [lldb] Store the Apple SDK in dotest's configuration.
This patch stores the --apple-sdk argument in the dotest configuration.
When it's set, use it instead of the triple to determine the current
platform.

Differential revision: https://reviews.llvm.org/D85537
2020-08-07 11:13:18 -07:00
Zequan Wu c354b2e3bf [Clang] Add note for bad conversion when expression is pointer to forward-declared type
Differential Revision: https://reviews.llvm.org/D85390
2020-08-07 11:06:08 -07:00
Eduardo Caldas 8abb5fb68f [SyntaxTree] Use simplified grammar rule for `NestedNameSpecifier` grammar nodes
This is our grammar rule for nested-name-specifiers:
globalbal-specifier:
  /*empty*/
simple-template-specifier:
  template_opt simple-template-id
name-specifier:
  global-specifier
  decltype-specifier
  identifier
  simple-template-specifier
nested-name-specifier:
  list(name-specifier, ::, non-empty, terminated)

It is a relaxed version of C++ [expr.prim.id] and quite simpler to map to our API.

TODO: refine name specifiers, `simple-template-name-specifier` and
decltype-name-specifier` are token soup for now.
2020-08-07 18:05:47 +00:00
Jez Ng 25367dfefb [lld-macho] Add .tbd support for frameworks
Required for e.g. linking iOS apps since they don't have a platform-native
SDK

Reviewed By: #lld-macho, compnerd, smeenai

Differential Revision: https://reviews.llvm.org/D85153
2020-08-07 11:04:54 -07:00
Jez Ng ca85e37338 [lld-macho] Support static linking of thread-locals
Note: What ELF refers to as "TLS", Mach-O seems to refer to as "TLV", i.e.
thread-local variables.

This diff implements support for TLV relocations that reference defined
symbols. On x86_64, TLV relocations are always used with movq opcodes, so for
defined TLVs, we don't need to create a synthetic section to store the
addresses of the symbols -- we can just convert the `movq` to a `leaq`.

One notable quirk of Mach-O's TLVs is that absolute-address relocations
inside TLV-defining sections behave differently -- their addresses are
no longer absolute, but relative to the start of the target section.
(AFAICT, RIP-relative relocations are not allowed in these sections.)

Reviewed By: #lld-macho, compnerd, smeenai

Differential Revision: https://reviews.llvm.org/D85080
2020-08-07 11:04:52 -07:00
Jez Ng 4e43f18048 [lld-macho] Ensure .tbss sections are also considered as ZeroFilled
This diff makes the behavior in {D80859} and {D81888} apply to
thread-local ZeroFill sections too. I realized this was necessary whie
trying to implement thread-local variables.

Reviewed By: #lld-macho, compnerd, MaskRay

Differential Revision: https://reviews.llvm.org/D85079
2020-08-07 11:04:41 -07:00
Yuanfang Chen 911565d108 [NewPM][CodeGen] Introduce machine pass and machine pass manager
machine pass could define four methods:
- `PreservedAnalyses run(MachineFunction &, MachineFunctionAnalysisManager &)`
- `Error doInitialization(Module &, MachineFunctionAnalysisManager &)`
- `Error doFinalization(Module &, MachineFunctionAnalysisManager &)`
- `Error run(Module &, MachineFunctionAnalysisManager &)`

machine pass manger:
- MachineFunctionAnalysisManager:
  Basically an AnalysisManager<MachineFunction> augmented with the ability to
  register and query IR analyses
- MachineFunctionPassManager: support only two methods, `addPass` and `run`

Reviewed By: arsenm, asbirlea, aeubanks

Differential Revision: https://reviews.llvm.org/D67687
2020-08-07 11:00:31 -07:00
Yuanfang Chen 954bd9c861 [NewPM] Only verify loop for nonskipped user loop pass
No verification for pass mangers since it is not needed.
No verification for skipped loop pass since the asserted condition is not used.

Add a BeforeNonSkippedPass callback for this. The callback needs more
inputs than its parameters to work so the callback is added on-the-fly.

Reviewed By: aeubanks, asbirlea

Differential Revision: https://reviews.llvm.org/D84977
2020-08-07 11:00:31 -07:00
Mitch Phillips 382df1c674 Revert "Reland D64327 [MC][ELF] Allow STT_SECTION referencing SHF_MERGE on REL targets"
This reverts commit b497665d98.

Spent some time trying to reproduce this locally, reverting in a
desparate attempt to fix the sanitizer buildbot:
 - http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/28828

I don't know exactly why or how this patch breaks the bots, but it seems
pretty concrete that it's the culprit.
2020-08-07 10:56:33 -07:00
Yaxun (Sam) Liu ac3e720dc1 Make clang HIP headers compatible with C++98
Automation to detect compiler features, such as CMake's target_compile_features,
would attempt to detect compiler features by explicitly using langugage flags.
This change ensures that the HIP headers would still work with C++98.

Patch by Siu Chi Chan

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

Change-Id: I304e964b18a525b0fde55efd841da74b6c4dc8ed
2020-08-07 13:50:22 -04:00
Artem Dergachev 47cadd6106 [analyzer] pr47030: MoveChecker: Unforget a comma in the suppression list. 2020-08-07 10:39:28 -07:00
Tim Keith cf03bcf929 [flang] Remove extra CMAKE_CXX_FLAGS in Lower and Optimizer
`-Wno-error` and `-Wno-unused-parameter` appear to no longer be needed
for Lower and Optimizer.

Differential Revision: https://reviews.llvm.org/D85465
2020-08-07 10:21:54 -07:00
Tyker 7d0f69118e [NFC] Add utility to sum/merge stats files
Add a small script to sum *.stats file given as input and output the totals
usage example:
    merge-stats.py $(find ./builddir/ -name "*.stats") > total.stats

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D83505
2020-08-07 19:02:42 +02:00
aartbik c3c95b9c80 [mlir] [VectorOps] Improve lowering of extract_strided_slice (and friends like shape_cast)
Using a shuffle for the last recursive step in progressive lowering not only
results in much more compact IR, but also more efficient code (since the
backend is no longer confused on subvector aliasing for longer vectors).

E.g. the following

  %f = vector.shape_cast %v0: vector<1024xf32> to vector<32x32xf32>

yields much better x86-64 code that runs 3x faster than the original.

Reviewed By: bkramer, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D85482
2020-08-07 09:21:05 -07:00
David Green 25e38c3f3c [ARM] Extra reduction plus tailpredication tests. NFC 2020-08-07 17:16:56 +01:00
Amy Kwan 98eccec3ae [PowerPC] Add Vector Extract/Expand/Count with Mask, Move to VSR Mask Instruction Definitions and MC Tests
This patch adds the instruction definitions and assembly/disassembly tests for
the following set of instructions:

Vector Extract [byte | half | word | doubleword | quad] with mask
Vector Expand [byte | half | word | doubleword | quad] with mask
Move to VSR [byte | byte immediate | half | word | doubleword | quad] with mask
Vector Count Mask Bits [byte | half | word | doubleword]

Differential Revision: https://reviews.llvm.org/D83724
2020-08-07 11:02:08 -05:00
Mehdi Amini 575b22b5d1 Revisit Dialect registration: require and store a TypeID on dialects
This patch moves the registration to a method in the MLIRContext: getOrCreateDialect<ConcreteDialect>()

This method requires dialect to provide a static getDialectNamespace()
and store a TypeID on the Dialect itself, which allows to lazyily
create a dialect when not yet loaded in the context.
As a side effect, it means that duplicated registration of the same
dialect is not an issue anymore.

To limit the boilerplate, TableGen dialect generation is modified to
emit the constructor entirely and invoke separately a "init()" method
that the user implements.

Differential Revision: https://reviews.llvm.org/D85495
2020-08-07 15:57:08 +00:00
Kamau Bridgeman d8c6d083c9 [PowerPC][PCRelative] Set TLS unsupported with PC relative memops
Introduce a fatal error if any thread local storage code is compiled
using pc relative memory operations as well as a hidden override
option `-enable-ppc-pcrel-tls` so that this support can be incrementally
added if possible.

Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D85448
2020-08-07 10:56:24 -05:00
Alexey Bataev 4a7aedb843 [OPENMP]Simplify representation for atomic, critical, master and section
constrcut.

Several constructs may be represented wityout relying on CapturedStmt.
It saves memory and improves compilation speed.
2020-08-07 09:58:23 -04:00
Victor Huang 6c64f05b90 [PowerPC] Add compatibility check for PPC PLT stubs
Compatibility checks for PPC64PltCallStub and PPC64PCRelPLTStub are
added in this patch to prevent the usage of incompatible thunk/stub.

Reviewed By: sfertile, nemanjai, stefanp

Differential Revision: https://reviews.llvm.org/D85459
2020-08-07 13:45:18 +00:00
Jay Foad ffe1edfc53 [NFC][GVN] Fix "avaliable" typos
Differential Revision: https://reviews.llvm.org/D85520
2020-08-07 14:22:24 +01:00
Bevin Hansson aa0d19a0c8 [Fixed Point] Add fixed-point shift operations and consteval.
Reviewers: rjmccall, leonardchan, bjope

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83212
2020-08-07 15:09:24 +02:00
Bevin Hansson 5de6c56f7e [Intrinsic] Add sshl.sat/ushl.sat, saturated shift intrinsics.
Summary:
This patch adds two intrinsics, llvm.sshl.sat and llvm.ushl.sat,
which perform signed and unsigned saturating left shift,
respectively.

These are useful for implementing the Embedded-C fixed point
support in Clang, originally discussed in
http://lists.llvm.org/pipermail/llvm-dev/2018-August/125433.html
and
http://lists.llvm.org/pipermail/cfe-dev/2018-May/058019.html

Reviewers: leonardchan, craig.topper, bjope, jdoerfert

Subscribers: hiraditya, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83216
2020-08-07 15:09:24 +02:00
Bevin Hansson 177735aac7 [LangRef] Minor fixes to intrinsic headers and descriptions. NFC. 2020-08-07 15:09:24 +02:00
Haojian Wu 90d1c66c7c [clangd] Fix a typo, NFC. 2020-08-07 15:02:06 +02:00
Vince Bridgers 351aac0985 [Sema] Add casting check for fixed to fixed point conversions
This change squelches the warning for a cast from fixed to fixed point
conversions when -Wbad-function-cast is enabled.

Fixes:

cast from function call of type '_Fract' to non-matching type '_Fract'
[-Wbad-function-cast]

Reviewed By: bjope

Differential Revision: https://reviews.llvm.org/D85157
2020-08-07 07:58:53 -05:00
Xing GUO 100e1f911c [macho2yaml] Remove unused functions. NFC.
dumpDebugStrings() and dumpDebugAbbrev() are no longer used in
macho2yaml. This patch helps remove them.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D85496
2020-08-07 20:34:15 +08:00
Alexander Belyaev 9c94908320 BEGIN_PUBLIC
[mlir] Add support for unranked case for `tensor_store` and `tensor_load` ops.
END_PUBLIC

Differential Revision: https://reviews.llvm.org/D85518
2020-08-07 14:32:52 +02:00
Alex Zinenko 87a89e0f77 [mlir] Remove llvm::LLVMContext and llvm::Module from mlir::LLVMDialectImpl
Original modeling of LLVM IR types in the MLIR LLVM dialect had been wrapping
LLVM IR types and therefore required the LLVMContext in which they were created
to outlive them, which was solved by placing the LLVMContext inside the dialect
and thus having the lifetime of MLIRContext. This has led to numerous issues
caused by the lack of thread-safety of LLVMContext and the need to re-create
LLVM IR modules, obtained by translating from MLIR, in different LLVM contexts
to enable parallel compilation. Similarly, llvm::Module had been introduced to
keep track of identified structure types that could not be modeled properly.

A recent series of commits changed the modeling of LLVM IR types in the MLIR
LLVM dialect so that it no longer wraps LLVM IR types and has no dependence on
LLVMContext and changed the ownership model of the translated LLVM IR modules.
Remove LLVMContext and LLVM modules from the implementation of MLIR LLVM
dialect and clean up the remaining uses.

The only part of LLVM IR that remains necessary for the LLVM dialect is the
data layout. It should be moved from the dialect level to the module level and
replaced with an MLIR-based representation to remove the dependency of the
LLVMDialect on LLVM IR library.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D85445
2020-08-07 14:30:31 +02:00
Alex Zinenko 16b0225377 [mlir] do not require LLVMDialect in conversion from LLVM IR
Historically, LLVMDialect has been required in the conversion from LLVM IR in
order to be able to construct types. This is no longer necessary with the new
type model and the dialect can be replaced with a local LLVM context.

Reviewed By: rriddle, mehdi_amini

Differential Revision: https://reviews.llvm.org/D85444
2020-08-07 14:27:04 +02:00
Alex Zinenko db1c197bf8 [mlir] take LLVMContext in MLIR-to-LLVM-IR translation
Due to the original type system implementation, LLVMDialect in MLIR contains an
LLVMContext in which the relevant objects (types, metadata) are created. When
an MLIR module using the LLVM dialect (and related intrinsic-based dialects
NVVM, ROCDL, AVX512) is converted to LLVM IR, it could only live in the
LLVMContext owned by the dialect. The type system no longer relies on the
LLVMContext, so this limitation can be removed. Instead, translation functions
now take a reference to an LLVMContext in which the LLVM IR module should be
constructed. The caller of the translation functions is responsible for
ensuring the same LLVMContext is not used concurrently as the translation no
longer uses a dialect-wide context lock.

As an additional bonus, this change removes the need to recreate the LLVM IR
module in a different LLVMContext through printing and parsing back, decreasing
the compilation overhead in JIT and GPU-kernel-to-blob passes.

Reviewed By: rriddle, mehdi_amini

Differential Revision: https://reviews.llvm.org/D85443
2020-08-07 14:22:30 +02:00
Simon Pilgrim 66a163f328 [DAG] GetDemandedBits - remove custom AND handling.
As mentioned on D85463, we should be using SimplifyMultipleUseDemandedBits (which is the default fallback).

The minor regression in illegal-bitfield-loadstore.ll will be addressed properly by D77804.
2020-08-07 12:55:47 +01:00
Simon Pilgrim fcefb53222 Remove unreachable break. NFC 2020-08-07 12:37:49 +01:00
Simon Pilgrim 18212cbcda Remove duplicate/unreachable break (PR47029) 2020-08-07 11:48:48 +01:00
Simon Pilgrim f35992b75b [SLP][X86] Add smax intrinsic reduction tests
SLP currently only matches the ICMP+SELECT patterns for min/max reductions
2020-08-07 11:48:08 +01:00
Simon Pilgrim ffd258f7bb Remove unreachable return (PR47028) 2020-08-07 11:33:23 +01:00
Simon Tatham 1d78294250 [Sema][BFloat] Forbid arithmetic on vectors of bfloat.
Vectors of bfloat are a storage format only; you're supposed to
explicitly convert them to a wider type to do arithmetic on them.
But currently, if you write something like

  bfloat16x4_t test(bfloat16x4_t a, bfloat16x4_t b) { return a + b; }

then the clang frontend accepts it without error, and (ARM or AArch64)
isel fails to generate code for it.

Added a rule in Sema that forbids the attempt from even being made,
and tests that check it. In particular, we also outlaw arithmetic
between vectors of bfloat and any other vector type.

Patch by Luke Cheeseman.

Reviewed By: LukeGeeson

Differential Revision: https://reviews.llvm.org/D85009
2020-08-07 11:25:19 +01:00
Simon Pilgrim 24cca30f7f Remove unreachable return (PR47026) 2020-08-07 11:23:43 +01:00
Simon Pilgrim aa38e97ad5 [SLP][X86] Add abs/smax/smin/umax/umin intrinsic vectorization tests 2020-08-07 11:23:43 +01:00
QingShan Zhang 1ffb468369 [NFC][Test] Format the test with script update_llc_test_checks.py 2020-08-07 10:22:38 +00:00
Nicolas Vasilache 3f906c54a2 [mlir][Vector] Add 2-D vector contract lowering to ReduceOp
This new pattern mixes vector.transpose and direct lowering to vector.reduce.
This allows more progressive lowering than immediately going to insert/extract and
composes more nicely with other canonicalizations.
This has 2 use cases:
1. for very wide vectors the generated IR may be much smaller
2. when we have a custom lowering for transpose ops we can target it directly
rather than rely LLVM

Differential Revision: https://reviews.llvm.org/D85428
2020-08-07 06:17:48 -04:00
Max Kazantsev da9e7b1ab0 [Test] Added test showing missing range check elimination opportunity in IndVars
Seems that SCEV is not powerful enough to handle this.
2020-08-07 16:47:25 +07:00
Oliver Stannard be8b3f0c22 [AArch64] Disable waitid.cpp test for AArch64
This test is failing intermittently on the AArch64 build bots, disable
it for now to keep the bots green while we investigate it.
2020-08-07 10:42:15 +01:00
Haojian Wu a70161808b [clangd] Include the underlying decls in go-to-definition.
Fixes https://github.com/clangd/clangd/issues/277

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D74054
2020-08-07 11:39:49 +02:00
Nathan James 01bc708126 [NFC] Replace hasName in loop for hasAnyName 2020-08-07 10:22:45 +01:00
Kazushi (Jam) Marukawa 63bc5d7863 [VE] Change to expand multiply related instructions
Change to expand MULHU/MULHS/UMUL_LOHI/SMUL_LOHI for i32 and i64 since
those instructions are not available on Aurora SX VE.  Some of them
are used in expansion of i128 multiply, so need to modify them to
support i128.  Then, update basic arithmetic regression tests of
i128 and signed/unsigned i32 typed integer values.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D85490
2020-08-07 18:22:25 +09:00
Kazushi (Jam) Marukawa 3ac1eb6358 [VE] Remove obsoleted getVEAsmModeForCPU function
Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D85507
2020-08-07 18:20:34 +09:00
Haojian Wu 67174765db [AST][RecoveryExpr] Fix the missing type when rebuilding RecoveryExpr in TreeTransform.
Differential Revision: https://reviews.llvm.org/D85423
2020-08-07 11:15:19 +02:00
Igor Kudrin 1eade73d8b [DebugInfo] Remove DwarfUnit::getDwarfVersion(). NFC.
This helper method was used only in one place, which can easily use the
direct call.

Differential revision: https://reviews.llvm.org/D85438
2020-08-07 15:55:44 +07:00