Commit Graph

413991 Commits

Author SHA1 Message Date
Sanjay Patel 897d92faef [InstCombine] generalize 2 LSB of demanded bits for X*X
This is a follow-up suggested in D119060.
Instead of checking each of the bottom 2 bits individually,
we can check them together and handle the possibility that
we demand both together.

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

Differential Revision: https://reviews.llvm.org/D119139
2022-02-07 11:33:55 -05:00
Adrian Prantl d42765b3be Add llgs category to all tests in TestLldbGdbServer that attach to the process. 2022-02-07 08:26:48 -08:00
David Goldman f98bf92b62 Reland "[clangd] Properly compute framework-style include spelling"
Roll forward of https://reviews.llvm.org/D117056 with a fix. Proper
initialization of `IsPrivateHeader` was missing, causing failures
on Linux.
2022-02-07 11:21:23 -05:00
Nathan Sidwell ad46cf14d4 [demangler] Stricter NestedName parsing
The parsing of nested names is a little lax.  This corrects that.

1) The 'L' local name prefix cannot appear before a NestedName -- only
within it.  Let's remove that check from parseName, and then adjust
parseUnscopedName to allow it with or without the 'St' prefix.

2) In a nested name, a <template-param>, <decltype> or <substitution>
can only appear as the first element.  Let's enforce that.  Note I do
not remove these from the loop, to make the change easier to follow
(such a change will come later).

3) Given that, there's no need to special case 'St' outside of the
loop, handle it with the other 'S' elements.

4) There's no need to reset 'EndsWithTemplateArgs' after each
non-template-arg component.  Rather, always clear it and then set it
in the template-args case.

5) An template-args cannot immediately follow a template-args.

6) The parsing of a CDtor name with ABITags would attach the tags to
the NestedName node, rather than the CDTor node.  This is different to
how ABITags are attached to an unscopedName.  Make it consistent.

7) We remain with only CDTor and UnscopedName requireing construction
of a NestedName, so let's drop the PushComponent lambda.

8) Add some tests to catch the new rejected manglings.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D118132
2022-02-07 08:20:45 -08:00
Jonas Devlieghere d63dfa14d6 [lldb] Update outdated comment in TestDyldTrieSymbols.py
After aed965d55d we no longer demangle and store the full name. The
test was updated accordingly but the comment still specified that we
should be able to find the symbol by its full demangled name.
2022-02-07 08:13:54 -08:00
Nikita Popov c45a99f36b [MatrixBuilder] Require explicit element type in CreateColumnMajorLoad()
This makes the method compatible with opaque pointers.
2022-02-07 16:57:33 +01:00
Hans Wennborg 807e2f12fa Revert "Remove -Wweak-template-vtables"
Turns out there's still some code referencing this. No harm in keeping it in a
bit longer.

> as it was planned for removal in clang 15 and we're now past the branch point
>
> See https://github.com/llvm/llvm-project/issues/19107
>
> Differential revision: https://reviews.llvm.org/D118762

This reverts commit 564f9be11c.
2022-02-07 16:52:23 +01:00
Nikita Popov 4d30a245c9 [mlir] Remove MatrixBuilder template argument
I dropped this argument in cdc0573f75,
but did not adjust mlir. (Or rather I did, but I modified a generated
file ... oops)
2022-02-07 16:52:10 +01:00
Nathan Sidwell 8d38273a3d [demangler] Fix unresolvedname demangling
We were dropping the [gs] modifier by parsing it in parseExpr, but not
forwarding it on to parseUnresolvedName.  This is the straightforwards
fix to forward that flag -- parseExpr must see past it.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D118504
2022-02-07 07:49:30 -08:00
Nathan Sidwell 704b21cb4f [demangler] Remove StdQualifiedName
The StdQualifiedName node class is used for names exactly in the std
namespace.  It is not used for nested names that descend further --
those use a NestedName with NameType("std") as the scope.
Representing the compression scheme in the node graph is layer
breaking.  We can use the same structure for those exactly in std too,
and reduce code size a bit.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D118249
2022-02-07 07:49:30 -08:00
Mark Murray 3d7662142d [ARM] Undeprecate complex IT blocks
AArch32/Armv8A  introduced the performance deprecation of certain patterns
of IT instructions.  After some debate internal to ARM, this is now being
reverted; i.e. no IT instruction patterns are performance deprecated
anymore, as the perfomance degredation is not significant enough.

This reverts the following:

"ARMv8-A deprecates some uses of the T32 IT instruction. All uses of
IT that apply to instructions other than a single subsequent 16-bit
instruction from a restricted set are deprecated, as are explicit
references to the PC within that single 16-bit instruction. This permits
the non-deprecated forms of IT and subsequent instructions to be treated
as a single 32-bit conditional instruction."

The deprecation no longer applies, but the behaviour may be controlled
by the -arm-restrict-it and -arm-no-restrict-it command-line options,
with the latter being the default. No warnings about complex IT blocks
will be generated.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D118044
2022-02-07 15:47:53 +00:00
Nikita Popov cdc0573f75 [MatrixBuilder] Remove unnecessary IRBuilder template (NFC)
IRBuilderBase exists specifically to avoid the need for this.
2022-02-07 16:42:38 +01:00
Volodymyr Turanskyy c127ba25fb Add LLVM Embedded Toolchains call to the table of sync ups.
LLVM Embedded Toolchains working group regular sync up calls to start in early
March, adding details to the table of sync ups for general reference.

Differential Revision: https://reviews.llvm.org/D118884
2022-02-07 16:38:42 +01:00
Sanjay Patel 40a50f8701 [x86] avoid false dependency stall on 'sbb' with same source reg
This is effectively inverting the transform added with D116804
because the downside of the false dependency of something like
"sbb %eax, %eax" is much greater than the upside of eliminating
a zeroing instruction on (all?) Intel CPUs.

Differential Revision: https://reviews.llvm.org/D118843
2022-02-07 10:12:12 -05:00
Sanjay Patel 3c33b20eaa [InstCombine] add test for demanded 2 low bits of X*X; NFC 2022-02-07 10:07:38 -05:00
Matt Arsenault 31973062ec AMDGPU: Fix clobbering SCC when expanding large offset spill pseudos
If we had a large offset which required materializing in a register,
we would emit an s_add_i32, clobbering SCC. Start checking if SCC is
live, and instead use a VGPR offset. For MUBUF, we switch to using
offen. We would do this anyway in a normal load/store with a frame
index, but not for spills.

The same problem still exists in other contexts where we expand frame
indices.

The nasty edge case is when SGPRs are spilled to memory at a large
frame offset where SCC is also clobbered. This requires a second
scavenging index, and also required several patches in the scavenger
to correctly handle multiple recursive scavenge indexes.

An even nastier edge case we still don't support is if we don't have
any free SGPRs. If SCC is live and we don't have any free SGPRs to
save exec, we have no way of flipping exec back and forth without also
clobbering SCC.

Fixes: SWDEV-309419
2022-02-07 10:02:03 -05:00
David Truby be826cf4f7
[AArch64][NEON][SVE] Lower FCOPYSIGN using AArch64ISD::BSP
This patch modifies the FCOPYSIGN lowering to go through the BSP
pseudo-instruction. This allows the same lowering code for NEON,
SVE and SVE2.

As part of this, lowering for BSP for SVE and SVE2 is also added.

For SVE and NEON this patch is NFC.

Differential Revision: https://reviews.llvm.org/D118394
2022-02-07 14:35:26 +00:00
Aaron Ballman 22db4824b9 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the third batch of tests being updated (there are a significant
number of other tests left to be updated).
2022-02-07 09:25:01 -05:00
ksyx a70549ae43 [clang-format] Fix DefSeparator empty line issues
- Add or remove empty lines surrounding union blocks.
- Fixes https://github.com/llvm/llvm-project/issues/53229, in which
  keywords like class and struct in a line ending with left brace or
  whose next line is left brace only, will be falsely recognized as
  definition line, causing extra empty lines inserted surrounding blocks
  with no need to be formatted.

Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D119067
2022-02-07 14:23:21 +00:00
Kim Gräsman d7ddad408f Reformat CastExpr unittest suite; NFC
In preparation for adding new tests. No functional change.
2022-02-07 09:21:41 -05:00
Pavel Labath a53c5c66b3 [lldb/Platform] s/m_name/m_hostname
m_name is confusing, as there is a getter called GetName, but it returns
a completely different thing.
2022-02-07 14:58:55 +01:00
Balázs Kéri 29fc5e0245 [clang-tidy] Fixed a compile warning (NFC).
Fixed a "override" related warning in SharedPtrArrayMismatchCheck.h.
Related to differential revision: https://reviews.llvm.org/D117306
2022-02-07 14:56:27 +01:00
Sanjay Patel 79b3fe8070 [InstCombine] SimplifyDemandedBits - mul(x,x) is odd iff x is odd
https://alive2.llvm.org/ce/z/AXPr3k
2022-02-07 08:43:12 -05:00
Nikita Popov 149195f576 [PPCISelLowering] Avoid use of getPointerElementType()
Use the value type instead.
2022-02-07 14:30:15 +01:00
Bjorn Pettersson acdc419c89 [test] Use -passes=instcombine instead of -instcombine in lots of tests. NFC
Another step moving away from the deprecated syntax of specifying
pass pipeline in opt.

Differential Revision: https://reviews.llvm.org/D119081
2022-02-07 14:26:59 +01:00
Bjorn Pettersson b280ee1dd7 [test] Use -passes=instsimplify instead of -instsimplify in a number of tests. NFC
Another step moving away from the deprecated syntax of specifying
pass pipeline in opt.

Differential Revision: https://reviews.llvm.org/D119080
2022-02-07 14:26:58 +01:00
Nikita Popov b7767c71c9 [OMPIRBuilder] Avoid use of getPointerElementType()
Looks like I missed this call when removing others in this file.
2022-02-07 14:22:34 +01:00
Roman Lebedev 77a0da926c
[LV] Remove `LoopVectorizationCostModel::useEmulatedMaskMemRefHack()`
D43208 extracted `useEmulatedMaskMemRefHack()` from legality into cost model.
What it essentially does is prevents scalarized vectorization of masked memory operations:
```
  // TODO: Cost model for emulated masked load/store is completely
  // broken. This hack guides the cost model to use an artificially
  // high enough value to practically disable vectorization with such
  // operations, except where previously deployed legality hack allowed
  // using very low cost values. This is to avoid regressions coming simply
  // from moving "masked load/store" check from legality to cost model.
  // Masked Load/Gather emulation was previously never allowed.
  // Limited number of Masked Store/Scatter emulation was allowed.
```

While i don't really understand about what specifically `is completely broken`
was talking about, i believe that at least on X86 with AVX2-or-later,
this is no longer true. (or at least, i would like to know what is still broken).
So i would like to follow suit after D111460, and like wise disable that hack for AVX2+.

But since this was added for X86 specifically, let's just instead completely remove this hack.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D114779
2022-02-07 16:08:31 +03:00
Kadir Cetinkaya f59787084e
[clang][Lexer] Fix tests after ff77071a4d 2022-02-07 14:06:32 +01:00
Simon Pilgrim 2e0409a545 [X86][SSE] Add some initial PAVGB/PAVGW tests
Once D119073 has landed, I'll start addressing these
2022-02-07 12:58:47 +00:00
Florian Hahn ef4df27940
[LV] Modernize some runtime check tests a bit.
Update tests to check runtime checks a bit more precisely.
2022-02-07 12:08:56 +00:00
LLVM GN Syncbot 05a374fa69 [gn build] Port c63522e6ba 2022-02-07 11:59:15 +00:00
Balázs Kéri c63522e6ba [clang-tidy] Add new check 'shared-ptr-array-mismatch'.
Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D117306
2022-02-07 12:57:58 +01:00
Rainer Orth 9576698a3e [DebugInfo][test] XFAIL DebugInfo/Generic/missing-abstract-variable.ll on SPARC
`DebugInfo/Generic/missing-abstract-variable.ll` `FAIL`s on SPARC.  When
`x` is inlined into `a`, the variable `s` is elided completely, so the
corresponding `CHECK`s fail.  Exactly the same happens on RISCV and the
test has already been `XFAIL`ed there.

This patch does the same on SPARC.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D119122
2022-02-07 12:43:56 +01:00
Nikita Popov f4fca0fbb0 [Bitcode] Replace assertion with check 2022-02-07 12:39:35 +01:00
Nikita Popov 747fab903f [Bitcode] Add missing test file
This was supposed to be part of
ec18030f5f.
2022-02-07 12:37:21 +01:00
Nikita Popov fdf8cb978f [Bitcode] Handle invalid data layout gracefully 2022-02-07 12:28:15 +01:00
Valentin Clement a8d48fe0fe
[flang] Handle character constant for error code in STOP stmt
Handle character constant ofr error code in the STOP statement.

Depends on D118992

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

Reviewed By: kiranchandramohan, schweitz

Differential Revision: https://reviews.llvm.org/D118993
2022-02-07 12:19:55 +01:00
Valentin Clement 74751f4b0c
[flang] Add lowering for ASCII character constant
Lower character constant of KIND = 1 with the
`createStringLiteral` helper function.

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

Reviewed By: kiranchandramohan, schweitz

Differential Revision: https://reviews.llvm.org/D118992
2022-02-07 12:17:41 +01:00
Nikita Popov 0c553bff8e [Bitcode] Guard against out of bounds value reference
We should make sure that the value ID is in bounds, otherwise
we will assert / read out of bounds.
2022-02-07 12:16:13 +01:00
Nikita Popov ec18030f5f [Bitstream] Check that there is enough space for blob
Instead of simply assuming that it will be zero. I double checked
that the bitstream reader doesn't have any special handling for
all-zero blobs, it will always write out the full contents.
2022-02-07 12:16:13 +01:00
Nikita Popov 89017772d9 [Bitcode] Don't assert on invalid attribute group record
Report an error instead.
2022-02-07 12:16:12 +01:00
Nikita Popov 3c86642edd [Bitstream] Reject implausibly large reservations
If we're trying to reserve more memory than bits in the stream,
reject this early to avoid OOM.
2022-02-07 12:16:12 +01:00
Valentin Clement b880455768
[flang] Remove unused converter for now
AbstractConverter private variable is currently not used
and triggers a buildbot failure.

https://lab.llvm.org/buildbot/#/builders/180/builds/3119

This fixes the buildbot.
2022-02-07 11:56:06 +01:00
Sven van Haastregt c15782bcf5 [OpenCL] opencl-c.h: make attribute order consistent; NFC
For most builtins, `__purefn` always comes after `__ovld`, but the
read_image functions did not follow this pattern.
2022-02-07 10:54:55 +00:00
Igor Kirillov 4ae885b1e3 [OpenMP] kmp_atomic_float10_max_min.c test should only be executed on x86 platform
Differential Revision: https://reviews.llvm.org/D118988
2022-02-07 10:07:54 +00:00
Dimitry Andric 28fb22c90f [TSan] Handle FreeBSD specific indirection of libpthread functions
Similar to 60cc1d3218 for NetBSD, add aliases and interceptors for the
following pthread related functions:

- pthread_cond_init(3)
- pthread_cond_destroy(3)
- pthread_cond_signal(3)
- pthread_cond_broadcast(3)
- pthread_cond_wait(3)
- pthread_mutex_init(3)
- pthread_mutex_destroy(3)
- pthread_mutex_lock(3)
- pthread_mutex_trylock(3)
- pthread_mutex_unlock(3)
- pthread_rwlock_init(3)
- pthread_rwlock_destroy(3)
- pthread_rwlock_rdlock(3)
- pthread_rwlock_tryrdlock(3)
- pthread_rwlock_wrlock(3)
- pthread_rwlock_trywrlock(3)
- pthread_rwlock_unlock(3)
- pthread_once(3)
- pthread_sigmask(3)

In FreeBSD's libc, a number of internal aliases of the pthread functions
are invoked, typically with an additional prefixed underscore, e.g.
_pthread_cond_init() and so on.

ThreadSanitizer needs to intercept these aliases too, otherwise some
false positive reports about data races might be produced.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D119034
2022-02-07 11:01:37 +01:00
Simon Pilgrim 74555fd367 [DAG] visitINSERT_VECTOR_ELT - break if-else chain as they both return (style). NFC. 2022-02-07 09:58:47 +00:00
Simon Pilgrim d7be2bff16 [X86] combineShiftRightArithmetic - break if-else chain as they all return (style). NFC. 2022-02-07 09:54:34 +00:00
Simon Pilgrim 5d3a86489f [GlobalISel] Move getOpcode() calls inside assert() to avoid (void)s. NFC.
Tidier solution to the unused variable warnings - we already do this in other places in this file.
2022-02-07 09:50:27 +00:00