Evandro Menezes [Thu, 17 Sep 2020 23:20:50 +0000 (18:20 -0500)]
[RISCV] Merge the pipeline models for Rocket
Merge the 32 and 64 bit pipeline models for Rocket into a single file.
Differential Revision: https://reviews.llvm.org/D87873
Snehasish Kumar [Thu, 17 Sep 2020 04:40:00 +0000 (21:40 -0700)]
[llvm] Add -bbsections-cold-text-prefix to emit cold clusters to a different section.
This change adds an option to basic block sections to allow cold
clusters to be assigned a custom text prefix. With a custom prefix such
as ".text.split." (D87840), lld can place them in a separate output section.
The benefits are -
* Empirically shown to improve icache and itlb metrics by 3-5%
(absolute) compared to placing split parts in .text.unlikely.
* Mitigates against poor profiles, eg samplePGO profiles used with the
machine function splitter. Optimizations such as hugepage remapping can
make different decisions at the section granularity.
* Enables section granularity hotness monitoring (checking on the
decisions made during compilation vs sample data from production).
Differential Revision: https://reviews.llvm.org/D87813
Joseph Huber [Thu, 24 Sep 2020 16:49:58 +0000 (12:49 -0400)]
[OpenMP] OpenMPOpt Support for Globalization Remarks
Summary:
This patch add support for printing analysis messages relating to data
globalization on the GPU. This occurs when data is shared between the
threads in a GPU context and must be pushed to global or shared memory.
Reviewers: jdoerfert
Subscribers: guansong hiraditya llvm-commits ormris sstefan1 yaxunl
Tags: #OpenMP #LLVM
Differential Revision: https://reviews.llvm.org/D88243
Bill Wendling [Thu, 24 Sep 2020 22:20:47 +0000 (15:20 -0700)]
Fix regex in test.
Snehasish Kumar [Thu, 17 Sep 2020 17:04:03 +0000 (10:04 -0700)]
[lld] Make -z keep-text-section-prefix recognize .text.split. as a prefix.
".text.split." holds symbols which are split out from functions in
other input sections. For example, with -fsplit-machine-functions,
placing the cold parts in .text.split instead of .text.unlikely mitigates
against poor profile inaccuracy. Techniques such as hugepage remapping can
make conservative decisions at the section granularity.
Differential Revision: https://reviews.llvm.org/D87840
Jez Ng [Thu, 24 Sep 2020 22:00:56 +0000 (15:00 -0700)]
[lld-macho][re-land] Implement and test resolution of common symbols
Earlier build break fixed in
c32e69b2ce7abfb151a87ba363ac9e25abf7d417.
This reverts commit
c367f93e8539c4d0bcdc86ad7ea7923e06231a93.
Jez Ng [Thu, 24 Sep 2020 21:44:14 +0000 (14:44 -0700)]
[lld-macho][re-land] Initial support for common symbols
Fix earlier build break via a static_cast.
This reverts commit
8112d494d344dc0935d5c078f066a43d7c984e0c.
Differential Revision: https://reviews.llvm.org/D86909
Vedant Kumar [Tue, 8 Sep 2020 20:39:52 +0000 (13:39 -0700)]
[Instruction] Add dropLocation and updateLocationAfterHoist helpers
Introduce a helper which can be used to update the debug location of an
Instruction after the instruction is hoisted. This can be used to safely
drop a source location as recommended by the docs.
For more context, see the discussion in https://reviews.llvm.org/D60913.
Differential Revision: https://reviews.llvm.org/D85670
Thomas Lively [Thu, 24 Sep 2020 21:56:19 +0000 (14:56 -0700)]
[WebAssembly] Make SjLj lowering globals thread-local
Emscripten's longjump and exception mechanism depends on two global variables,
`__THREW__` and `__threwValue`, which are changed to be defined as thread-local
in https://github.com/emscripten-core/emscripten/pull/12056. This patch updates
the corresponding code in the WebAssembly backend to properly declare these
globals as thread-local as well.
Differential Revision: https://reviews.llvm.org/D88262
shafik [Thu, 24 Sep 2020 21:31:31 +0000 (14:31 -0700)]
[LLDB] Add a defensive check for member__f_
I only have a crash log and was not able to come up with a test case for this.
rdar://problem/
69403150
Amy Huang [Wed, 16 Sep 2020 16:58:39 +0000 (09:58 -0700)]
[DebugInfo] Fix bug in constructor homing with classes with trivial
constructors.
This changes the code to avoid using constructor homing for aggregate
classes and classes with trivial default constructors, instead of trying
to loop through the constructors.
Differential Revision: https://reviews.llvm.org/D87808
Sriraman Tallam [Thu, 24 Sep 2020 21:37:56 +0000 (14:37 -0700)]
Temporary fix for D85085 debug_loc bug with basic block sections.
Until then, this one line fix removes the assert fail with basic block sections
with debug info. Bug tracking this: #47549
This fix does not generate loc list or DW_AT_const_value if the argument is
mentioned in a different section than the start of the function.
Temporarily fixes bugzilla : https://bugs.llvm.org/show_bug.cgi?id=47549
Differential Revision: https://reviews.llvm.org/D87787
Zequan Wu [Wed, 23 Sep 2020 23:58:57 +0000 (16:58 -0700)]
Reland [CodeGen] emit CG profile for COFF object file
This reverts commit
90242caca2074dab5a9b76e5bc36d9fafd2179a7.
Error fixed at
f5435399e823746bbe1737b95c853d77a42e1ac3
Differential Revision: https://reviews.llvm.org/D87811
Roman Lebedev [Thu, 24 Sep 2020 21:30:54 +0000 (00:30 +0300)]
[NFCI][IR] ConstantRangeTest: add basic scaffolding for next-gen precision/correctness testing
I have long complained that while we have exhaustive tests
for ConstantRange, they are, uh, not good.
The approach of groking our own constant range
via exhaustive enumeration is, mysterious.
It neither tells us without doubt that the result is
conservatively correct, nor the precise match to the ConstantRange
result tells us that the result is precise.
But yeah, it's fast, i give it that.
In short, there are three things that we need to check:
1. That ConstantRange result is conservatively correct
2. That ConstantRange range is reasonable
3. That ConstantRange result is reasonably precise
So let's not just check the middle one, but all three.
This provides precision test coverage for D88178.
Roman Lebedev [Thu, 24 Sep 2020 14:13:09 +0000 (17:13 +0300)]
[NFCI][IR] ConstantRangeTest: refactor operation range gatherers
We do the same dance to acquire the "exact" range of an op via
an exhaustive approach in many places.
Let's not invent the wheel each time.
Bill Wendling [Thu, 24 Sep 2020 21:35:15 +0000 (14:35 -0700)]
Revert "[CodeGen] Postprocess PHI nodes for callbr"
Accidental commit.
This reverts commit
7f4c940bd0b526f25e11c51bb4d58a85024330ae.
Bill Wendling [Thu, 24 Sep 2020 21:34:08 +0000 (14:34 -0700)]
Fix testcase.
Bill Wendling [Thu, 20 Aug 2020 02:51:20 +0000 (19:51 -0700)]
[CodeGen] Postprocess PHI nodes for callbr
When processing PHI nodes after a callbr, we need to make sure that the
PHI nodes on the default branch are resolved after the callbr
(inserted after INLINEASM_BR). The PHI node values on the indirect
branches are processed before the INLINEASM_BR.
Differential Revision: https://reviews.llvm.org/D86260
Artem Belevich [Thu, 24 Sep 2020 17:47:45 +0000 (10:47 -0700)]
[CUDA] Added conversion functions to builtin vars.
This is needed to compile some headers in CUDA-11 that assume that threadIdx is
implicitly convertible to dim3. With NVCC, threadIdx is uint3 and there's
dim3(uint3) constructor. Clang uses a special type for the builtin variables, so
that path does not work. Instead, this patch adds conversion function to the
builtin variable classes. that will allow them to be converted to dim3 and uint3.
Differential Revision: https://reviews.llvm.org/D88250
Daniel Kiss [Thu, 24 Sep 2020 18:24:12 +0000 (20:24 +0200)]
[AArch64] __builtin_return_address for PAuth.
This change adds the support for __builtin_return_address
for ARMv8.3A Pointer Authentication.
Location of the authentication code in the pointer depends on
the system configuration, therefore a dedicated instruction is used for
effectively removing the authentication code without
authenticating the pointer.
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D75044
Diego Caballero [Thu, 24 Sep 2020 19:29:56 +0000 (12:29 -0700)]
[mlir][NFC] Promote memory space to BaseMemRefType
This patch moves the memory space field from MemRefType and UnrankedMemRefType
to their base class BaseMemRefType so that it can be retrieved from it without
downcasting it to the specific memref.
Reviewed By: silvas
Differential Revision: https://reviews.llvm.org/D87649
Bill Wendling [Thu, 24 Sep 2020 02:09:10 +0000 (19:09 -0700)]
Remove stale assert.
This is triggered during serialization. The test is for modules, but
will occur for any serialization effort using asm goto.
Reviewed By: nickdesaulniers, jyknight
Differential Revision: https://reviews.llvm.org/D88195
Sam McCall [Thu, 24 Sep 2020 12:26:11 +0000 (14:26 +0200)]
[AST] Use data-recursion when building ParentMap, avoid stack overflow.
The following crashes on my system before this patch, but not after:
void foo(int i) {
switch (i) {
case 1:
case 2:
... 100000 cases ...
;
}
}
clang-query -c="match stmt(hasAncestor(stmt()))" deep.c
I'm not sure it's actually a sane testcase to run though, it's pretty slow :-)
Differential Revision: https://reviews.llvm.org/D88222
David Tenty [Fri, 4 Sep 2020 20:44:40 +0000 (16:44 -0400)]
[CMake][AIX] Set LLVM_ENABLE_PER_TARGET_RUNTIME_DIR appropriately for AIX
AIX by default usually folds 32-bit & 64-bit arch libraries into a single
archive, a behaviour we may want for the runtime libraries in the future,
so we don't necessarily want to opt into the multlib layout introduce in
D45604, which is currently the default for runtime builds.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D88169
Alexey Bataev [Thu, 24 Sep 2020 18:46:06 +0000 (14:46 -0400)]
[OPENMP]Fix PR47621: Variable used by task inside a template function is not made firstprivate by default
Need to fix a check for the variable if it is declared in the inner
OpenMP region to be able to firstprivatize it.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D88240
Andrzej Warzynski [Thu, 24 Sep 2020 19:57:46 +0000 (20:57 +0100)]
[flang][driver] Add missing dependency (shared library builds, NFC)
`flang-new` depends on libclangFrontend (it uses DiagnosticConsumer
classes from there). This patch adds the missing dependency in CMake.
clang::TextDiagnosticBuffer is only reported as missing when compiling
`flang-new` with BUILD_SHARED_LIBS=ON. This symbol is linked in
statically with libflangFrontend when BUILD_SHARED_LIBS=OFF.
Erich Keane [Thu, 24 Sep 2020 20:04:36 +0000 (13:04 -0700)]
Remove dead branch identified by @rsmith on post-commit for D88236
Andrew Litteken [Thu, 17 Sep 2020 21:29:43 +0000 (16:29 -0500)]
[IRSim] Adding wrapper pass for IRSimilarityIdentfier
This introduces an analysis pass that wraps IRSimilarityIdentifier,
and adds a printer pass to examine in what function similarities are
being found.
Test for what the printer pass can find are in
test/Analysis/IRSimilarityIdentifier.
Reviewed by: paquette, jroelofs
Differential Revision: https://reviews.llvm.org/D86973
Matt Arsenault [Thu, 24 Sep 2020 19:36:42 +0000 (15:36 -0400)]
AArch64/GlobalISel: Add testcase for bug 47619
This is asserting on the 11 release branch, and wasn't covered by
exisiting tests at the time. This was fixed by
b98f902f1877c3d679f77645a267edc89ffcd5d6.
Volodymyr Sapsai [Thu, 24 Sep 2020 19:36:06 +0000 (12:36 -0700)]
Revert "[Modules] Add stats to measure performance of building and loading modules."
This reverts commit
c4bacc3c9b333bb7032fb96f41d6f5b851623132.
Test "LLVM :: ThinLTO/X86/funcimport-stats.ll" is failing. Reverting now
and will recommit after making the test not fail with the added stats.
Sanjay Patel [Thu, 24 Sep 2020 19:11:27 +0000 (15:11 -0400)]
[SLP] clean up - use 'const' and ArrayRef constructor; NFC
Follow-on tidying suggested in the post-commit review of 6a23668.
Mircea Trofin [Thu, 24 Sep 2020 03:10:42 +0000 (20:10 -0700)]
[NFC][regalloc] Remove unused API in AllocationOrder
Differential Revision: https://reviews.llvm.org/D88197
Sean Silva [Fri, 18 Sep 2020 20:55:52 +0000 (13:55 -0700)]
[mlir][shape] Start a pass that lowers shape constraints.
This pass converts shape.cstr_* ops to eager (side-effecting)
error-handling code. After that conversion is done, the witnesses are
trivially satisfied and are replaced with `shape.const_witness true`.
Differential Revision: https://reviews.llvm.org/D87941
Volodymyr Sapsai [Mon, 6 Jan 2020 19:55:55 +0000 (11:55 -0800)]
[Modules] Add stats to measure performance of building and loading modules.
Measure amount of high-level or fixed-cost operations performed during
building/loading modules and during header search. High-level operations
like building a module or processing a .pcm file are motivated by
previous issues where clang was re-building modules or re-reading .pcm
files unnecessarily. Fixed-cost operations like `stat` calls are tracked
because clang cannot change how long each operation takes but it can
perform fewer of such operations to improve the compile time.
Also tracking such stats over time can help us detect compile-time
regressions. Added stats are more stable than the actual measured
compilation time, so expect the detected regressions to be less noisy.
rdar://problem/
55715134
Reviewed By: aprantl, bruno
Differential Revision: https://reviews.llvm.org/D86895
Matt Arsenault [Tue, 28 Jul 2020 14:15:42 +0000 (10:15 -0400)]
GlobalISel: Use unmerge when copying wide vectors to result registers
Avoid using G_EXTRACT and move towards a more consistent vector
legalization strategy.
Mehdi Amini [Thu, 24 Sep 2020 19:13:51 +0000 (19:13 +0000)]
Add support for setting the path to llvm-symbolizer through an environment variable
This allows to point to an executable that isn't named exactly
"llvm-symbolizer" and not necessarily in the current PATH.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D88192
Erich Keane [Thu, 24 Sep 2020 15:52:54 +0000 (08:52 -0700)]
[PR47636] Fix tryEmitPrivate to handle non-constantarraytypes
As mentioned in the bug report, tryEmitPrivate chokes on the
MaterializeTemporaryExpr in the reproducers, since it assumes that if
there are elements, than it must be a ConstantArrayType. However, the
MaterializeTemporaryExpr (which matches exactly the AST when it is NOT a
global/static) has an incomplete array type.
This changes the section where the number-of-elements is non-zero to
properly handle non-CAT types by just extracting it as an array type
(since all we needed was the element type out of it).
Alexandre Ganea [Thu, 24 Sep 2020 19:00:43 +0000 (15:00 -0400)]
[LLD][COFF] Cover usage of LLD-as-a-library in tests
In lit tests, we run each LLD invocation twice (LLD_IN_TEST=2), without shutting down the process in-between. This ensures a full cleanup is properly done between runs.
Only active for the COFF driver for now. Other drivers still use LLD_IN_TEST=1 which executes just one iteration with full cleanup, like before.
When the environment variable LLD_IN_TEST is unset, a shortcut is taken, only one iteration is executed, no cleanup for faster exit, like before.
A public API, lld::safeLldMain(), is also available when using LLD as a library.
Differential Revision: https://reviews.llvm.org/D70378
Alexandre Ganea [Thu, 24 Sep 2020 17:12:55 +0000 (13:12 -0400)]
[LLD][COFF] Avoid overwriting inputs in tests
Before this patch, these two tests were emitting both a .DLL and .LIB. The output .LIB file name also happens to be an input .LIB file name. This prevented the test from executing a second time when LLD is re-entrant (LLD_IN_TEST=2).
This is a support patch for https://reviews.llvm.org/D70378.
Saleem Abdulrasool [Thu, 24 Sep 2020 18:50:11 +0000 (18:50 +0000)]
Basic: add an extra newline for sphinx (NFC)
This should resolve the "Bullet list ends without a blank line" warning.
Alexey Bataev [Thu, 24 Sep 2020 18:41:14 +0000 (14:41 -0400)]
Revert "[OPENMP]Fix PR47621: Variable used by task inside a template function is not made firstprivate by default"
This reverts commit
d1419c9fdab141617b6aa9f028191b9bfc8be260 to fix the
buffer overflow detected by address sanitiizer.
Jinsong Ji [Thu, 24 Sep 2020 18:20:57 +0000 (18:20 +0000)]
[llvm-exegesis] Add whitespace between words in error message
Reid Kleckner [Thu, 24 Sep 2020 18:14:05 +0000 (11:14 -0700)]
Revert "Recommit [NFC] Refactor DiagnosticBuilder and PartialDiagnostic"
This reverts commit
8e780a1653e6f87755a447e921b8f929d8b70996.
DiagnosticBuilder is a value type, created on the stack everywhere. IMO
we should not be adding a vtable to it, and making very operator<< use a
virtual interface. There are other feasible designs for implementing
this. The original review, D84362, was approved by @tra, who is
responsible for Clang's CUDA support, but it wasn't reviewed by @rsmith
or anyone responsible for clang's diagnostic library.
Reid Kleckner [Thu, 24 Sep 2020 18:13:42 +0000 (11:13 -0700)]
Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions""
This reverts commit
e39da8ab6a286ac777d5fe7799f1eb782cf99938.
This depends on a change that needs additional design review and needs
to be reverted.
Sanjay Patel [Thu, 24 Sep 2020 17:44:29 +0000 (13:44 -0400)]
[APFloat] prevent NaN morphing into Inf on conversion (PR43907)
We shift the significand right on a truncation, but that needs to be made NaN-safe:
always set at least 1 bit in the significand.
https://llvm.org/PR43907
See D88238 for the likely follow-up (but needs some plumbing fixes before it can proceed).
Differential Revision: https://reviews.llvm.org/D87835
Craig Topper [Thu, 24 Sep 2020 16:55:39 +0000 (09:55 -0700)]
[SLP] Remove LHS and RHS from OperationData.
These were only really used for 2 things. One was to check if the operand matches the phi if it exists. The other was for the createOp method to build the reduction.
For the first case we still have the operation we just need to know how to index its operands. So I've modified getLHS/getRHS to just use the opcode/kind to know how to find the right operands on an instruction that is now passed in.
For the other case we had to create an OperationData object to set the LHS/RHS values and copy the opcode/kind from another object. We would then just call createOp on that temporary object. Instead I've made LHS/RHS arguments to createOp and removed all these temporary objects.
Differential Revision: https://reviews.llvm.org/D88193
Alexey Bataev [Thu, 24 Sep 2020 13:07:24 +0000 (09:07 -0400)]
[OPENMP]Fix PR47621: Variable used by task inside a template function is not made firstprivate by default
Need to fix a check for the variable if it is declared in the inner
OpenMP region to be able to firstprivatize it.
Differential Revision: https://reviews.llvm.org/D88240
Simon Pilgrim [Thu, 24 Sep 2020 17:28:21 +0000 (18:28 +0100)]
[Scalar] ConstantHoistingPass - iterate with const references. NFCI.
Fix some clang-tidy warnings.
Simon Pilgrim [Thu, 24 Sep 2020 17:03:59 +0000 (18:03 +0100)]
[AArch64] Regenerate dag-numsignbits.ll checks
To improve the codegen diff in D87502
Stanislav Mekhanoshin [Thu, 17 Sep 2020 18:44:52 +0000 (11:44 -0700)]
[AMDGPU] global-isel support for RT
Differential Revision: https://reviews.llvm.org/D87847
Alexey Bataev [Wed, 23 Sep 2020 19:27:51 +0000 (15:27 -0400)]
[OPENMP]PR47606: Do not update the lastprivate item if it was captured by reference as firstprivate data member.
No need to make final copy from the firsptrivate/lastprivate copy to the original item if the item is a data memeber.
Firstprivate copy creates a copy by reference and the original item gets
updated correctly when updating the lastprivate shared variable.
Differential Revision: https://reviews.llvm.org/D88179
Momchil Velikov [Thu, 24 Sep 2020 15:34:27 +0000 (16:34 +0100)]
[AArch64][GlobalISel] Implement __builtin_return_address for PAC-RET
This patch implements stripping of the PAC in the return address for GlobalISel.
Implementation for when not using GLobalISel is in
https://reviews.llvm.org/D75044 The analogous GCC patch is
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=
a70d5d81c41048556fd86eaa1036018a6bfba115
Differential Revision: https://reviews.llvm.org/D84502
Andrew Litteken [Thu, 24 Sep 2020 16:41:30 +0000 (11:41 -0500)]
[IRSim][NFC] Removing dead variables from IRSimilarityIdentifier.cpp
As informed by danielkiss.
Follow up to Differential Revision: https://reviews.llvm.org/D86972
Ye Luo [Thu, 24 Sep 2020 16:39:22 +0000 (12:39 -0400)]
[OpenMP] cmake option LIBOMPTARGET_NVPTX_MAX_SM for nvptx device RTL
It allows customizing MAX_SM for non-flagship GPU and reduces graphic memory usage.
In addition, so far the size is hard-coded up to __CUDA_ARCH__ 700 and is already a hassle for 800.
Introduce MAX_SM for 800 and protect future arch
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D88185
Dave Lee [Wed, 23 Sep 2020 16:11:22 +0000 (09:11 -0700)]
[lldb/examples] Add missing declaration in heap.py
Add missing declaration for `malloc_get_all_zones` in heap.py.
Differential Revision: https://reviews.llvm.org/D88158
Saleem Abdulrasool [Fri, 11 Sep 2020 20:35:04 +0000 (20:35 +0000)]
Sema: add support for `__attribute__((__swift_newtype__))`
Add the `swift_newtype` attribute which allows a type definition to be
imported into Swift as a new type. The imported type must be either an
enumerated type (enum) or an object type (struct).
This is based on the work of the original changes in
https://github.com/llvm/llvm-project-staging/commit/
8afaf3aad2af43cfedca7a24cd817848c4e95c0c
Differential Revision: https://reviews.llvm.org/D87652
Reviewed By: Aaron Ballman
Nathan Froyd [Thu, 24 Sep 2020 14:54:28 +0000 (10:54 -0400)]
[clang] use string tables for static diagnostic descriptions
Using a pointer for the description string in StaticDiagInfoRec causes
several problems:
1. We don't need to use a whole pointer to represent the string;
2. The use of pointers incurs runtime relocations for those pointers;
the relocations take up space on disk and represent runtime overhead;
3. The need to relocate data implies that, on some platforms, the entire
array containing StaticDiagInfoRecs cannot be shared between processes.
This patch changes the storage scheme for the diagnostic descriptions to
avoid these problems. We instead generate (effectively) one large
string and then StaticDiagInfoRec conceptually holds offsets into the
string. We elected to also move the storage of those offsets into a
separate array to further reduce the space required.
On x86-64 Linux, this change removes about 120KB of relocations and
moves about 60KB from the non-shareable .data.rel.ro section to
shareable .rodata. (The array is about 80KB before this, but we
eliminated 4 bytes/entry by using offsets rather than pointers.) We
actually reap this benefit twice, because these tables show up in both
libclang.so and libclang-cpp.so and we get the reduction in both places.
Differential Revision: https://reviews.llvm.org/D81865
Simon Pilgrim [Thu, 24 Sep 2020 14:28:12 +0000 (15:28 +0100)]
[X86][SSE] combineVectorTruncation - enable (pre-SSSE3) vXi16->vXi8 truncation.
Shuffle combining can now handle this output, and by performing this early in combineVectorTruncation we avoid a scalarization that caused a regression on D87502.
Peyton, Jonathan L [Mon, 7 Sep 2020 07:28:38 +0000 (02:28 -0500)]
[OpenMP] Fix if0 task with dependencies in the runtime
The current GOMP interface for serialized tasks does not take into
account task dependencies. Add the check and wait for dependencies.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=46573
Differential Revision: https://reviews.llvm.org/D87271
Peyton, Jonathan L [Mon, 7 Sep 2020 05:37:55 +0000 (00:37 -0500)]
[OpenMP] Introduce GOMP taskwait depend in the runtime
This change introduces the GOMP_taskwait_depend() function. It implements
the OpenMP 5.0 feature of #pragma omp taskwait with depend() clause by
wrapping around __kmpc_omp_wait_deps().
Differential Revision: https://reviews.llvm.org/D87269
Peyton, Jonathan L [Mon, 7 Sep 2020 05:37:36 +0000 (00:37 -0500)]
[OpenMP] Introduce GOMP mutexinoutset in the runtime
Encapsulate GOMP task dependencies in separate class and introduce the
new mutexinoutset dependency type. This separate class allows
future GOMP task APIs easier access to the task dependency functionality
and better ability to propagate new dependency types to all existing GOMP
task APIs which use task dependencies.
Differential Revision: https://reviews.llvm.org/D87267
Peyton, Jonathan L [Thu, 3 Sep 2020 19:47:13 +0000 (14:47 -0500)]
[OpenMP] Introduce GOMP teams support in runtime
Implement GOMP_teams_reg() function which enables GOMP support of the
standalone teams construct. The GOMP_parallel* functions were modified
to call __kmp_fork_call() unconditionally so that the teams-specific
code could be reused within __kmp_fork_call() instead of reproduced
inside the GOMP_* functions.
Differential Revision: https://reviews.llvm.org/D87167
Sam Parker [Thu, 24 Sep 2020 14:29:05 +0000 (15:29 +0100)]
[NFC][ARM] Remove dead loop.
Remove a loop that just calculated a couple of values that were now
longer needed.
vpykhtin [Thu, 24 Sep 2020 14:23:51 +0000 (17:23 +0300)]
[RegisterCoalescer] Fix IMPLICIT_DEF init removal for a register on joining
This patch removes redundant IMPLICIT_DEF for subregs which was leading to
incorrect register initialization on joining in some cases.
Reviewed by: qcolombet
Differential revision: https://reviews.llvm.org/D82258
Jay Foad [Thu, 24 Sep 2020 13:37:17 +0000 (14:37 +0100)]
[AMDGPU] Use cast instead of dyn_cast
Sebastian Neubauer [Wed, 23 Sep 2020 16:01:40 +0000 (18:01 +0200)]
[AMDGPU] Fix v3f16 handling for getresinfo
v3f32 should not be expanded to v4f32. getresinfo with a dmask of 7
created an image sample with a v3f32 return value, which was bitcasted
to a v4f32 in constructRetValue.
Differential Revision: https://reviews.llvm.org/D88206
Matt Arsenault [Thu, 25 Jun 2020 23:17:24 +0000 (19:17 -0400)]
IR: Have byref imply dereferenceable
The langref already states it does, but this wasn't implemented. Also
covers inalloca and preallocated. Also helps fix a dependence on
pointer element types.
Matt Arsenault [Wed, 23 Sep 2020 15:03:38 +0000 (11:03 -0400)]
OpaquePtr: Add helpers for sret to mirror byval
Sret should really have a type parameter like byval does.
George Mitenkov [Thu, 24 Sep 2020 13:49:19 +0000 (16:49 +0300)]
[MLIR][SPIRV] Fixed dialect loading in deserialization
Fixed an error when deserializing the SPIR-V binary
to MLIR SPIR-V. Before, the SPIR-V dialect was not loaded
explicitly into the context, which resulted in unregistered
operation error.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D88223
Sanjay Patel [Thu, 24 Sep 2020 13:54:14 +0000 (09:54 -0400)]
[PhaseOrdering] move test with target requirement to x86 dir
I'm not sure if the target is actually necessary,
but since it was specified, I'm moving to the
appropriate dir to avoid bot fallout.
Sanjay Patel [Thu, 24 Sep 2020 13:47:38 +0000 (09:47 -0400)]
[PhaseOrdering] move an 'opt' test from x86 codegen; NFC
This file comes from 2007, and I'm not entirely sure of the
motivation, but it was going through all of opt and llc.
The llc part is almost certainly unnecessary as shown in
the now auto-generated FileCheck lines.
This test may be affected by a logic change suggested in:
D87835
Sanjay Patel [Thu, 24 Sep 2020 13:33:56 +0000 (09:33 -0400)]
[InstCombine] regenerate test checks; NFC
Nico Weber [Thu, 24 Sep 2020 13:33:46 +0000 (09:33 -0400)]
lld: Try to fix check-lld on incremental builds after
8f2c31f22b974da
Alexey Baturo [Thu, 24 Sep 2020 09:04:35 +0000 (10:04 +0100)]
[NFC][RISCV][builtins] Remove some hard-coded values from i-cache clear routine
Remove some hard-coded values from i-cache clear routine
Differential Revision: https://reviews.llvm.org/D87578
Haruki Imai [Thu, 24 Sep 2020 04:04:29 +0000 (09:34 +0530)]
[MLIR] Normalize memrefs in LoadOp and StoreOp of Standard Ops
Added a trait, `MemRefsNormalizable` in LoadOp and StoreOp of Standard Ops
to normalize input memrefs in LoadOp and StoreOp.
Related revision: https://reviews.llvm.org/D86236
Differential Revision: https://reviews.llvm.org/D88156
Alexandre Ganea [Thu, 24 Sep 2020 13:07:13 +0000 (09:07 -0400)]
Fix
f5314d15af4f4514103ea12c74cb208538b8bef5 - [Support] On Unix, let the CrashRecoveryContext return the signal code
This was causing bots to fail: http://green.lab.llvm.org/green/job/clang-stage1-RA/14828/consoleFull#
6384962949ba4694-19c4-4d7e-bec5-
911270d8a58c
Alexandre Ganea [Thu, 24 Sep 2020 12:24:10 +0000 (08:24 -0400)]
Improve
723fea23079f9c85800e5cdc90a75414af182bfd - Silence 'warning: unused variable' when compiling with Clang 10.0
Yaxun (Sam) Liu [Wed, 23 Sep 2020 22:00:23 +0000 (18:00 -0400)]
Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"
This recommits
7f1f89ec8d9944559042bb6d3b1132eabe3409de and
40df06cdafc010002fc9cfe1dda73d689b7d27a6 after fixing memory
sanitizer failure.
Simon Pilgrim [Thu, 24 Sep 2020 12:41:47 +0000 (13:41 +0100)]
[AArch64] Regenerate dag-combine-mul-shl.ll checks
Sjoerd Meijer [Thu, 24 Sep 2020 10:47:30 +0000 (11:47 +0100)]
[ARM] LowoverheadLoops: add an option to disable tail-predication
This might be useful for testing. We already have an option -tail-predication
but that controls the MVETailPredication pass. This
-arm-loloops-disable-tail-pred is just for disabling it in the LowoverheadLoops
pass.
Differential Revision: https://reviews.llvm.org/D88212
Sam Parker [Thu, 24 Sep 2020 11:55:17 +0000 (12:55 +0100)]
[ARM] Check for LSTP side-effects.
If the LSTP instruction is inserted with an element count low enough
to immediately predicate some lanes as false, this can have some
unintended effects on any proceeding MVE instructions in the
preheader.
Differential Revision: https://reviews.llvm.org/D88209
Alexandre Ganea [Thu, 24 Sep 2020 12:14:45 +0000 (08:14 -0400)]
[Support] On Unix, let the CrashRecoveryContext return the signal code
Before this patch, the CrashRecoveryContext was returning -2 upon a signal, like ExecuteAndWait does. This didn't match the behavior on Windows, where the the exception code was returned.
We now return the signal's code, which optionally allows for re-throwing the signal later. Doing so requires all custom handlers to be removed first, through llvm::sys::unregisterHandlers() which we made a public API.
This is part of https://reviews.llvm.org/D70378
Zachary Turner [Wed, 23 Sep 2020 21:19:21 +0000 (17:19 -0400)]
[lit] Support running tests on Windows without GnuWin32
Historically, we have told contributors that GnuWin32 is a pre-requisite
because our tests depend on utilities such as sed, grep, diff, and more.
However, Git on Windows includes versions of these utilities in its
installation. Furthermore, GnuWin32 has not been updated in many years.
For these reasons, it makes sense to have the ability to run llvm tests
in a way that is both:
a) Easier on the user (less stuff to install)
b) More up-to-date (The verions that ship with git are at least as
new, if not newer, than the versions in GnuWin32.
We add support for this here by attempting to detect where Git is
installed using the Windows registry, confirming the existence of
several common Unix tools, and then adding this location to lit's PATH
environment.
Differential Revision: https://reviews.llvm.org/D84380
Alexandre Ganea [Tue, 22 Sep 2020 22:22:01 +0000 (18:22 -0400)]
[Support] On Windows, ensure abort() can be catched several times in a row with CrashRecoveryContext
Before this patch, the CrashRecoveryContext would only catch the first abort(). Any further calls to abort() inside subsquent CrashRecoveryContexts would not be catched. This is because the Windows CRT removes the abort() handler before calling it.
This is part of https://reviews.llvm.org/D70378
Alexey Lapshin [Thu, 24 Sep 2020 12:07:18 +0000 (15:07 +0300)]
Praveen G [Thu, 24 Sep 2020 12:08:11 +0000 (13:08 +0100)]
[flang] [OpenMP 4.5] Adding lit test cases for OpenMP Constructs.
1. Section 2.5 : Parallel Construct
2. Section 2.7.1 : Loop Construct
3. Section 2.7.2 : Sections Construct
4. Section 2.7.3 : Single Construct
5. Section 2.7.4 : Workshare Construct
6. Section 2.8.1 : Simd Construct
7. Section 2.8.3 : Loop Simd Construct
8. Section 2.9.1 : Task Construct
9. Section 2.9.2 : Taskloop Construct
10. Section 2.9.3 : Taskloop Simd Construct
Most of the test cases added as part of this change contains semantic errors except few cases which are semantically correct but thrown a semantic error.
Currently flang is not throwing the errors for these cases and throwing semantic errors for the following correct test cases
{omp-do03.f90 , omp-loop-simd01.f90 , omp-simd02.f90 , omp-taskloop01.f90}
Hence, all the test cases are marked as XFAIL.
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D87908
Andrzej Warzynski [Thu, 24 Sep 2020 11:54:07 +0000 (12:54 +0100)]
[flang][driver] Remove unnecessary includes in the unittest (NFC)
Differential Revision: https://reviews.llvm.org/D88219
Sanjay Patel [Thu, 24 Sep 2020 11:29:18 +0000 (07:29 -0400)]
[APFloat] add tests for convert of NAN; NFC
More coverage for the bug fix proposed in D87835.
Alexey Lapshin [Tue, 22 Sep 2020 17:47:02 +0000 (20:47 +0300)]
[llvm-objcopy][NFC] refactor error handling. part 1.
Remove usages of special error reporting functions(error(),
reportError()). This patch is extracted from D87987.
Errors are reported as Expected<>/Error returning values.
This part is for MachO subfolder of llvm-objcopy.
Testing: check-all.
Reviewed By: jhenderson, alexshap
Differential Revision: https://reviews.llvm.org/D88113
Jonas Toth [Thu, 24 Sep 2020 11:13:27 +0000 (13:13 +0200)]
[NFC][Docs] fix clang-docs compilation
James Henderson [Tue, 22 Sep 2020 13:36:53 +0000 (14:36 +0100)]
[lld][ELF][test] Add a couple of test cases for LTO behaviour
This patch expands two LTO test cases to check other aspects.
1) weak.ll has been expanded to show that it doesn't matter whether the
first appearance of a weak symbol appears in a bitcode file or native
object - that one is picked.
2) reproduce-lto.ll has been expanded to show that the bitcode files are
stored in the reproduce package and that intermediate files (such as
the LTO-compiled object) are not.
Differential Revision: https://reviews.llvm.org/D88094
Reviewed by: grimar, MaskRay
Serge Pavlov [Thu, 24 Sep 2020 10:27:27 +0000 (17:27 +0700)]
Use different name for auto variable
Without this change GCC 5.4.0 failed to compile JSON.cpp with the error:
.../llvm-project/llvm/lib/Support/JSON.cpp: In lambda function:
.../llvm-project/llvm/lib/Support/JSON.cpp:291:29: error: use of 'V' before deduction of 'auto'
for (const auto &V : *V.getAsArray())
Georgii Rymar [Mon, 21 Sep 2020 15:07:49 +0000 (18:07 +0300)]
[llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non-relocatable objects.
This is the first patch for https://bugs.llvm.org/show_bug.cgi?id=47581.
Currently -u does not compute function addresses correctly and
dumps broken addresses for non-relocatable objects.
ARM spec says:
"An index table entry consists of 2 words.
The first word contains a prel31 offset (see Relocations) to the start of a function, with bit 31 clear."
...
"The relocated 31 bits form a place-relative signed offset to the referenced entity.
For brevity, this document will refer to the results of these relocations as "prel31 offsets"."
(https://developer.arm.com/documentation/ihi0038/c/?lang=en#index-table-entries)
(https://developer.arm.com/documentation/ihi0038/c/?lang=en#relocations)
Currently we use an address of the SHT_ARM_EXIDX section instead of an address of an entry
in computations. As a result we compute an offset that is not really "place-relative",
but section relative, what is wrong.
The patch fixes this issue.
Differential revision: https://reviews.llvm.org/D88076
Georgii Rymar [Thu, 24 Sep 2020 10:12:51 +0000 (13:12 +0300)]
[llvm-readobj] - Fix a warning.
In a post review comments for D88097 it was mentioned that code
triggers bunch of warnings of the form:
llvm/tools/llvm-readobj/ELFDumper.cpp:5299:28: warning: loop variable 'Note' is always a copy because
the range of type 'iterator_range<llvm::object::ELFFile<llvm::object::ELFType<llvm::support::big, true> >::Elf_Note_Iterator>'
(aka 'iterator_range<Elf_Note_Iterator_Impl<ELFType<(llvm::support::endianness)0U, true> > >') does not return a reference [-Wrange-loop-analysis]
for (const Elf_Note &Note : this->Obj.notes(P, Err))
It happens because Elf_Note is always copied here:
Elf_Note_Impl<ELFT> operator*() const {
assert(Nhdr && "dereferenced ELF note end iterator");
return Elf_Note_Impl<ELFT>(*Nhdr);
}
This patch fixes the issue by removing a reference.
Florian Hahn [Thu, 24 Sep 2020 10:06:55 +0000 (11:06 +0100)]
[SCEV] Use loop guard info when computing the max BE taken count in howFarToZero.
For some expressions, we can use information from loop guards when
we are looking for a maximum. This patch applies information from
loop guards to the expression used to compute the maximum backedge
taken count in howFarToZero. It currently replaces an unknown
expression X with UMin(X, Y), if the loop is guarded by
X ult Y.
This patch is minimal in what conditions it applies, and there
are a few TODOs to generalize.
This partly addresses PR40961. We will also need an update to
LV to address it completely.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D67178
Rainer Orth [Thu, 24 Sep 2020 09:58:25 +0000 (11:58 +0200)]
[asan][test] Disable malloc-no-intercept.c on Solaris
`TestCases/malloc-no-intercept.c` `FAIL`s on Solaris/x86, e.g. with
`-Dtestfunc=mallinfo`:
/usr/bin/ld: /tmp/malloc-no-intercept-586529.o: in function `main':
/vol/llvm/src/llvm-project/dist/compiler-rt/test/asan/TestCases/malloc-no-intercept.c:30: undefined reference to `nonexistent_function'
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
This is not surprising, actually:
- `mallinfo` and `mallopt` only exist in `libmalloc`
- `pvalloc` doesn't exist all all
- `cfree` does exist in `libc`, but isn't declared in any public header and
the OpenSolaris sources reveal that it has a different signature than on
Linux
- only `memalign` is a public interface
To avoid this, this patch disables the interceptors for all but `meminfo`.
Additionally, the test is marked `UNSUPPORTED` on Solaris since the
`memalign` and `cfree` variants **do** link on Solaris.
Tested on `amd64-pc-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D87898
Sam McCall [Thu, 24 Sep 2020 09:55:50 +0000 (11:55 +0200)]
[clangd] Reorder a little bit of init code. NFC
This makes it possible to do something else (run checks) instead of
starting the server, with all config applied.
Junda Su [Thu, 24 Sep 2020 09:44:14 +0000 (12:44 +0300)]
[MLIR][docs] Fix typos
Fixed typos in SPIR-V to LLVM manual.
Reviewed By: georgemitenkov
Differential Revision: https://reviews.llvm.org/D88202
Alexander Belyaev [Thu, 24 Sep 2020 09:27:42 +0000 (11:27 +0200)]
[llvm] Use instead of in IRSimilarityIdentifierTest.cpp.
Mikael Holmen [Thu, 24 Sep 2020 09:18:21 +0000 (11:18 +0200)]
[unittests] Use std::make_tuple to make some toolchains happy again
My toolchain stopped working (LLVM 8.0, libstdc++ 5.4.0) after 577adda:
06:25:37 ../unittests/Support/Path.cpp:91:7: error: chosen constructor is explicit in copy-initialization
06:25:37 {"", false, false}, {"/", true, true}, {"/foo", true, true},
06:25:37 ^~~~~~~~~~~~~~~~~~
06:25:37 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
06:25:37 constexpr tuple(_UElements&&... __elements)
06:25:37 ^
This commit adds explicit calls to std::make_tuple to work around
the problem.