Commit Graph

417462 Commits

Author SHA1 Message Date
Shraiysh Vaishay 6dd54da5a5 [OpenMP][mlir] Lowering for omp.atomic.update
This patch adds lowering from omp.atomic.update to LLVM IR. Whenever a
special LLVM IR instruction is available for the operation, `atomicrmw`
instruction is emitted, otherwise a compare-exchange loop based update
is emitted.

Depends on D119522

Reviewed By: ftynse, peixin

Differential Revision: https://reviews.llvm.org/D119657
2022-03-10 18:28:51 +05:30
Florian Hahn 697f55e368
[AArch64] Move fp16 cast tests.
Move FP16 tests to fp16cast function, as suggested in D113700.
2022-03-10 12:22:06 +00:00
Nico Weber e32d061abe [gn build] (manually) port af98b0af67 2022-03-10 07:14:47 -05:00
alex-t d159b4444c [AMDGPU] Enable divergence predicates for negative inline constant subtraction
We have a pattern that undo sub x, c -> add x, -c canonicalization since c is more likely
 an inline immediate than -c. This patch enables it to select scalar or vector subtracion by the input node divergence.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D121360
2022-03-10 15:03:22 +03:00
Stanislav Gatev af98b0af67 [clang][dataflow] Add analysis that detects unsafe accesses to optionals
This commit reverts e0cc28dfdc and moves
UncheckedOptionalAccessModelTest.cpp into clang/unittests/Analysis/FlowSensitive,
to avoid build failures. The test will be moved back into a Models subdir
in a follow up patch that will address the build configuration issues.

Original description:

Adds a dataflow analysis that detects unsafe accesses to values of type
`std::optional`, `absl::optional`, or `base::Optional`.

Reviewed-by: ymandel, xazax.hun

Differential Revision: https://reviews.llvm.org/D121197
2022-03-10 11:05:31 +00:00
Nikita Popov eb4037ff42 [AMDGPU] Fix regenerated test checks (NFC)
I used the wrong build to generate the checks, sorry :(
2022-03-10 11:56:17 +01:00
Nikita Popov 611da6b582 [AMDGPU] Regenerate test checks (NFC) 2022-03-10 11:53:45 +01:00
Nikita Popov eaac3484ab [AMDGPU] Regenerate test checks (NFC)
Also rename variables to avoid file check clash.
2022-03-10 11:32:45 +01:00
Michel Weber 06eb057738 [MLIR][Presburger] fix vector update in coalesce
When `addCoalescedPolyhedron` was called with `j == n - 1`,
the `polyhedrons`-vector was not properly updated (the
`IntegerPolyhedron` at position `n - 2` was "lost"). This patch adds
special handling to that case and a regression testcase.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D121356
2022-03-10 15:42:11 +05:30
Groverkss c896e6540a [MLIR][Presburger] Use IdKind for removeIdRange in PresburgerSpace
This patch moves PresburgerSpace::removeIdRange(idStart, idLimit) to
PresburgerSpace::removeIdRange(kind, idStart, idLimit), i.e. identifiers
can only be removed at once for a single kind.

This makes users of PresburgerSpace to not assume any inside ordering of
identifier kinds.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D121079
2022-03-10 15:39:32 +05:30
Weining Lu 7898587e94 [LoongArch] Add basic support to Disassembler
With the addition of disassembler now we can do instructions 'round-trip' test
that assembles `.s` to obj with `llvm-mc` and disassembles it with `llvm-objdump`
to check instruction mnemonics.

Reviewed By: xen0n, MaskRay

Differential Revision: https://reviews.llvm.org/D120477
2022-03-10 17:08:31 +08:00
serge-sans-paille 8246ec242a Add missing include in llvm/CodeGen/CodeGenPassBuilder.h
As a follow-up to 7f230feeea
2022-03-10 10:05:25 +01:00
Simon Pilgrim 5979c659aa [InstCombine] Add vector tests for icmp_eq(add(X,C1),add(Y,C2)) -> icmp_eq(add(X,C1-C2),Y)
As mentioned on Issue #32161 we don't even have uniform vector support for this fold
2022-03-10 09:01:19 +00:00
serge-sans-paille 7f230feeea Cleanup codegen includes
after:  1061034926
before: 1063332844

Differential Revision: https://reviews.llvm.org/D121169
2022-03-10 10:00:30 +01:00
serge-sans-paille 3c4410dfca Cleanup includes: LLVMTarget
Most notably, Pass.h is no longer included by TargetMachine.h
before: 1063570306
after:  1063332844

Differential Revision: https://reviews.llvm.org/D121168
2022-03-10 10:00:29 +01:00
Nikita Popov 479d684ba5 [Coroutines] Support opaque pointers in solveTypeName()
As far as I can tell, these names are only intended to be
informative, so just use a generic "PointerType" for opaque pointers.

The code in solveDIType() also treats pointers as basic types (and
does not try to encode the pointed-to type further), so I believe
this should be fine.

Differential Revision: https://reviews.llvm.org/D121280
2022-03-10 09:33:55 +01:00
Luke 0803dba7dd [RISCV] Add fixed-length vector instrinsics for segment load
Inspired by reviews.llvm.org/D107790.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D119834
2022-03-10 16:23:40 +08:00
Craig Topper d53707508a [RISCV] Remove RISCVISD::VLE_VL/VSE_VL. Use intrinsics instead.
Similar to what we do for other loads/stores, use the intrinsic
version that we already have custom isel for.

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D121166
2022-03-09 22:44:28 -08:00
Craig Topper 7cd78da8da [RISCV] Add tests showing the optimization pipeline for O0 and O3.
Other targets like ARM, AArch64, and X86 have similar tests.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D120840
2022-03-09 21:42:09 -08:00
Amir Ayupov d1638cb0b5 [BOLT][NFC] Fix print-cfg data race
Addresses ThreadSanitizer warning

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121337
2022-03-09 20:28:06 -08:00
Amir Ayupov d16bbc5340 [BOLT][NFC] Check errors from Obj.dynamicEntries
Addresses fuzzer crash

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121336
2022-03-09 20:24:44 -08:00
Siva Chandra Reddy 83b8878fbb [libc] Use the constexpr constructor to initialize exit handlers mutex.
Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D121334
2022-03-10 02:52:35 +00:00
Carl Ritson 3cb9af1be2 [MachineSink] Pre-commit test for D121277. NFC. 2022-03-10 11:33:06 +09:00
Ahmed Bougacha 89c94c242c [clang][Driver] Get darwin -Xarch_ working for subtypes, again.
35ca7d9ddf broke 471c4f8299 for -arch flags that don't map 1:1
to the triple arch.  This has been broken for the many years since.
It hasn't mattered much since then, mostly because few people use it,
but also because it works for x86_64/i386, armv7/armv7s
don't differ much, arm64 is its own arch, and arm64/arm64_32 have
different arches (and it's a rare combination anyway).

But arm64/arm64e exposes this issue again.

Patch by: Justin Bogner <mail@justinbogner.com>
with some added tests.
2022-03-09 18:21:45 -08:00
Yaxun (Sam) Liu da9a70313d [HIP] Fix -fno-gpu-sanitize
Fix a typo about -fno-gpu-sanitize handling and disable warnings when
-fno-gpu-sanitize is specified.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D121302
2022-03-09 20:58:50 -05:00
Yaxun (Sam) Liu 6730b44480 [HIP] Fix HIP include path
The clang compiler prepends the HIP header include paths to the search
list using -internal-isystem when building for the HIP language. This
prevents warnings related to things like reserved identifiers when
including the HIP headers even when ROCm is installed in a non-system
directory, such as /opt/rocm.

However, when HIP is installed in /usr, then the prepended include
path would be /usr/include. That is a problem, because the C standard
library headers are stored in /usr/include and the C++ standard
library headers must come before the C library headers in the search
path list (because the C++ standard library headers use #include_next
to include the C standard library headers).

While the HIP wrapper headers _do_ need to be earlier in the search
than the C++ headers, those headers get their own subdirectory and
their own explicit -internal-isystem argument. This include path is for
<hip/hip_runtime_api.h> and <hip/hip_runtime.h>, which do not require a
particular search ordering with respect to the C or C++ headers. Thus,
HIP include path is added after other system include paths.

With contribution from Cordell Bloor.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D120132
2022-03-09 20:57:27 -05:00
LLVM GN Syncbot 9066a88f04 [gn build] Port c31014322c 2022-03-10 01:35:38 +00:00
Brad Smith 9abeb80e80 [Driver][OpenBSD] Disable unwind tables on Arm
Arm is not quite ready for unwinding yet.
2022-03-09 20:33:16 -05:00
Xiang1 Zhang c31014322c TLS loads opimization (hoist)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D120000
2022-03-10 09:29:06 +08:00
Yevgeny Rouban fcd9fa416d [Support] Try 2: Reset option to its default if its Default field is undefined
opt::setDefaultImpl() is changed to set the option value to the option
type's default if the Default field is not set. This results in option
value reset by Option::reset() or ResetAllOptionOccurrences() even if
the cl::init() is not specified.

Example:
  StackOption<std::string> Str("str"); // No cl::init().
  Str = "some value";
  cl::ResetAllOptionOccurrences();
  EXPECT_EQ("", Str); // The Str is reset.

Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D115433
2022-03-10 08:26:34 +07:00
Vitaly Buka 43f208e94c [msan] Fix unittest for 9397bdc6
"1.1" is double which can't be represented precicely as a float.
2022-03-10 01:21:30 +00:00
Craig Topper edd6632127 [RISCV] Support 'generic' as a valid CPU name.
Most other targets support 'generic', but RISCV issues an error.
This can require a special case in tools that use LLVM that aren't
clang.

This patch treats "generic" the same as an empty string and remaps
it to generic-rv/rv64 based on the triple. Unfortunately, it has to
be added to RISCV.td because MCSubtargetInfo is constructed and
parses the CPU before RISCVSubtarget's constructor gets a chance
to remap it. The CPU will then reparsed and the state in the
MCSubtargetInfo subclass will be updated again.

Fixes PR54146.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D121149
2022-03-09 16:43:22 -08:00
Florian Mayer 0f770f4d00 [NFC] [HWASan] document why we tag Size but untag AlignedSize. 2022-03-09 16:18:04 -08:00
Aart Bik 0123d2a9fe [mlir][sparse] add end2end test for linalg.dot sparsification
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D121344
2022-03-09 16:05:53 -08:00
Shilei Tian f6639a424b [OpenMP][CUDA] Fix the check of `setContext` 2022-03-09 18:48:44 -05:00
Aart Bik 52fb4f53c2 [mlir][sparse] added linalg.dot to sparse kernel collection
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D121315
2022-03-09 15:10:44 -08:00
Kevin Athey fc9e07873f Revert "[MSAN] add interceptor for timer_create, timer_settime, timer_gettime"
This reverts commit 0a4dec6cc2.

breaks buildbots
2022-03-09 14:57:05 -08:00
Kevin Athey b5e985e6f3 Revert "[MSAN] adjust Posix/timer.cpp"
This reverts commit f2a9753680.

breaks buildbot
2022-03-09 14:55:12 -08:00
Sanjay Patel b48fe158e0 [Analysis] remove bogus smin/smax pattern detection
This is a revert of cfcc42bdc. The analysis is wrong as shown by
the minimal tests for instcombine:
https://alive2.llvm.org/ce/z/y9Dp8A

There may be a way to salvage some of the other tests,
but that can be done as follow-ups. This avoids a miscompile
and fixes #54311.
2022-03-09 17:50:34 -05:00
Sanjay Patel cc8f981987 [InstCombine] add tests to show miscompiled smin/smax; NFC 2022-03-09 17:50:34 -05:00
Stanislav Mekhanoshin 0be6fd44f3 [SDAG] Use MMO flags in MemSDNode folding
SDNodes with different target flags may now be folded together
rightfully resulting in the assertion in the refineAlignment.
Folding nodes with different target flags may result in the
wrong load instructions produced at least on the AMDGPU.

Fixes: SWDEV-326805

Differential Revision: https://reviews.llvm.org/D121335
2022-03-09 14:25:22 -08:00
Louis Dionne a54d028895 Revert "[libc++] Remove extension to support allocator<const T>"
This reverts commit 276ca873. That commit has quite a history at this
point. It was first landed in dbc647643577, which broke std::shared_ptr<T const>
and was reverted in 9138666f5. It was then re-applied in 276ca873, with
the std::shared_ptr issue fixed, but it caused widespread breakage at
Google (which suggests it would cause similar breakage in the wild too),
so now I'm reverting again.

Instead, I will add a escape hatch that vendors can turn on to enable
the extension and perform a phased transition over one or two releases
like we sometimes do when things become non-trivial.
2022-03-09 17:04:18 -05:00
Michael Gottesman 0b647fc529 [debug-info] Debug salvage llvm.dbg.addr in original function that point into the coroutine frame when splitting coros.
We are already doing this in the split functions while we clone. This just
handles the original function.

I also updated the coroutine split test to validate that we are always referring
to the msg in the context object instead of in a shadow copy.

rdar://83957028

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D121324
2022-03-09 14:02:09 -08:00
David Green 8bef17ed59 [AArch64][SLP] Add a test with mutual reductions. NFC 2022-03-09 21:46:57 +00:00
Colin Cross e75f1d3c07 [CompilerRT] Fix build of compiler-rt with musl
Use the correct types for OFF_T, __sanitizer_time_t and
__sanitizer_dirent and forward time_t related functions
 to fix using compiler-rt with 32-bit musl libc.

Also redirect the time_t functions that are affected by
https://musl.libc.org/time64.html to use their 64-bit
ABI names.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D119358
2022-03-09 13:41:30 -08:00
Craig Topper f7a63bca17 [RISCV] Switch undef -> poison in fixed-vector RVV tests 2022-03-09 13:38:36 -08:00
Shilei Tian 39d3283a08 [OpenMP][CUDA] Avoid calling `cuCtxSetCurrent` redundantly
Currently we set ccontext everywhere accordingly, but that causes many
unnecessary function calls. For example, in the resource pool, if we need to
resize the pool, we need to get from allocator. Each call to allocate sets the
current context once, which is unnecessary. In this patch, we set the context
only in the entry interface functions, if needed. Actually in the best way this
should be implemented via RAII, but since `cuCtxSetCurrent` could return error,
and we don't use exception, we can't stop the execution if RAII fails.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D121322
2022-03-09 16:32:47 -05:00
zhijian 3e104fbe11 [NFC][llvm-nm] create a new helper function exportSymbolNamesFromFiles for --export-symbols
Summary:

create a new helper function exportSymbolNamesFromFiles for --export-symbols

Reviewer : James Henderson,Fangrui Song
Differential Revision: https://reviews.llvm.org/D120913
2022-03-09 16:28:55 -05:00
David Blaikie 85ee1d3ca1 Revert "Disable -Wmissing-prototypes for internal linkage functions that aren't explicitly marked "static""
Regresses:
typedef struct {
  static void  f() {
  }
} a_t;

Causing this to error instead of warn, because the linkage is computed
earlier/too early perhaps. I'll send out a review to see if there's some
other path forward or if this is an acceptable regression, etc.

This reverts commit 275c56226d.
2022-03-09 21:12:56 +00:00
Kevin Athey f2a9753680 [MSAN] adjust Posix/timer.cpp
follow up to 0a4dec6cc2.
add unsupported for s390 (SEGV)
restore line that s390 complains, so following asserts work.

Differential Revision: https://reviews.llvm.org/D121326
2022-03-09 13:02:08 -08:00