Commit Graph

428688 Commits

Author SHA1 Message Date
Jennifer Yu 927156a674 Generate the capture for the field when the field is used in openmp
region with implicit default inside the member function.

This is to fix assert when field is referenced in OpenMP region with
default (first|private) clause inside member function.

The problem of assert is that the capture is not generated for the field.

This patch is to generate capture when the field is used with implicit
default, use it in the code, and save the capture off to make sure it is
considered from that point and add first/private clauses.

1> Add new field ImplicitDefaultFirstprivateFDs in SharingMapTy, used to
   store generated capture fields info.
2> In function isOpenMPCaptureDecl: the caputer is generated and saved
   in ImplicitDefaultFirstprivateFDs.
3> Add new help functions:
   getImplicitFDCapExprDecl
   isImplicitDefaultFirstprivateFD
   addImplicitDefaultFirstprivateFD
4> Add addition argument in hasDSA to check default attribute for
   default(first|private).
5> The isImplicitDefaultFirstprivateFD is used in VisitDeclRefExpr to
   build the implicit clause.
6> Add new parameter "Context" for buildCaptureDecl, due to when capture
   field, the parent context is needed to be used.
7> Change in isOpenMPPrivateDecl where stop propagate the capture from
   the enclosing region for private variable.
8> In ActOnOpenMPFirstprivate/ActOnOpenMPPrivate, using captured info
   to generate first|private clause.
9> Add new function isOpenMPRebuildMemberExpr: use to determine if field
   needs to be rebuild during template instantiation.

Differential Revision: https://reviews.llvm.org/D127803
2022-07-01 17:09:01 -07:00
LLVM GN Syncbot 17c8119564 [gn build] Port 94c7b89fe5 2022-07-01 23:35:58 +00:00
Konstantin Varlamov 94c7b89fe5 [libc++][ranges] Implement `ranges::stable_sort`.
Differential Revision: https://reviews.llvm.org/D127834
2022-07-01 16:34:26 -07:00
Vitaly Buka f2fa4f9759 [sanitizer] Update dn_expand interceptor for glibc 2.34
Symbol changed with 640bbdf71c6f10ac26252ac67a22902e26657bd8
2022-07-01 16:26:58 -07:00
Nuno Lopes 7c4f45f87a Revert [LowerMatrixMultiplication] Switch dummy values from undef to poison [NFC]
This reverts commits 47e6f98f84 and 3e701bcd2a
2022-07-01 23:53:41 +01:00
Nuno Lopes 3e701bcd2a attempt to fix aarch64 build bot 2022-07-01 23:43:48 +01:00
Nuno Lopes 47e6f98f84 [LowerMatrixMultiplication] Switch dummy values from undef to poison [NFC] 2022-07-01 23:31:31 +01:00
Maksim Panchenko 3a47037fcc [BOLT] Fix instrumentation problem with floating point
If BOLT instrumentation runtime uses XMM registers, it can interfere
with the user program causing crashes and unexpected behavior. This
happens as the instrumentation code preserves general purpose registers
only.

Build BOLT instrumentation runtime with "-mno-sse".

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D128960
2022-07-01 15:29:36 -07:00
Fangrui Song fd25a0aa41 [llvm-lto2] Remove unneeded cl::init(false). NFC 2022-07-01 14:35:36 -07:00
Argyrios Kyrtzidis 0d3a2b4c66 [Lex] Introduce `PPCallbacks::LexedFileChanged()` preprocessor callback
This is a preprocessor callback focused on the lexed file changing, without conflating effects of line number directives and other pragmas.
A client that only cares about what files the lexer processes, like dependency generation, can use this more straightforward
callback instead of `PPCallbacks::FileChanged()`. Clients that want the pragma directive effects as well can keep using `FileChanged()`.

A use case where `PPCallbacks::LexedFileChanged()` is particularly simpler to use than `FileChanged()` is in a situation
where a client wants to keep track of lexed file changes that include changes from/to the predefines buffer, where it becomes
unnecessary complicated trying to use `FileChanged()` while filtering out the pragma directives effects callbacks.

Also take the opportunity to provide information about the prior `FileID` the `Lexer` moved from, even when entering a new file.

Differential Revision: https://reviews.llvm.org/D128947
2022-07-01 14:22:31 -07:00
Arthur Eubanks bcd153485e [bazel] Fix invalid characters 2022-07-01 13:47:56 -07:00
Arthur Eubanks 5a65c5180e [bazel] Port 43dc3190, adding rules to generate dxil intrinsics 2022-07-01 13:38:43 -07:00
Sanjay Patel 9c8a39c67b [InstCombine] restrict select of bit-tests to constant shift amounts
This transform is responsible for a long-standing miscompile
as discussed in issue #47012 (was bugzilla #47668).

There was a proposal to correct it in D88432, but that was
abandoned and there hasn't been any recent activity to fix
it AFAICT.

The original patch D45108 started with a constant-shift-only
restriction and only expanded during review, so I don't think
there's much risk of perf regression on the motivating code.
2022-07-01 16:24:34 -04:00
Sanjay Patel feb4b628ac [InstCombine] avoid 'tmp' usage in test files; NFC
The update script ( utils/update_test_checks.py ) warns against this.
2022-07-01 16:18:41 -04:00
wren romano 875ee0ed1c [mlir][sparse] Reducing computational complexity
This is a followup to D128847.  The `AffineMap::getPermutedPosition` method performs a linear scan of the map, thus the previous implementation had asymptotic complexity of `O(|topSort| * |m|)`.  This change reduces that to `O(|topSort| + |m|)`.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D129011
2022-07-01 12:55:09 -07:00
Valentin Clement b19cbda45a
[flang][NFC] Add embox test with character
This test is added to check for multidimensional descriptor of array
substring/derived type component array.

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

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-07-01 21:49:20 +02:00
Alexey Bataev 34073b5538 [SLP][NFC]Rework the test for logical and freeze, need some extra nodes,
NFC.
2022-07-01 12:43:10 -07:00
Haojian Wu bbcd8e5271 [pseudo] NFC, polish the fix of c998273499 2022-07-01 21:25:46 +02:00
Eric Kunze b7f4335d6a [mlir][tosa] Update TOSA transpose_conv2d to match spec
The TOSA Specification doesn't have a dilation attribute for transpose_conv2d,
and the padding array is of size 4. (top,bottom,left,right).

This change updates the dialect to match the specification, and updates the lit
tests to match the dialect changes.

Differential Revision: https://reviews.llvm.org/D127332
2022-07-01 19:10:28 +00:00
Alexey Bataev 48aa787ab3 [SLP][NFC]Add a test for logical and operands, requiring extra
freezextra freeze, NFC.e.
2022-07-01 11:53:50 -07:00
Fangrui Song ab3630dd41 [UpdateTestChecks][test] Remove stray ; before/after non-RUN-non-CHECK comments 2022-07-01 11:42:47 -07:00
Arthur Eubanks 3d7aeb3c73 [gn build] Manually port 43dc3190 2022-07-01 11:39:04 -07:00
rdzhabarov f59c279b72 [mlir] Fix usages of `run-reproducer`.
There is no need to specify `run-reproducer` explicitly anymore.

Differential Revision: https://reviews.llvm.org/D129010
2022-07-01 18:36:07 +00:00
Erich Keane 258c3aee54 Revert "Re-apply "Deferred Concept Instantiation Implementation"""
This reverts commit befa8cf087.

Apparently this breaks some libc++ builds with an apparent assertion,
 so I'm looking into that .
2022-07-01 11:20:16 -07:00
Craig Topper 188582b7e0 [RISCV] Considering existing offset in the alignment when folding ADDIs into load/store.
getPointerAlignment and ConstantPoolSDNode::getAlign only consider
the alignment of the object. If we already have a non-zero offset
into the offset that may have reduced the alignment.

Since the base pointer will become an LUI with the old offset, we
need to be sure the new offset fits in the alignment of the address
that will be used to create the LUI immediate.

I'm not sure it is possible to have a non-zero offset in the
GlobalAddressSDNode or ConstantPoolSDNode at this point today so this
may only be a theoretical bug.

Differential Revision: https://reviews.llvm.org/D129006
2022-07-01 11:18:40 -07:00
Haojian Wu c998273499 [pseudo] Fix an out-of-bound issue in getReduceRules. 2022-07-01 20:16:06 +02:00
Fangrui Song 6e8ec13d3f [MC][RISCV] Suppress R_RISCV_{ADD,SUB}32 in .apple_names .apple_types after D127549
This fixes test/DebugInfo/Generic/accel-table-hash-collisions.ll and
cross-cu-inlining.ll when the default triple is riscv. llvm-dwarfdump
--apple-names does not resolve R_RISCV_{ADD,SUB}32 in .apple_names .apple_types
and having ADD/SUB will cause decoding failure `Atom[0]: Error extracting the
value`.
2022-07-01 11:15:04 -07:00
Rong Xu b764e58865 Remove redundant code. [NFC]
isAssumeLikeIntrinsic() is a superset of isLifetimeStartOrEnd().
2022-07-01 10:58:18 -07:00
Peiming Liu daeb2dcea0 [mlir][sparse] add more unittest cases to sparse dialect merger
Reviewed By: aartbik, wrengr

Differential Revision: https://reviews.llvm.org/D128058
2022-07-01 17:58:10 +00:00
Xiang Li 43dc319049 [DirectX] add thread/group id DXIL operations.
Add DXIL operation for thread/group id operations.

ID  Name	                     Description
93  ThreadId	                 reads the thread ID
94  GroupId	                  reads the group ID (SV_GroupID)
95  ThreadIdInGroup	          reads the thread ID within the group (SV_GroupThreadID)
96  FlattenedThreadIdInGroup	 provides a flattened index for a given thread within a given group (SV_GroupIndex)

Also add llvm intrinsic which map to these intrinsics to DXIL operation.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D127990
2022-07-01 10:56:07 -07:00
Aaron Ballman 6450daddd2 Test a few more C99 DRs
This updates the status for another 8 DRs.
2022-07-01 13:54:11 -04:00
Petr Hosek 291e3a8565 [compiler-rt] Update Fuchsia sanitizer sched_yield
Fuchsia has split overloaded nanosleep(0) for yielding to its own
dedicated syscall, so valid zero deadlines would just return.

Patch By: gevalentino

Differential Revision: https://reviews.llvm.org/D128748
2022-07-01 17:25:57 +00:00
Quentin Colombet f4145ddf5b [GISel] Don't fold convergent instruction across CFG
Before merging two instructions together, GISel does some sanity checks
that the folding is legal. However that check was missing that the
source of the pattern may be convergent. When the destination location
is in a different basic block, the folding is invalid.

Differential Revision: https://reviews.llvm.org/D128539
2022-07-01 10:24:24 -07:00
Petr Hosek 6213dba19f [CMake][Fuchsia] Use libunwind as the default unwinder
Fuchsia already uses libunwind, but it does so implicitly via libc++.
This change makes the unwinder choice explicit.

Differential Revision: https://reviews.llvm.org/D127887
2022-07-01 17:24:00 +00:00
LLVM GN Syncbot 372a26acfd [gn build] Port 554aea52d7 2022-07-01 17:14:07 +00:00
Martin Sebor d8b22243c8 [InstCombine] Add tests in anticipation of D128939 (NFC)
Precommit tests exercising the future folding of memchr and strchr calls
in equality expressions with the first function argument.
2022-07-01 11:10:00 -06:00
Martin Sebor 0d68ff87d2 [InstCombine] Transform strrchr to memrchr for constant strings
Add an emitter for the memrchr common extension and simplify the strrchr
call handler to use it. This enables transforming calls with the empty
string to the test C ? S : 0.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128954
2022-07-01 11:10:00 -06:00
Alexey Lapshin 554aea52d7 [reland][Debuginfo][DWARF][NFC] Refactor DwarfStringPoolEntryRef.
This review is extracted from D96035.

This patch adds possibility to keep not only DwarfStringPoolEntry, but also
pointer to it. The DwarfStringPoolEntryRef keeps reference to the string map entry.
String map keeps string data and corresponding DwarfStringPoolEntry
info. Not all string map entries may be included into the result,
and then not all string entries should have DwarfStringPoolEntry
info. Currently StringMap keeps DwarfStringPoolEntry for all entries.
It leads to extra memory usage. This patch allows to keep
DwarfStringPoolEntry info only for entries which really need it.

[reland] : make msan happy.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D126883
2022-07-01 20:08:09 +03:00
Pengxuan Zheng b5e49cdea9 [LLD][COFF] Ignore /kernel flag
There exists some description of the flag from Microsoft, but not sure if
there's more to it. We ignore the flag for now until we find out more about it.

https://docs.microsoft.com/en-us/cpp/build/reference/kernel-create-kernel-mode-binary?view=msvc-170

Reviewed By: thieta, hans

Differential Revision: https://reviews.llvm.org/D128238
2022-07-01 10:03:02 -07:00
Arjun P c4abef28a3 [MLIR][Presburger] support symbolicLexMin for IntegerRelation
This also changes the space of the returned lexmin for IntegerPolyhedrons;
the symbols in the poly now correspond to symbols in the result rather than dims.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D128933
2022-07-01 18:00:11 +01:00
Arjun P c2fcaf84e5 [MLIR][Presburger] Simplex: refactor (symbolic)lex to support specifying multiple varKinds as symbols
This is also required to support lexmin for relations.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D128931
2022-07-01 17:47:39 +01:00
Kirill Okhotnikov fdf1fda5a8 [libc][math] Improved ExhaustiveTest performance.
Previous implementation splits value ranges around threads. Because of
very different performance of testing functions over different ranges,
CPU utilization were poor. Current implementation split test range
over small pieces and threads take the pieces when they finish with
previous. Therefore the CPU load is constant during testing.

Differential Revision: https://reviews.llvm.org/D128995
2022-07-01 18:32:54 +02:00
Fangrui Song f80a4321ef [llvm-objdump] -r: print non-SHF_ALLOC relocations for non-ET_REL files
ET_EXEC and ET_DYN files may contain non-SHF_ALLOC relocation sections
(e.g. ld --emit-relocs). Match GNU objdump by dumping them.

* Remove Object/dynamic-reloc.test. Replace it with a -r RUN line in dynamic-relocs.test
* Update relocations-in-nonreloc.test to set sh_link/sh_info. GNU
  objdump seems to ignore a SHT_REL/SHT_RELA section not linking to SHT_SYMTAB.
  The test did not test what it intended to test.

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

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D128959
2022-07-01 09:08:42 -07:00
Fazlay Rabbi 38bcd483dd [OpenMP] Initial parsing and semantic support for 'parallel masked taskloop simd' construct
This patch gives basic parsing and semantic support for
"parallel masked taskloop simd" construct introduced in
OpenMP 5.1 (section 2.16.10)

Differential Revision: https://reviews.llvm.org/D128946
2022-07-01 08:57:15 -07:00
Jun Zhang 3668d1264e
Revert "[NFC] Add a missing test for for clang-repl"
This reverts commit 2750985a5c.
This has caused Windows buildbot unhappy :(
2022-07-01 23:55:55 +08:00
Jun Zhang 2750985a5c
[NFC] Add a missing test for for clang-repl
This adds a missing test for 0ecbedc098
Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D128991
2022-07-01 23:26:54 +08:00
lorenzo chelini cc2a614796 [MLIR][Linalg] Update filename to reflect implementation (NFC)
Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D128978
2022-07-01 17:24:54 +02:00
Sander de Smalen 690db16422 [AArch64] Make nxv1i1 types a legal type for SVE.
One motivation to add support for these types are the LD1Q/ST1Q
instructions in SME, for which we have defined a number of load/store
intrinsics which at the moment still take a `<vscale x 16 x i1>` predicate
regardless of their element type.

This patch adds basic support for the nxv1i1 type such that it can be passed/returned
from functions, as well as some basic support to support some existing tests that
result in a nxv1i1 type. It also adds support for splats.

Other operations (e.g. insert/extract subvector, logical ops, etc) will be
supported in follow-up patches.

Reviewed By: paulwalker-arm, efriedma

Differential Revision: https://reviews.llvm.org/D128665
2022-07-01 15:11:13 +00:00
Nikita Popov 560e694d48 [AST] Don't assert instruction reads/writes memory (PR51333)
This function is well-defined for an instruction that doesn't access
memory (and thus trivially doesn't alias anything in the AST), so
drop the assert. We can end up with a readnone call here if we
originally created a MemoryDef for an indirect call, which was
later replaced with a direct readnone call.

Fixes https://github.com/llvm/llvm-project/issues/51333.

Differential Revision: https://reviews.llvm.org/D127947
2022-07-01 17:04:48 +02:00
Sam McCall a322c104cb [pseudo] temporary fix for missing generated header after fe66aebd75
Better fix to be added by Haojian later!
2022-07-01 16:45:22 +02:00