Commit Graph

417401 Commits

Author SHA1 Message Date
Petr Hosek ed28461e27 [CMake][compiler-rt] Make CRT separately buildable
This is useful when building a complete toolchain to ensure that CRT
is built after builtins but before the rest of the compiler-rt.

Differential Revision: https://reviews.llvm.org/D120682
2022-03-07 23:05:20 -08:00
Zi Xuan Wu 3297758901 [CSKY] Enable TargetAsmStreamer/ELFStreamer and support asm directive of csky_attribute
Add support of parsing .csky_attribute directive and emit related target attributes in .csky.attribute section.
It does not emit attribute directive in assembly code, so only emit target attributes in ELF streamer.
In ELF streamer, it handles the header EFlag and the csky_attribute section which contains some attribute items.
The EFlag and attribute items are calculated from feature bits based on Subtarget.
2022-03-08 14:00:38 +08:00
Yuanfang Chen eddd94c27d Reland "[clang][debug] port clang-cl /JMC flag to ELF"
This relands commit 7313474319.

It failed on Windows/Mac because `-fjmc` is only checked for ELF targets.
Check the flag unconditionally instead and issue a warning for non-ELF targets.
2022-03-07 21:55:41 -08:00
Valentin Clement 4730582d5d
[flang] Remove unused variable in Allocatable.cpp
Fix for buildbot failure: https://lab.llvm.org/buildbot/#/builders/180/builds/3532
2022-03-08 06:51:23 +01:00
Johannes Doerfert 5b4acb20ff [OpenMP][FIX] Ensure flag to disable de-globalization works properly
If the user disables de-globalization we did not seed the AAHeapToShared
and AAHeapToStack but we still could end up with them through in-flight
lookups. With this patch we disable AAHeapToShared completely if the
user disabled de-globalization. Heap-2-stack is still run though.

Differential Revision: https://reviews.llvm.org/D121059
2022-03-07 23:43:05 -06:00
Johannes Doerfert 1660288b28 [OpenMP][CUDA] Use one event pool per device
An event pool, similar to the stream pool, needs to be kept per device.
For one, events are associated with cuda contexts which means we cannot
destroy the former after the latter. Also, CUDA documentation states
streams and events need to be associated with the same context, which
we did not ensure at all.

Differential Revision: https://reviews.llvm.org/D120142
2022-03-07 23:43:05 -06:00
Johannes Doerfert 10aa83ff74 [OpenMP] Allow to explicitly deinitialize device resources
There are two problems this patch tries to address:
1) We currently free resources in a random order wrt. plugin and
   libomptarget destruction. This patch should ensure the CUDA plugin
   is less fragile if something during the deinitialization goes wrong.
2) We need to support (hard) pause runtime calls eventually. This patch
   allows us to free all associated resources, though we cannot
   reinitialize the device yet.

Follow up patch will associate one event pool per device/context.

Differential Revision: https://reviews.llvm.org/D120089
2022-03-07 23:43:04 -06:00
Johannes Doerfert 307bbd3c82 [OpenMP][NFCI] Use RAII lock guards in libomptarget where possible
Differential Revision: https://reviews.llvm.org/D121060
2022-03-07 23:43:04 -06:00
Uday Bondhugula da93537bf8 NFC. Improve isInnermostAffineForOp - drop unnecessary check
Rewrite isInnermostAffineForOp utility to make it more direct/efficient.
Drop unnecessary check. NFC.

Differential Revision: https://reviews.llvm.org/D121170
2022-03-08 10:44:54 +05:30
Shao-Ce SUN 365c858a5d [RISCV] Share PatFprFpr classes for F, D, and Zfh
Inspired by D115469

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D121066
2022-03-08 13:02:04 +08:00
Lang Hames 36f0dfd07a [ORC][JITLink] Fix MachO absolute symbol handling, add test case.
This patch removes the unintended resolution of locally scoped absolute symbols
(which was causing unexpected definition errors).

It stops using the JITSymbolFlags::Absolute flag (it isn't set or used elsewhere,
and causes mismatch-flags asserts), and adds JITSymbolFlags::Exported to default
scoped absolute symbols.

Finally, we now set the scope of absolute symbols correctly in
MachOLinkGraphBuilder.
2022-03-07 20:54:55 -08:00
Christudasan Devadasan 0d849b8249 AMDGPU: Skip folding REG_SEQUENCE if found unknown regclasses for its users
Use TII::getRegClass to return a valid regclass or a nullptr
if the RC is unknown for a given OpIdx. This fixes a potential
crash occurred while getting the RC from a variadic instruction.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D120813
2022-03-08 10:11:57 +05:30
Phoebe Wang 4de9a752d6 [X86] Add helper enum for ternary intrinsics
Reviewed By: RKSimon, LuoYuanke

Differential Revision: https://reviews.llvm.org/D120307
2022-03-08 11:19:05 +08:00
Philip Reames a2e9c68fcd [SLP] Extract a helper for buildvector [nfc] 2022-03-07 19:11:40 -08:00
Yitzhak Mandelbaum 18c84e2d32 [clang][dataflow] Fix nullptr dereferencing error.
When pre-initializing fields in the environment, the code assumed that all
fields of a struct would be initialized. However, given limits on value
construction, that assumption is incorrect. This patch changes the code to drop
that assumption and thereby avoid dereferencing a nullptr.

Differential Revision: https://reviews.llvm.org/D121158
2022-03-08 03:01:31 +00:00
jacquesguan e55b9b0d0a [RISCV] Add patterns for vector widening floating-point reduction instructions.
Add patterns for vector widening floating-point reduction instructions.

Differential Revision: https://reviews.llvm.org/D120390
2022-03-08 10:53:49 +08:00
Philip Reames 8ab3befa3f [SLP] Fix spelling in a lambda name [NFC] 2022-03-07 18:52:57 -08:00
Amir Ayupov 018ad03efa [BOLT][CMAKE] Remove CMake 3.13.4 incompatible parameter
Remove `TYPE BIN` parameter that is introduced in CMake 3.14 and revert back to
the equivalent compatible form `DESTINATION ${CMAKE_INSTALL_BINDIR}`.

Addresses https://github.com/llvm/llvm-project/issues/54099

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121012
2022-03-07 18:42:00 -08:00
Jim Ingham 94ec0b6c5a Change "target.save-jit-objects" to "target.save-jit-objects-dir".
The old command wrote to CWD, which doesn't always work, and if it
didn't, there was no workaround (and it crashed on failure).  This
patch changed the setting to provide a directory to save the objects
to.

Differential Revision: https://reviews.llvm.org/D121036
2022-03-07 17:44:51 -08:00
Kai Luo a7adf7b9e9 [libcxx][AIX] Remove `LIBCXX-AIX-FIXME` in isalwayslockfree check after 86478c7ad8
The workaround has been removed via https://reviews.llvm.org/D119931, checks passed on AIX-32.

Reviewed By: ldionne, daltenty, jsji, #libc

Differential Revision: https://reviews.llvm.org/D121081
2022-03-08 01:23:33 +00:00
Peter Klausler 665d41593f [flang] Fix module file missing USE for shadowed derived type
When a module uses a derived type that is shadowed by a generic
interface, the module file was missing a USE statement for the
name.  Detect and handle this situation.

Differential Revision: https://reviews.llvm.org/D121160
2022-03-07 17:12:51 -08:00
Peixin-Qiao 4e159e4c7b [clang] Fix OpenMP critical hint parameter check
The paramemter of hint clause in OpenMP critical hint should be
non-negative. The omp_lock_hint_none is 0 in omp.h.

Reviewed By: Alexey Bataev

Differential Revision: https://reviews.llvm.org/D121101
2022-03-08 09:04:31 +08:00
Bixia Zheng 5b87e0521d [mlir][sparse][taco] Split the evaluate method into compile and compute.
This is to align with the PyTACO API better.

Modify an existing unit test to test the new routines.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D121083
2022-03-07 16:58:41 -08:00
Jessica Paquette 355ad3a3cd Add JSON output option to llvm-remark-size-diff
This adds JSON output to llvm-remark-size-diff.

The goal here is to make it easy for external tools to consume output from
llvm-remark-size-diff. These tools could be used for automated size analysis.
(E.g. in CI).

To specify JSON output, use `--report_style=json`. JSON output can be
pretty-printed via `--pretty`.

With automation in mind, the schema looks like this:

```
"Files": {
  "A": <filename_a>
  "B": <filename_b>
},

"InBoth": [
   {
    "FunctionName": <function name>,
    "InstCount": [
       <count_in_a>,
       <count_in_b>
     ],
    "StackSize": [
       <count_in_a>,
       <count_in_b>
     ]
   },
   ...
]

"OnlyInA": [
   {
    "FunctionName": <function name>,
    "InstCount": [
       <count_in_a>,
       0
     ],
    "StackSize": [
       <count_in_a>,
       0
     ]
   },
   ...
]

"OnlyInB": [
    {
    "FunctionName": <function name>,
    "InstCount": [
       0,
       <count_in_b>
     ],
    "StackSize": [
       0,
       <count_in_b>
     ]
   },
   ...
]
```

A few notes:

- Filenames are included, because tools may want to combine many outputs
  together in some way (a big JSON file, a big CSV, or something.)

- Counts are represented as [a, b] so that a diff can be calculated via b - a.
  The original counts may be useful for size analysis (e.g. was this function
  extremely large before?) and so both are preserved.

- `OnlyInA` and `OnlyInB` have a 0 for one of the counts always. This is to
  make it easier for tools to share code between `OnlyInA`, `OnlyInB`, and
  `InBoth`.

Differential Revision: https://reviews.llvm.org/D121173
2022-03-07 16:53:27 -08:00
Sam Clegg c832edfd3f [WebAssembly] Add new target feature in support of 'extended-const' proposal
We don't yet do anything when this feature is enabled, this change
just lays the ground work by accepting that there is such a feature.

See https://github.com/WebAssembly/extended-const

Differential Revision: https://reviews.llvm.org/D121151
2022-03-07 16:45:42 -08:00
Peter Klausler 96aa48100c [flang] Make uninitialized allocatable components explicitly NULL() in structure constructors
When a structure constructor does not initialize an allocatable component,
ensure that the typed expression representation contains an explicit
NULL() for the component.  Expression semantics already copies default
initialized expressions for nonallocatable components into structure
constructors.  This change is expected to simplify lowering.

Differential Revision: https://reviews.llvm.org/D121162
2022-03-07 16:41:38 -08:00
Arthur Eubanks 79a1f3e7c6 [NFC] Cleanup StandardInstrumentations 2022-03-07 16:24:36 -08:00
Louis Dionne 9138666f54 Revert "[libc++] Remove extension to support allocator<const T>"
This reverts commit bed3240bf7.

I will need to add more tests for std::shared_ptr<T const> before
re-landing this.
2022-03-07 17:35:12 -05:00
Jacob Lambert 5160447f58 [AMDGPU] Add gfx10 assembler directive to specify shared VGPR count
Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D105507
2022-03-07 14:27:41 -08:00
Jez Ng 0405920c5f Re-land [lld-macho][nfc] Don't use `stubsHelperIndex` in ICF hash
Previous attempt was commit 112135e774 and
reverted in d86d431814.
2022-03-07 16:58:00 -05:00
Peter Klausler 764363368c [flang] Runtime validation of SPREAD(DIM=dim) argument
Crash when DIM= is not a valid dimension in the result.

Differential Revision: https://reviews.llvm.org/D121145
2022-03-07 13:49:39 -08:00
Groverkss abc2c2309a [MLIR][Presburger][NFC] Cleanup PresburgerSet
This patch cleans up the interface to PresburgerSet. At a high level it does
the following changes:

  - Move member functions around to have constructors at top and print/dump
    at end.
  - Move a private function to be a static function instead.
  - Change member functions of type "getAllIntegerPolyhedron" to "getAllPolys"
    instead.
  - Improve documentation for PresburgerSet.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D121027
2022-03-08 03:02:12 +05:30
Peter Klausler ef7f6f7cd7 [flang] Use faster path for default formatted character input
Rather than reading default character variables in formatted
input one byte at a time via NextInField(), skip and read
them via blocks of available buffer data.  This eliminates
a bottleneck that affected reads of large character values.
(It also exposed a problem with sequential reads with RECL=
set on the OPEN statement, so that's fixed too.)

Differential Revision: https://reviews.llvm.org/D121144
2022-03-07 13:01:08 -08:00
Jonathan Peyton 6564a70415 [OpenMP][libomp] Fix register constraint for tpause and umwait
Register constraint switched to "=q" which means very specifically (from
https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints)

> Any register accessible as rl. In 32-bit mode, a, b, c, and d; in 64-bit
mode, any integer register.

Older gcc versions (8.x and below) were trying to use esi or edi for the
8 bit flag variable, but it wound up displaying this error in the end:

kmp_lock.cpp: In function ‘void __kmp_spin_backoff(kmp_backoff_t*)’:
kmp_lock.cpp:2684:1: error: unsupported size for integer register
Hence the correct restriction is "=q" instead of "=r".

Fixes: https://github.com/llvm/llvm-project/issues/53309
Differential Revision: https://reviews.llvm.org/D120519
2022-03-07 14:55:49 -06:00
Hanhan Wang 1538bd518c [mlir][Vector] Add patterns to reorder elementwise ops and broadcast/transpose ops.
In quantized comutation, there are casting ops around computation ops.
Reorder the ops to make reduce-to-contract actually work.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D120760
2022-03-07 12:52:12 -08:00
Valentin Clement c5cf1b9034
[flang] Lower allocate and deallocate statements
This patch add the lowering for the allocate
and the deallocate statements.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-07 21:47:28 +01:00
Arthur O'Dwyer 844a9c0ef4 [libc++] Make common_iterator's proxy types into aggregates.
Saves one move in each case, which is basically nothing perf-wise;
this is more about simplifying the code.

Differential Revision: https://reviews.llvm.org/D121130
2022-03-07 15:44:10 -05:00
Ahmed Bougacha 1067f2177a [sancov] Don't instrument calls to bitcast funcs: they're not indirect.
Currently, when instrumenting indirect calls, this uses
CallBase::getCalledFunction to determine whether a given callsite is
eligible.

However, that returns null if:
  this is an indirect function invocation or the function signature
  does not match the call signature.

So, we end up instrumenting direct calls where the callee is a bitcast
ConstantExpr, even though we presumably don't need to.

Use isIndirectCall to ignore those funky direct calls.

Differential Revision: https://reviews.llvm.org/D119594
2022-03-07 12:43:37 -08:00
Yuanfang Chen f46fa4de4a Revert "[clang][debug] port clang-cl /JMC flag to ELF"
This reverts commit 7313474319.

Break bots:
http://45.33.8.238/win/54551/step_7.txt
http://45.33.8.238/macm1/29590/step_7.txt
2022-03-07 12:40:43 -08:00
Martin Storsjö ebde6fc23b [libcxxabi] Fix cmake order dependency wrt dllexporting
If LIBCXX_ENABLE_SHARED isn't explicitly set on the cmake command
line, isn't set in the cache, and the libcxxabi project is configured
before libcxx, then LIBCXX_ENABLE_SHARED isn't defined yet. Once
the libcxx cmake project has been parsed, LIBCXX_ENABLE_SHARED would
have been set to its default value of ON.

This makes sure that the symbols are properly dllexported in such
a configuration scenario.

Differential Revision: https://reviews.llvm.org/D120982
2022-03-07 15:36:04 -05:00
Louis Dionne bed3240bf7 [libc++] Remove extension to support allocator<const T>
This extension is a portability trap for users, since no other standard
library supports it. Furthermore, the Standard explicitly allows
implementations to reject std::allocator<cv T>, so allowing it is
really going against the current.

This was discovered in D120684: this extension required `const_cast`ing
in `__construct_range_forward`, a fishy bit of code that can be removed
if we don't support the extension anymore.

Differential Revision: https://reviews.llvm.org/D120996
2022-03-07 15:36:03 -05:00
Stanislav Mekhanoshin 932f628121 [AMDGPU] new gfx940 fp atomics
Differential Revision: https://reviews.llvm.org/D121028
2022-03-07 12:32:02 -08:00
Peter Klausler 89d5c31b78 [flang] Make per-argument intrinsic error messages more localized
A recent patch made it possible to emit more localized error messages
pertaining to actual arguments in non-intrinsic procedure references.
Use these new powers for good and make intrinsic error messages more
precise, too.

Differential Revision: https://reviews.llvm.org/D121126
2022-03-07 12:31:03 -08:00
Sanjay Patel 9fce696110 [x86] reduce code duplication for select of X86ISD::CMP; NFC 2022-03-07 15:14:20 -05:00
Sanjay Patel 8209ee1b72 [x86] add tests for mask+cmp; NFC 2022-03-07 15:14:20 -05:00
Sanjay Patel c9d496d8a0 [x86] remove unnecessary decorations in test file; NFC 2022-03-07 15:14:20 -05:00
Jonas Devlieghere 4b093cdc28
[lldb] Format g_color_tokens as a table (NFC)
This makes editing the table easier and mistakes more obvious.
2022-03-07 12:13:38 -08:00
Jonas Devlieghere 0acc9e4b5e
[lldb] Support "bright" ANSI colors
Support ANSI escape codes for bright colors variants. Most modern
terminals support them. LLDB is not using them in any of its defaults,
but they're useful for people who want to modify their preferred ANSI
prefix/suffix.

Differential revision: https://reviews.llvm.org/D121131
2022-03-07 12:09:53 -08:00
Stanislav Mekhanoshin e7b362d75d [AMDGPU] Add v_mov_b64 gfx940 opcode
Differential Revision: https://reviews.llvm.org/D121023
2022-03-07 12:07:12 -08:00
Florian Hahn a2979c8399
[IVDescriptors] Bail out instead of asserting that order is expected.
When dealing with multiple phis that depend on each other, the order
might have been changed and may not match the expectation. If that
happens, bail out, rather than asserting.

Fixes https://github.com/llvm/llvm-project/issues/54218
Fixes https://github.com/llvm/llvm-project/issues/54233
Fixes https://github.com/llvm/llvm-project/issues/54254
2022-03-07 19:57:26 +00:00