Commit Graph

414670 Commits

Author SHA1 Message Date
Sameer Sahasrabuddhe d8f99bb6e0 [AMDGPU] replace hostcall module flag with function attribute
The module flag to indicate use of hostcall is insufficient to catch
all cases where hostcall might be in use by a kernel. This is now
replaced by a function attribute that gets propagated to top-level
kernel functions via their respective call-graph.

If the attribute "amdgpu-no-hostcall-ptr" is absent on a kernel, the
default behaviour is to emit kernel metadata indicating that the
kernel uses the hostcall buffer pointer passed as an implicit
argument.

The attribute may be placed explicitly by the user, or inferred by the
AMDGPU attributor by examining the call-graph. The attribute is
inferred only if the function is not being sanitized, and the
implictarg_ptr does not result in a load of any byte in the hostcall
pointer argument.

Reviewed By: jdoerfert, arsenm, kpyzhov

Differential Revision: https://reviews.llvm.org/D119216
2022-02-11 22:51:56 +05:30
Julien Pages dcb2da13f1 [AMDGPU] Add a new intrinsic to control fp_trunc rounding mode
Add a new llvm.fptrunc.round intrinsic to precisely control
the rounding mode when converting from f32 to f16.

Differential Revision: https://reviews.llvm.org/D110579
2022-02-11 12:08:23 -05:00
Florian Hahn d1e1a40527
[ConstraintElimination] Add test for #48253.
Test from https://github.com/llvm/llvm-project/issues/48253.
2022-02-11 17:07:13 +00:00
Hongtao Yu f0f70ae674 [CSSPGO] Do not recount callee samples when computing profile summary for nested CS profile.
When generating nested CS profile with all calling contexts of a function duplicated into a base profile under `--generate-merged-base-profiles`, do not recount callee samples when computing profile summary. This fixes the profile summary mismatch between flat cs profile and nested cs profile, for both extbinary and text format.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D119494
2022-02-11 09:05:51 -08:00
Geoffrey Martin-Noble 088fbc0cb4
[Bazel] Document continuous and pre-merge testing 2022-02-11 08:59:11 -08:00
Kai Nacke ff99f3a5c0 [SystemZ/z/OS] Add alias for XPLINK return
The XPLINK return `b 2(7)` has size 4 bytes, while the Linux return
`br 7` only has size 2 bytes. Thus a new alias is required to have correct
instruction byte count. It also fixes the conditional return code.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D119437
2022-02-11 11:52:25 -05:00
Simon Pilgrim 48e1434a0a [X86] Move combineToExtendBoolVectorInReg before the select combines. NFC.
Avoid the need for a forward declaration.

Cleanup prep for Issue #53760
2022-02-11 16:51:46 +00:00
Mark de Wever efe5cbaf42 [libc++][format] LWG-3648 format should not print bool with 'c'
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D119350
2022-02-11 17:45:14 +01:00
Mark de Wever b6d6b8c9d8 [libc++][format] LWG-3654 basic_format_context::arg(size_t) should be noexcept
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D119349
2022-02-11 17:42:06 +01:00
Simon Pilgrim 827d0c51be [X86] combineToExtendBoolVectorInReg - use explicit arguments. NFC.
Replace the *_EXTEND node with the raw operands, this will make it easier to use combineToExtendBoolVectorInReg for any boolvec extension combine.

Cleanup prep for Issue #53760
2022-02-11 16:40:29 +00:00
Mark de Wever 9027887e23 [libc++][nfc] Add TEST_HAS_NO_CHAR8_T.
This avoids using an libc++ internal macro in our tests. This version
doesn't depend on the internal macro but redefines it.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D119460
2022-02-11 17:37:05 +01:00
LLVM GN Syncbot 67c02e07c0 [gn build] Port 3b470d1ce9 2022-02-11 16:20:57 +00:00
Nikolas Klauser 3b470d1ce9 [libc++][ranges] Implement ranges::min_element
Implement ranges::min_element

Reviewed By: Quuxplusone, Mordante, #libc

Spies: miscco, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D117025
2022-02-11 17:20:27 +01:00
LLVM GN Syncbot 0498f92ac7 [gn build] Port 1e77b396ff 2022-02-11 16:11:07 +00:00
Nikita Popov 4c6289c369 [InstCombine] Check source element type in gep of phi of gep fold 2022-02-11 17:10:48 +01:00
Nikolas Klauser 1e77b396ff [libc++] Add ranges::in_fun_result
Add `ranges::in_fun_result`

Reviewed By: Quuxplusone, #libc, var-const

Spies: CaseyCarter, var-const, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D116974
2022-02-11 17:10:29 +01:00
OCHyams 2bd62e0b04 [dexter] Don't generate results files by default
Dexter saves various files to a new results directory each time it is run
(including when it's run by lit tests) and there isn't a way to opt-out. This
patch reconfigures the behaviour to be opt-in by removing the default
`--results-directory` location. Now results are only saved if
`--results-directory` is specified.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D119545
2022-02-11 15:45:43 +00:00
Matt Arsenault 52fbb786a6 InferAddressSpaces: Fix assert on inferred source for inttoptr/ptrtoint
If we had some source value we could infer an address space from that
went through a ptrtoint/inttoptr pair, this would fail since bitcast
can't change the address space.

Fixes issue 53665.
2022-02-11 10:35:29 -05:00
Nikita Popov e9c0720010 [PHITransAddr] Check GEP source element type
It's not the same GEP if the source element type is different.
2022-02-11 16:22:48 +01:00
Simon Pilgrim 1e64590041 [clang][sema] - remove CodeCompleter nullptr checks
All paths have already dereferenced the CodeCompleter pointer in the ResultBuilder constructor
2022-02-11 15:09:44 +00:00
Simon Pilgrim 5fb180704c [clang][sema] ActOnExplicitInstantiation - remove Prev nullptr check
All paths have already dereferenced the Prev pointer
2022-02-11 15:09:44 +00:00
Simon Pilgrim f162036fcd [clang] RewriteModernObjC::SynthBlockInitExpr - remove block nullptr check
All paths have already dereferenced the block pointer
2022-02-11 15:09:44 +00:00
Jez Ng 4490a26a3e [lld-macho][nfc] Rename %no_fatal_warnings_lld in tests
... to use hyphens instead of underscores, making it consistent with
our other substitutions like %no-arg-lld and %lld-watchos.

Reviewed By: keith

Differential Revision: https://reviews.llvm.org/D119513
2022-02-11 10:06:38 -05:00
Dávid Bolvanský b2936caf77 [clang] inheritance fix for nomerge attribute
Discussed here: https://reviews.llvm.org/D119061#3310822

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D119451
2022-02-11 15:51:08 +01:00
Anton Zabaznov bfb1a33bec [OpenCL] Adjust diagnostic for subgroup support.
OpenCL C 3.0 __opencl_c_subgroups feature is slightly different
then other equivalent features and extensions (fp64 and 3d image writes):
OpenCL C 3.0 device can support the extension but not the feature.
cl_khr_subgroups requires subgroup independent forward progress.

This patch adjusts the check which is used when translating language
builtins to check either the extension or feature is supported.

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D118999
2022-02-11 17:40:24 +03:00
Haojian Wu 8fee667d31 [pseudo] NFC, fix some typos. 2022-02-11 15:35:11 +01:00
AndreyChurbanov d84dedc7d3 [OpenMP] libomp: fix bug in implementation of distribute construct.
Fixed mistaken iterations distribution between different target regions.

Differential Revision: https://reviews.llvm.org/D118393
2022-02-11 17:34:26 +03:00
Anton Afanasyev cd685f5736 [NFC][SLP] Set default parameter for Offset equal to zero 2022-02-11 17:22:33 +03:00
Marek Kurdej 23f27850b1 [clang-format] Avoid multiple calls to FormatToken::getNextNonComment(). NFC. 2022-02-11 15:20:11 +01:00
Marek Kurdej 0104f5efed [clang-format] Mark FormatToken::getNextNonComment() nodiscard. NFC. 2022-02-11 15:20:11 +01:00
Louis Dionne 6a7f6e9404 [docs] Fix missing space in the GettingStarted documentation 2022-02-11 09:17:37 -05:00
Jay Foad 9fe8a74c43 [TableGen] Dump RC.Allocatable with -register-info-debug 2022-02-11 14:07:19 +00:00
Amy Kwan db691903d2 [test-release.sh] Add option to disable building clang-tools-extra during release testing.
This patch adds an option (no-clang-tools) to disable building clang-tools-extra when
performing release testing. Prior to this patch, clang-tools-extra was built by default,
but on some platforms (such as AIX), clang-tools-extra is not supported, and so we do
not normally build it. Furthermore, this change should not change the invocation for
targets that build clang-tools-extra normally.

Differential Revision: https://reviews.llvm.org/D119520
2022-02-11 07:50:03 -06:00
Nikita Popov 5450963085 [InstCombine] Check source element type in phi of gep fold
Rather than checking that the type is the same (which is always
the case, given how these are part of the same phi) check that the
source element type is the same. With opaque pointers, this is no
longer implied.
2022-02-11 14:26:18 +01:00
Zakk Chen d224be3b99 [RISCV] Add the policy operand for some masked RVV ternary IR intrinsics.
Masked reduction intrinsics are specical cases which don't need to have policy
operand. The mask only affects which elements are read. It doesn't effect the
destination register.
The reduction intrinsics have a dedicated destination operand. If it
is undef, we use tail agnostic. If it not undef we use tail
undisturbed.

Co-Authored-by: Craig Topper <craig.topper@sifive.com>

Differential Revision: https://reviews.llvm.org/D117681
2022-02-11 05:02:03 -08:00
Adrian Kuegel 2219f9f57c [mlir][MemRef] Fix MemRefCopyOpLowering to use correct number of bytes
When lowering to memrefCopy call, the size for i1 type was calculated as 0.
Instead of using getTypeSizeInBits() and dividing by 8, we should just use getTypeSize().

Differential Revision: https://reviews.llvm.org/D119540
2022-02-11 13:59:08 +01:00
Anton Zabaznov bee4bd70f7 [OpenCL] Add support of language builtins for OpenCL C 3.0
OpenCL C 3.0 introduces optionality to some builtins, in particularly
to those which are conditionally supported with pipe, device enqueue
and generic address space features.

The idea is to conditionally support such builtins depending on the language options
being set for a certain feature. This allows users to define functions with names
of those optional builtins in OpenCL (as such names are not reserved).

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D118605
2022-02-11 15:53:44 +03:00
Nathan Sidwell fbded4f42d [demangler] Adjust unqualified name parsing
The unqualified name grammar includes <ctor-dtor-name>, but we handle
that specially in parseNestedName.  This is a little awkward.  We can
pass in the current scope and have parseUnqualifiedName deal with
cdtors too.  That also allows a couple of other simplifications:

1) parseUnqualifiedName can also build up the NestedName, when the
provided scope is non-null.  Which means ...

2) parseUnscopedName can pass a "std" scope in (and tailcall).

3) ... and also parseNestedName need not construct the nestedname itself.

4) also parseNestedName's detection of a cdtor-name doesn't have to
rule out a decomposition name anymore.

This change also makes adding module demangling more
straight-forwards, btw.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D119154
2022-02-11 04:22:06 -08:00
Nikita Popov 2a1b1f1b1b [GVN] Store source element type for GEP expressions
To avoid incorrectly merging GEPs with different source types
under opaque pointers.

To avoid increasing the Expression structure size, this reuses the
existing type member. The code does not rely on this to be the
expression result type, it's only used as a disambiguator.
2022-02-11 13:03:30 +01:00
Bradley Smith c53ad72aa9 [AArch64][SVE] Fix selection failure caused by fp/int convert using non-Neon types
Fixes: #53679

Differential Revision: https://reviews.llvm.org/D119428
2022-02-11 11:46:59 +00:00
Adrian Kuegel 5b02a48085 [mlir][MemRef] Fix MemRefCastOpLowering for 32 bit index type.
The lowering creates llvm.insertvalue with the rank value, so it needs to use
index type instead of 64 bit integer type. Otherwise, we get an error:

llvm.insertvalue' op Type mismatch: cannot insert 'i64' into '!llvm.struct<(i32, ptr<i8>)>'

Differential Revision: https://reviews.llvm.org/D119534
2022-02-11 12:37:15 +01:00
Arjun P 855cd847f7 [MLIR][Presburger] normalizeDivisionByGCD: fix bug when constant term is negative
Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D119531
2022-02-11 17:02:52 +05:30
Nikita Popov 8f1350e03a [IR] Check GEP source type when comparing instructions
Two GEPs with same indices but different source type are not the
same.

Worth noting that FunctionComparator already handles this correctly.
2022-02-11 12:32:04 +01:00
Stanislav Gatev 87c32be023 [clang][dataflow] Include terminator statements in buildStmtToBasicBlockMap
This will be necessary later when we add support for evaluating logic
expressions such as && and ||.

This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: xazax.hun

Differential Revision: https://reviews.llvm.org/D119447
2022-02-11 11:15:29 +00:00
David Spickett ef4d1119cc [compiler-rt][xray] Disable fdr-reinit test on AArch64
We run bots on a shared machine and under high load
this test sometimes segfaults.

https://lab.llvm.org/buildbot/#/builders/185/builds/1368

==1952234==XRay FDR init successful.
==1952234==XRay FDR: Not flushing to file, 'no_file_flush=true'.
<...>fdr-reinit.cpp.script: line 4: 1952234 Segmentation fault
XRAY_OPTIONS="verbosity=1" <...>/fdr-reinit.cpp.tmp

Looking at the printed output I think it's happening at:
// Finally, we should signal the sibling thread to stop.
keep_going.clear(std::memory_order_release);

Disabling the test while I try to reproduce.
2022-02-11 11:13:04 +00:00
Mirko Brkusanin 5ff35ba8ae [AMDGPU][GlobalISel] Fix insert point in FoldableFneg combine
Newly created fneg was built after some of it's uses in some cases.
Now it will be built immediately after instruction whose dst it negates.

Differential Revision: https://reviews.llvm.org/D119459
2022-02-11 12:09:40 +01:00
Marek Kurdej fd16eeea9d [clang-format] Assert default style instead of commenting. NFC. 2022-02-11 12:01:25 +01:00
Marek Kurdej 326cb51b14 [clang-format] Simplify conditions in spaceRequiredBetween. NFC. 2022-02-11 12:01:24 +01:00
Konrad Kleine 32a0482a65 Add cmake to source release tarballs
I've split the git archive generation into three steps:

1. generate pure tarball
2. append top-level cmake directory to all tarballs
3. compress the archive

This was inspired by D118252 and can be considered an alternative
approach for all projects to have access to the shared cmake
directory when building in standalone mode.

When generating source tarballs on my local laptop it takes 9 minutes and 45 seconds WITH this patch applied. When this patch is not applied, it takes 9minutes and 38 seconds. That means, this patch introduces a slowdown of 7 seconds, which seems fair.

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D118481
2022-02-11 11:54:44 +01:00
Simon Pilgrim 9ece72c159 [clang] VisitCastExpr - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced, so assert the cast is correct (which it should be as we just created that ScalableVectorType) instead of returning nullptr
2022-02-11 10:51:34 +00:00