Commit Graph

415163 Commits

Author SHA1 Message Date
Stanislav Mekhanoshin 29a0e0a9e5 [AMDGPU] Do not define GET_INSTRINFO_SCHED_ENUM
Autogenerated names are too long and break compilation on Windows,
while we do not need this enum at all.

Differential Revision: https://reviews.llvm.org/D119869
2022-02-15 13:00:54 -08:00
Fangrui Song 53b59fdc52 [ELF][PPC64] Fix assertion failure for branches to hidden undefined weak for -no-pie
Reported by Stefan Pintilie in D119773.

For a branch to a hidden undefined weak symbol, there is an
`assert(sym->getVA());` failure in PPC64LongBranchTargetSection::writeTo for a
-no-pie link. The root cause is that we unnecessarily create the thunk for the
-no-pie link.

Fix this by changing the condition to just `s.isUndefined()`. See the inline
comment.

Rename ppc64-weak-undef-call.s to ppc64-undefined-weak.s to be consistent with
other architectures.

Reviewed By: sfertile, stefanp

Differential Revision: https://reviews.llvm.org/D119787
2022-02-15 12:57:27 -08:00
Louis Dionne 5c53afe5aa [libc++] Temporarily silence failing debug mode test
Also, fix the actual code so that the test would pass if we fixed the
issue that the method is instantiated in the dylib, and hence the debug
assertion will never fire except if the debug mode is enabled when the
dylib is being compiled.
2022-02-15 15:49:29 -05:00
Thomas Raoux 0736bbd7e2 [mlir][scf] Add callback to annotate ops during pipelining
This allow user to register a callback that can annotate operations
during software pipelining. This allows user potential annotate op to
know what part of the pipeline they correspond to.

Differential Revision: https://reviews.llvm.org/D119866
2022-02-15 12:48:01 -08:00
Björn Schäpers 8da319fe77 [clang-format][NFC] Give State.Stack.back() a meaningful name
Without that debugging was a hell for me.

Differential Revision: https://reviews.llvm.org/D119597
2022-02-15 21:37:38 +01:00
Björn Schäpers b786a4aefe [clang-format] Extend SpaceBeforeParens for requires
We can now configure the space between requires and the following paren,
seperate for clauses and expressions.

Differential Revision: https://reviews.llvm.org/D113369
2022-02-15 21:37:36 +01:00
Björn Schäpers bcd1e4612f [clang-format] Further improve support for requires expressions
Detect requires expressions in more unusable contexts. This is far from
perfect, but currently we have no good metric to decide between a
requires expression and a trailing requires clause.

Differential Revision: https://reviews.llvm.org/D119138
2022-02-15 21:37:35 +01:00
Philip Reames 2e50760775 [SLP] Add assert that entities are scheduled as expected
Requested in D118538
2022-02-15 12:21:49 -08:00
Jacques Pienaar b077ee9240 [mlir][ods] Allow type attribute/operand for 0 result ops prefixed
Without results, there is no getType injected and so generating one in prefixed form doesn't result in any failures during C++ compilation.

Differential Revision: https://reviews.llvm.org/D119871
2022-02-15 12:20:07 -08:00
Yaxun (Sam) Liu 73b22935a7 [CUDA][HIP] Do not promote constexpr var with non-constant initializer
constexpr var may be initialized with address of non-const variable.
In this case the initializer is not constant in device compilation.
This has been handled for const vars but not for constexpr vars.

This patch makes handling of const var and constexpr var
consistent.

Reviewed by: Artem Belevich

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

Fixes: https://github.com/llvm/llvm-project/issues/53780
2022-02-15 15:15:55 -05:00
Louis Dionne 7dad5f84f1 [libc++] Add missing UNSUPPORTED for the has-no-incomplete-ranges test
This wasn't caught because we don't test the combination of no-filesystem
and no-experimental-features in the CI.
2022-02-15 15:10:29 -05:00
Louis Dionne a61d07ac94 [libc++][ci] Pin apple-system to arm64 to relieve pressure on x86_64 hosts 2022-02-15 15:07:54 -05:00
Joseph Huber 777039a51c [Libomptarget] Run CPU offloading tests using the new driver
This patch adds a new target to the OpenMP CPU offloading tests. This
tests the usage of the new driver for CPU offloading. If this all works
then we can move to transition to the new driver as the default.

Depends on D119613

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D119736
2022-02-15 15:05:32 -05:00
Joseph Huber 24ecafb413 [OpenMP] Add support for CPU offloading in new driver
This patch adds support for linking CPU offloading applications in the
linker wrapper. We generate the necessary linking job using the host
linker's path and library arguments. This may not be true for more
complex offloading schemes, but this is sufficient for now.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D119613
2022-02-15 15:05:30 -05:00
David Blaikie 9980a3f831 DebugInfo: Disable simplified template names for -gmlt and below
Since -gmlt doesn't carry any type information necessary to rebuild
template names.
2022-02-15 11:58:40 -08:00
David Blaikie 1ea326634b DebugInfo: Don't simplify template names using _BitInt(N)
_BitInt(N) only encodes the byte size in DWARF, not the bit size, so
can't be reconstituted.
2022-02-15 11:58:40 -08:00
Aart Bik ae76fafc3f [mlir][sparse] sparse transpose operation
This test shows that when access patterns do not match (e.g. transposing
a row-wise sparse matrix into another row-wise sparse matrix), a conversion
operation in between can enable codegen (i.e. avoid cycle in iteration graph).

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D119864
2022-02-15 11:51:30 -08:00
Mogball 26a61db93f [mlir][ods] NFC fix compilation error on clang-8 2022-02-15 19:41:16 +00:00
Florian Mayer 59e7de26aa [HWASan] remove replacement of DbgVariableIntrinsics.
This code was dead because we AI->replaceUsesWithIf above. I verified
this doesn't actually get run by applying
https://gist.github.com/fmayer/aea7cbb4700cfe2c9d932591ae1073c3 to the
Android toolchain and building AOSP, without any crash.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D119802
2022-02-15 11:40:58 -08:00
LLVM GN Syncbot 6822d89e77 [gn build] Port c62eefb886 2022-02-15 19:28:46 +00:00
Mircea Trofin c62eefb886 [nfc][codegen] Move RegisterBank[Info].cpp under CodeGen
Layering-wise, it seems RegisterBank stuff fits under CodeGen, like
other target abstraction.
In particular, TargetSubtargetInfo has a getRegBankInfo member, but
using that object requires making sure GlobalISel is linked, which is
not always the case (e.g. llvm-jitlink doesn't).

Differential Revision: https://reviews.llvm.org/D119053
2022-02-15 11:27:15 -08:00
Peter Klausler fa0443f2e7 [flang] Make source location more accurate for actual arguments
Track source location information when available for actual arguments
to procedure references, and use this information when checking constraints
on calls so that error messages refer to specific actual arguments
rather than to the entire call.

Differential Revision: https://reviews.llvm.org/D119849
2022-02-15 11:24:22 -08:00
Fangrui Song 467e1b3aaa [ELF] reportDuplicate: change Symbol * to const Symbol &. NFC 2022-02-15 11:18:31 -08:00
Mogball 761bc83af4 [mlir][ods] Default-valued parameters in attribute or type defs
Optional parameters with `defaultValue` set will be populated with that value if they aren't encountered during parsing. Moreover, parameters equal to their default values are elided when printing.

Depends on D118210

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D118544
2022-02-15 19:02:11 +00:00
minglotus-6 3940f1e237 [ProfData] Change type of options from int to uint64_t.
- Reader uses option values to override uint64_t values.

Differential Revision: https://reviews.llvm.org/D119810
2022-02-15 10:59:06 -08:00
Christopher Di Bella e51e7e7f44 [polly][NFC] removes using-directives to fix modules build
When compiling with Clang modules enabled, polly's use of using-directives
caused the global object `Target` in RegisterPasses.cpp to clash with
`llvm::Target`. By eliminating the using-directives, we're able to get
polly to play nicely with a modules build.

Differential Revision: https://reviews.llvm.org/D119809
2022-02-15 18:58:22 +00:00
Peter Klausler f6ded53fb0 [flang] Handle CALL C_F_POINTER(without SHAPE=)
Calls to C_F_POINTER() without the optional SHAPE= third argument
were failing to be recognized as proper calls to the intrinsic,
but the failure was not generating any error message.  This led to
a crash in lowering, which rightfully expects a typed expression
to be associated with the call.

So (1) catch silent failures to convert CALL statements as internal
errors, as is done for expressions and assignment statements; and
(2) clean up C_F_POINTER intrinsic handling to cope with only two
arguments and to emit an error for a FPTR= argument with no type.

Differential Revision: https://reviews.llvm.org/D119847
2022-02-15 10:58:11 -08:00
Krzysztof Drewniak 5f6ce97408 [MLIR] Add support for alloca() of non-zero address spaces
This change is needed when lowering alloca()-using code on targets
such as ROCDL that represent private scratch space as a separate
address space.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D119775
2022-02-15 18:41:30 +00:00
LLVM GN Syncbot 8cff26d290 [gn build] Port 987c7f407d 2022-02-15 18:33:42 +00:00
Nico Weber 22af2a482e [gn build] (manually) port 9c30bafd59
This is needed after b432eb5c84 to keep std::unexpected_handler
around (which libcxxabi uses from libcxx).
2022-02-15 13:33:19 -05:00
Amy Kwan 5dc0a1657b [PowerPC] Fix __builtin_pdepd and __builtin_pextd to be 64-bit and P10 only.
The `__builtin_pdepd` and `__builtin_pextd` are P10 builtins that are meant to
be used under 64-bit only. For instance, when the builtins are compiled under
32-bit mode:
```
$ cat t.c
unsigned long long foo(unsigned long long a, unsigned long long b) {
  return __builtin_pextd(a,b);
}

$ clang -c t.c -mcpu=pwr10 -m32
ExpandIntegerResult #0: t31: i64 = llvm.ppc.pextd TargetConstant:i32<6928>, t28, t29

fatal error: error in backend: Do not know how to expand the result of this operator!
```
This patch adds sema checking for these builtins to compile under 64-bit
mode only and on P10. The builtins will emit a diagnostic when they are compiled on
non-P10 compilations and on 32-bit mode.

Differential Revision: https://reviews.llvm.org/D118753
2022-02-15 12:30:50 -06:00
Peter Klausler 6bd72fa661 [flang] Allow extension cases of EQUIVALENCE with optional warnings
EQUIVALENCE storage association of objects whose types are not
both default-kind numeric storage sequences, or not both default-kind
character storage sequences, are not standard conformant.
However, most Fortran compilers admit such usage, with warnings
in strict conformance mode.  This patch allos EQUIVALENCE of objects
that have sequence types that are either identical, both numeric
sequences (of default kind or not), or both character sequences.
Non-sequence types, and sequences types that are not homogeneously
numeric or character, remain errors.

Differential Revision: https://reviews.llvm.org/D119848
2022-02-15 10:21:38 -08:00
Arthur O'Dwyer bbb0f2c759 [libc++] Replace `#include ""` with `<>` in libcxx/src/. NFCI.
Our best guess is that the two syntaxes should have exactly equivalent
effects, so, let's be consistent with what we do in libcxx/include/.

I've left `#include "include/x.h"` and `#include "../y.h"` alone
because I'm less sure that they're interchangeable, and they aren't
inconsistent with libcxx/include/ because libcxx/include/ never
does that kind of thing.

Also, use the `_LIBCPP_PUSH_MACROS/POP_MACROS` dance for `<__undef_macros>`,
even though it's technically unnecessary in a standalone .cpp file,
just so we have consistently one way to do it.

Differential Revision: https://reviews.llvm.org/D119561
2022-02-15 13:00:46 -05:00
Louis Dionne 987c7f407d [libc++] Revert <stdatomic.h> changes
This reverts commits a30a7948d and 5d1c1a243, which broke the LLDB
data formatters tests because they build with modules in C++11 mode.

Differential Revision: https://reviews.llvm.org/D97044
2022-02-15 12:59:14 -05:00
Simon Moll de42307e44 [VE] Fix breakage after D118981
VE backend code expected all VP SDNode to have a mask parameter.  This
is not the case with vp.select|merge after D118981.
2022-02-15 18:56:20 +01:00
Jacques Pienaar 75044e9b4f [mlir] Flipping vector dialect to both prefixed form.
Following
https://discourse.llvm.org/t/psa-ods-generated-accessors-will-change-to-have-a-get-prefix-update-you-apis/4476

Mostly mechanical, avoiding function name conflicts.

Differential Revision: https://reviews.llvm.org/D119607
2022-02-15 09:48:51 -08:00
Christopher Di Bella d7b1c840ba [clangd][NFC] includes missing headers
`Shutdown.h` was transitively depending on two headers, but this isn't
allowed under a modules build, so they're now explicitly included.

Differential Revision: https://reviews.llvm.org/D119806
2022-02-15 17:44:47 +00:00
Konstantin Varlamov 49ff418ed5 [libc++][ranges][NFC] Small formatting fixes to the Ranges algorithms' status. 2022-02-15 09:43:29 -08:00
Jonas Devlieghere 6459fdf9a8 [lldb] Fix uninitialized variable in EvaluateExpressionOptions
Initialize m_pound_line_line to 0.
2022-02-15 09:40:09 -08:00
Peter Klausler 7763c01401 [flang] Accept pointer assignment w/ remapping to function result
When a pointer assignment with bounds remapping has a function
reference as its right-hand side, don't check for array conformance.

Differential Revision: https://reviews.llvm.org/D119845
2022-02-15 09:39:34 -08:00
Fangrui Song 3d85424096 [ELF] Parse archives as --start-lib object files
https://maskray.me/blog/2022-01-16-archives-and-start-lib

For every definition in an extracted archive member, we intern the symbol twice,
once for the archive index entry, once for the .o symbol table after extraction.
This is inefficient.

Symbols in a --start-lib ObjFile/BitcodeFile are only interned once because the
result is cached in symbols[i].

Just handle an archive using the --start-lib code path. We can therefore remove
ArchiveFile and LazyArchive. For many projects, archive member extraction ratio
is high and it is a net performance win. Linking a Release build of clang is
1.01x as fast.

Note: --start-lib scans symbols in the same order that llvm-ar adds them to the
index, so in the common case the semantics should be identical. If the archive
symbol table was created in a different order, or is incomplete, this strategy
may have different semantics. Such cases are considered user error.

The `is neither ET_REL nor LLVM bitcode` error is changed to a warning.
Previously an archive may have such members without a diagnostic. Using a
warning prevents breakage.

* For some tests, the diagnostics get improved where we did not consider
  the archive member name: `b.a:` => `b.a(b.o):`.
* `no-obj.s`: the link is now allowed, matching GNU ld
* `archive-no-index.s`: the `is neither ET_REL nor LLVM bitcode` diagnostic is
  demoted to a warning.
* `incompatible.s`: even when an archive is unextracted, we may report an
  "incompatible with" error.

---

I recently decreased sizeof(SymbolUnion) by 8 and decreased memory usage quite a
bit, so retaining `symbols` for un-extracted archive members should not cause a
memory usage problem.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D119074
2022-02-15 09:38:00 -08:00
Nico Weber b432eb5c84 [gn build] (manually) port 3b625060fc (-std=c++20) more
8c54583b2e ported this only for libcxx, not libcxxabi.
As of 05337a756c, it's needed for libcxxabi too.
2022-02-15 12:35:36 -05:00
Javier Setoain 71705f531f [mlir][Arith] Disallow casting between scalable and fixed-length vectors
Casting between scalable vectors and fixed-length vectors doesn't make
sense. If one of the operands is scalable, the other has to be scalable
to be able to guarantee they have the same shape at runtime.

Differential Revision: https://reviews.llvm.org/D119568
2022-02-15 17:34:42 +00:00
Jean Perier 5bde97b17e [flang][nfc] Update D119555 comments and use getVoidPtr
Minor comment updates and use getVoidPtr helper instead of
builiding `i8*` type manually in codegen.

Differential Revision: https://reviews.llvm.org/D119828
2022-02-15 18:24:04 +01:00
Simon Moll acc55adbc1 [VP] Condition in vp.select|merge not a VP mask
vp.select|merge both select lanes based on a condition mask.  Unlike
other VP intrinsics the lanes are defined where the condition mask is
false. Hence, the condition mask in vp.select|mask is not a mask in the
sense of VP intrinsics.  By doing not treating the condition mask
specially, vp.select becomes the canonical VP translation of the select
instruction.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D118981
2022-02-15 18:18:08 +01:00
Simon Moll 03e83cc8eb [VP] vp.fptosi cast intrinsic and docs
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D119535
2022-02-15 18:17:19 +01:00
Krzysztof Drewniak 1aa71944cf [MLIR][GPU] Add missing include to SerilazeToHsaco
Differential Revision: https://reviews.llvm.org/D119852
2022-02-15 17:11:33 +00:00
Marek Kurdej e21db15be8 [clang-format] Honour PointerAlignment in statements with initializers.
Fixes https://github.com/llvm/llvm-project/issues/53843.

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D119814
2022-02-15 18:06:32 +01:00
Tue Ly 9371d95ed2 [libc] Improve performance of generic hypot when the exponent difference is sufficiently large.
Simplify the logic when the exponent difference is at least MantissaLength + 2, while still maintaining correct rounding for all rounding modes.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D119843
2022-02-15 11:57:36 -05:00
Mark de Wever 097f0fd158 [libc++][nfc] Add TEST_HAS_NO_FGETPOS_FSETPOS.
This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D119742
2022-02-15 17:50:56 +01:00