Commit Graph

415284 Commits

Author SHA1 Message Date
Anastasia Stulova fdd615d4f9 [Docs][OpenCL] Update OpenCL 3.0 status in docs.
Reflect the latest development in clang docs.

Differential Revision: https://reviews.llvm.org/D119719
2022-02-16 12:32:20 +00:00
Nathan Sidwell 6244730e29 [demangler] Reorder parseNestedName loop
parseNestedName's main loop allowed parsing a grammar that was more
flexible than the actual grammar.  This refactors that to rule out
some more incorrect manglings.

1) The 'L' extension only applies to unqualified-name components, so
check it just there.

2) The 'M' suffix is, AFAICT, removed from the grammar.  Rather than
eliminate it, let's parse it after we've parsed a component.

Added some additional bad mangling tests, which are now rejected.

I don't break the 'T' and 'D[tT]' cases out of the loop, even though
they can only appear at first position, as it seems simpler to just
check there is nothing SoFar.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D119542
2022-02-16 04:30:47 -08:00
Nathan Sidwell 082f328899 [clang] Itanium mangler constructors
The Itanium mangler constructors use both NSDMI and explicit member
construction for default values.  This is confusing.

*) Use NSDMIs wherever possible

*) Use forwarding ctor for the nesting case with an
 llvm::raw_null_ostream (and explicitly set NullOut flag in that ctor).

*) Copy the ModuleSubstitutions.  This is a bug with no effect in the
 current mangling, but not in the newer mangling.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D119550
2022-02-16 04:30:47 -08:00
Nemanja Ivanovic d32b875dbc [ELF][test] Fix build break after 20bdd3e232
The added run lines build a bitcode file for x86 and an object file
for whatever the default target is that is running the test. This
causes an incompatibility between the files.
Add the triple to the llvm-mc invocation.
2022-02-16 05:56:25 -06:00
Florian Hahn 85fd97e3b9
[MemCpyOpt] Add tests with incorrect memcpy->byval forwarding.
Add a few test cases with clobbers (writes and lifetime.end) that should
prevent memcpy->byval forwarding, but those clobbers are missed at the
moment.
2022-02-16 11:35:14 +00:00
Andrzej Warzynski dda3c14fd7 [flang] Fix `LoweringBridge::validModule`
This patch updates `validModule` not to use `getModule`.  `getModule`
will dereference `module`, but that will lead to a seg-fault if `module`
is a `nullptr`.

Differential Revision: https://reviews.llvm.org/D119705
2022-02-16 10:41:57 +00:00
Shengchen Kan ce02c79dc6 [Debugify] Mark mir-check-debugify change nothing of input
Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D119914
2022-02-16 18:37:26 +08:00
Pavel Labath 9bde881823 [lldb] Enable TestThreadStepOut on linux
After applying the same for as in TestThreadBacktraceRepeat, the test
appears to pass reliably. The skip decorator was added many years ago,
so it's not clear whether this is what caused it to hang.
2022-02-16 11:18:13 +01:00
Sven van Haastregt 477bc8e8b9 [OpenCL] Guard atomic_double with cl_khr_int64_*
It is necessary to guard atomic_double type according to
https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#_footnotedef_54.
Platform that disable cl_khr_int64_base_atomics and
cl_khr_int64_extended_atomics will have compiling errors even if
atomic_double is not used.

Patch by Haonan Yang.

Differential Revision: https://reviews.llvm.org/D119398
2022-02-16 10:07:35 +00:00
Arlo Siemsen 1ccfef14e5 Add a case for Rust in LLDB's PDB reader
D115300 added Rust as a new PDB language type.

This change allows LLDB to recognize the new language type.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D119044
2022-02-16 09:58:05 +00:00
Balazs Benics 4642c640f4 [analyzer] Remove breaking RUN line in the test case
This is a followup for D118690.
I'm removing the offending RUN line, to resolve the build breakage:

https://lab.llvm.org/buildbot/#/builders/91/builds/3975/steps/8/logs/stdio

Exit Code: 1
Command Output (stderr):
--
/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/clang/test/Analysis/analyze-function-guide.cpp:58:22:
error: CHECK-EMPTY2-NOT: excluded string found in input
// CHECK-EMPTY2-NOT: Every top-level function was skipped.
                     ^
<stdin>:1:1: note: found here
Every top-level function was skipped.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://reviews.llvm.org/D118690
2022-02-16 10:56:18 +01:00
Sheng 4306fbff9c Revert "Revert "[M68k] Adopt VarLenCodeEmitter for control instructions""
This reverts commit 69a7d49de6.

llvm/test/MC/M68k/Relaxations/branch.s needs disassembler support.

So I disabled it temporarily
2022-02-16 17:41:49 +08:00
Balazs Benics b3c0014e5a Revert "Revert "[analyzer] Prevent misuses of -analyze-function""
This reverts commit 620d99b7ed.

Let's see if removing the two offending RUN lines makes this patch pass.
Not ideal to drop tests but, it's just a debugging feature, probably not
that important.
2022-02-16 10:33:21 +01:00
Sheng 69a7d49de6 Revert "[M68k] Adopt VarLenCodeEmitter for control instructions"
This reverts commit 9ffd498fcb.

This patch introduce regression on MC/M68k/Relaxations/branch.s
2022-02-16 17:09:46 +08:00
Nikita Popov 2d2ef384b2 [libunwind] Only include cet.h if __CET__ defined
We should not assume that the cet.h header exists just because
we're on x86 linux. Only include it if __CET__ is defined. This
makes the code more similar to what compiler-rt does in
ee423d93ea/compiler-rt/lib/builtins/assembly.h (L17)
(though that one also has a __has_include() check -- I've not found
that to be necessary).

Differential Revision: https://reviews.llvm.org/D119697
2022-02-16 09:45:54 +01:00
Nikita Popov b66b3247f5 [Support] Use posix_madvise() if available
This is a followup to D119695 using the suggestion by joerg. Rather
than manually declaring madvise() on __sun__, this uses
posix_madvise() if available, which does get declared properly on
Illumos.

Differential Revision: https://reviews.llvm.org/D119856
2022-02-16 09:36:41 +01:00
Qiu Chaofan e30efa0304 [NFC] Fix intel intrinsics test for PowerPC
These tests are dumped without optimization, which makes them too
lengthy and contain meaningless load/stores. Clean them up to prepare
for future headers update.
2022-02-16 16:16:30 +08:00
Jan Svoboda b223e5f846 [Bitstream] Remove pessimizing move
Commit 4a794d848c caused build failure with -Werror -Wpessimizing-move on the clang-ppc64-aix buildbot. This patch applies Clang's suggestion to remove `std::move`.
2022-02-16 08:23:02 +01:00
Zakk Chen e8973dd389 [RISCV] Add the passthru operand for some RVV nomask unary and nullary intrinsics.
The goal is support tail and mask policy in RVV builtins.
We focus on IR part first.
If the passthru operand is undef, we use tail agnostic, otherwise
use tail undisturbed.

My plan is to handle more complex operations in follow-up patches.

Reviewers: frasercrmck

Differential Revision: https://reviews.llvm.org/D118253
2022-02-15 22:34:06 -08:00
Siva Chandra Reddy 86bebe1a90 [lib][Obvious] Fix style in a few include directives. 2022-02-16 05:57:12 +00:00
Chuanqi Xu a2609be0b2 [ValueTracking] Checking haveNoCommonBitsSet for (x & y) and ~(x | y)
This one tries to fix:
https://github.com/llvm/llvm-project/issues/53357.

Simply, this one would check (x & y) and ~(x | y) in
haveNoCommonBitsSet. Since they shouldn't have common bits (we could
traverse the case by enumerating), and we could convert this one to (x &
y) | ~(x | y) . Then the compiler could handle it in
InstCombineAndOrXor.
Further more, since ((x & y) + (~x & ~y)) would be converted to ((x & y)
+ ~(x | y)), this patch would fix it too.

https://alive2.llvm.org/ce/z/qsKzRS

Reviewed By: spatel, xbolva00, RKSimon, lebedev.ri

Differential Revision: https://reviews.llvm.org/D118094
2022-02-16 13:42:52 +08:00
Chuanqi Xu d30ca5e2e2 [C++20] [Coroutines] Implement return value optimization for get_return_object
This patch tries to implement RVO for coroutine's return object got from
get_return_object.
From [dcl.fct.def.coroutine]/p7 we could know that the return value of
get_return_object is either a reference or a prvalue. So it makes sense
to do copy elision for the return value. The return object should be
constructed directly into the storage where they would otherwise be
copied/moved to.

Test Plan: folly, check-all

Reviewed By: junparser

Differential revision: https://reviews.llvm.org/D117087
2022-02-16 13:38:00 +08:00
Shao-Ce SUN 2aed07e96c [NFC][MC] remove unused argument `MCRegisterInfo` in `MCCodeEmitter`
Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D119846
2022-02-16 13:10:09 +08:00
Sheng 314155eb8f [TableGen][VarLenCodeEmitterGen] Improve the error message
This gives a approximate error location. Although not very
accurate, it suffices to debug.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D119684
2022-02-16 12:56:18 +08:00
Sheng 9ffd498fcb [M68k] Adopt VarLenCodeEmitter for control instructions
Refactor the instructions in M68kInstrControl.td to use the VarLenCodeEmitter.

This patch is tested by the existing test cases.

Reviewed By: myhsu, ricky26

Differential Revision: https://reviews.llvm.org/D119665
2022-02-16 12:54:20 +08:00
Min-Yih Hsu 53a2bf8ac7 [M68k][VarLenCodeEmitter] Support reloc & pc-rel immediate values
Supporting relocatable and pc-relative immediate values for the new code
emitter.

Differential Revision: https://reviews.llvm.org/D119101
2022-02-15 20:41:33 -08:00
Jonas Devlieghere 920146316d [lldb] Don't rely on wrapping in PutRawBytes/PutBytesAsRawHex8
I was looking at Stream::PutRawBytes and thought I spotted a bug because
both loops are using `i < src_len` as the loop condition despite them
iterating in opposite directions.

On closer inspection, the existing code is correct, because it relies on
well-defined unsigned integer wrapping. Correct doesn't mean readable,
so this patch changes the loop condition to compare against 0 when
decrementing i while still covering the edge case of src_len potentially
being 0 itself.

Differential revision: https://reviews.llvm.org/D119857
2022-02-15 20:38:25 -08:00
Mubariz Afzal 1a5b881d4c Revert [SystemZ][z/OS] Fix f32 variadic argument assertion
This reverts ea0676f97d
2022-02-15 23:28:40 -05:00
Serguei Katkov 15f1cffb3a [MemoryDependency] Relax the re-ordering with volatile store.
Volatile store does not provide any special rules for reordering with
atomics. Usual must alias anaylsis is enough here.

This makes the bahavior similar to how volatile load is handled.

Reviewers: reames, nikic
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D119818
2022-02-16 10:58:48 +07:00
Shao-Ce SUN 9cc49c1951 Revert "[NFC][MC] remove unused argument `MCRegisterInfo` in `MCCodeEmitter`"
This reverts commit fe25c06cc5.
2022-02-16 11:57:49 +08:00
Shao-Ce SUN fe25c06cc5 [NFC][MC] remove unused argument `MCRegisterInfo` in `MCCodeEmitter`
For ten years, it seems that `MCRegisterInfo` is not used by any target.

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D119846
2022-02-16 11:47:17 +08:00
Jeff Bailey 171cb8f53f Rewrite much of the index page for libc
The prior page was the proposal doc, this one is now
more about what the project intends to do, written in the
present tense.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D119379
2022-02-16 03:46:20 +00:00
Carl Ritson ef949ecba5 [MachineSink] Use SkipPHIsAndLabels for sink insertion points
For AMDGPU the insertion point for a block may not be the first
non-PHI instruction.  This happens when a block contains EXEC
mask manipulation related to control flow (converging lanes).

Use SkipPHIsAndLabels to determine the block insertion point
so that the target can skip any block prologue instructions.

Reviewed By: rampitec, ruiling

Differential Revision: https://reviews.llvm.org/D119399
2022-02-16 12:44:22 +09:00
Jeff Bailey 55120aad4e Implement basic loader for Linux aarch64
This implements a basic arm64 loader for Linux, and all the currently
enabled linker tests pass.  TLS is not implemented, and functions
using it will have undefined behaviour.  Notably, the TLS test is
currently disabled on x86_64.

Much of the structure is copied from x86_64 to allow for a refactoring
of the start code between architectures.

Tested:
ninja libc_loader_tests on aarch64-linux.

Co-authored-by: Raman Tenneti <rtenneti@google.com>

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D119641
2022-02-16 03:42:44 +00:00
Serguei Katkov 2e487da3cb [MemoryDepndency] Add a test for re-ordering with volatile load/store. 2022-02-16 10:27:11 +07:00
Nico Weber 5d110ed4cd Revert "[NFC] Update new warning to test"
This reverts commit 25cdf87b13.
125abb61f7 reverted the patch.

It is incorrect to update this file when a flagless warning is added.
This test exists to make sure _all_ warnings are behind a flag.
The right fix is to put the new warning in a warning group (so that
it can be toggled with a flag), not to update the list here.
2022-02-15 22:23:26 -05:00
Nikolas Klauser f75f171b20 [libc++] Remove cpp17_input_iterator.h
Reviewed By: Quuxplusone, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D119881
2022-02-16 04:17:40 +01:00
Mahesh Ravishankar 2c58cde003 [mlir][Linalg] Add pattern for folding reshape by collapsing.
Fusion of `linalg.generic` with
`tensor.expand_shape/tensor.collapse_shape` currently handles fusion
with reshape by expanding the dimensionality of the `linalg.generic`
operation. This helps fuse elementwise operations better since they
are fused at the highest dimensionality while keeping all indexing
maps involved projected permutations. The intent of these is to push
the reshape to the boundaries of functions.

The presence of named ops (or other ops across which the reshape
cannot be propagated) stops the propagation to the edges of the
function. At this stage, the converse patterns that fold the reshapes
with generic ops by collapsing the dimensions of the generic op can
push the reshape towards edges. In particular it helps the case where
reshapes exist in between named ops and generic ops.

`linalg.named_op` -> `tensor.expand_shape` -> `linalg.generic`

Pushing the reshape down will help fusion of `linalg.named_op` ->
`linalg.generic` using tile + fuse transformations.

This pattern is intended to replace the following patterns

1) FoldReshapeByLinearization : These patterns create indexing maps
that are not projected permutations that affect future
transformations. They are only useful for folding unit-dimensions.
2) PushReshapeByExpansion : This pattern has the same functionality
but has some restrictions
    a) It tries to avoid creating new reshapes that limits its
    applicability. The pattern added here can achieve the same
    functionality through use of the `controlFn` that allows clients
    of the pattern freedom to make this decision.
    b) It does not work for ops with indexing semantics.

These patterns will be deprecated in a future patch.

Differential Revision: https://reviews.llvm.org/D119365
2022-02-16 03:15:20 +00:00
Nikolas Klauser 2e2f3158c6 [libc++] Granularize algorithm includes
Reviewed By: Mordante, ldionne, Quuxplusone, #libc, #libc_abi

Spies: #libc_vendors, libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D119667
2022-02-16 04:12:22 +01:00
Nico Weber 125abb61f7 Revert "Add support for floating-point option `ffp-eval-method` and for"
This reverts commit 4bafe65c2b.
Breaks at least Misc/warning-flags.c, see comments on
https://reviews.llvm.org/D109239
2022-02-15 22:02:25 -05:00
Chuanqi Xu 25cdf87b13 [NFC] Update new warning to test
This tries to fix the broke test introduced in
4bafe65c2b.
2022-02-16 10:51:56 +08:00
Bin Cheng dfec0b3053 [FuncSpec] Save compilation time by caching uses for propagation
We only need to do propagation on use instructions of the original
value, rather than the replacing const value which might have lots
of irrelavant uses.  This is done by caching uses before replacing.

Differential Revision: https://reviews.llvm.org/D119815
2022-02-16 10:46:26 +08:00
Zakk Chen b784719904 [RISCV] Add the passthru operand for RVV nomask binary intrinsics.
The goal is support tail and mask policy in RVV builtins.
We focus on IR part first.
If the passthru operand is undef, we use tail agnostic, otherwise
use tail undisturbed.

Add passthru operand for VSLIDE1UP_VL and VSLIDE1DOWN_VL to support
i64 scalar in rv32.

The masked VSLIDE1 would only emit mask undisturbed policy regardless
of giving mask agnostic policy until InsertVSETVLI supports mask agnostic.

Reviewed by: craig.topper, rogfer01

Differential Revision: https://reviews.llvm.org/D117989
2022-02-15 18:36:18 -08:00
Jez Ng aa108fffec [lld-macho][nfc] Clean up trailing spaces and tabs 2022-02-15 21:33:26 -05:00
Matt Arsenault 898dc8a4b1 AMDGPU: Use subtarget in class instead of querying function 2022-02-15 21:28:12 -05:00
Jez Ng 94c28d289a [lld-macho][nfc] Factor out callgraph parsing code
`parseSections()` is a getting a bit large unwieldy, let's factor out
logic where we can.

Other minor changes in this diff:
* `"__cg_profile"` is now a global constexpr
* We now use `checkError()` instead of `fatal()`-ing without handling
  the Error
* Check for `callGraphProfileSort` before checking the section name,
  since the boolean comparison is likely cheaper

Reviewed By: #lld-macho, lgrey, oontvoo

Differential Revision: https://reviews.llvm.org/D119892
2022-02-15 21:13:55 -05:00
Alexander Yermolovich bd1ebe9d04 [BOLT][DWARF] Add ability to insert new entries in to DIE
Added ability to append new entries to DIE. This is useful to standadize DWARF4
Split Dwarf, and simplify implementation of DWARF5.
Multiple DIEs can share an abbrev. So currently limitation is that only unique
Attributes can be added.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D119577
2022-02-15 18:07:19 -08:00
Richard Smith 13b6f31548 Fix crash when deserializing a lambda expression in a decltype. 2022-02-15 17:56:45 -08:00
Fangrui Song 20bdd3e232 [ELF][test] Improve LTO duplicate symbol test 2022-02-15 17:54:38 -08:00
zhongyunde 064b2a6dc6 [DAGCombiner][AArch64] Enhance to fold CSNEG into CSINC instruction
Perform the scalar expression combine in the form of:
  CSNEG(1, c, cc) + b  =>  cc  ? b+1 : b-c => CSINC(b-c, b, !cc)
  CSNEG(c, -1, cc) + b =>  cc  ? b+c : b+1 => CSINC(b+c, b, cc)

Fix https://github.com/llvm/llvm-project/issues/53071

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D119105
2022-02-16 09:39:38 +08:00