Commit graph

421638 commits

Author SHA1 Message Date
David Tenty aa643f455a Fixup D123950 to address revert of D123345
Since D123345 got reverted Builtin::BIaddressof and Builtin::BI__addressof don't exist and cause build breaks.
2022-04-20 19:59:07 -04:00
Alexander Yermolovich 7d6716786f [BOLT][DWARF] Handle Error returned by visitLocationList
Looks like implementation in llvm changed, and now we need to process error
being returned.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D124133
2022-04-20 16:40:46 -07:00
David Tenty 98d911e01f Revert "Treat std::move, forward, etc. as builtins."
This reverts commit b27430f9f4 as the
    parent https://reviews.llvm.org/D123345 breaks the AIX CI:

    https://lab.llvm.org/buildbot/#/builders/214/builds/819
2022-04-20 19:14:37 -04:00
David Tenty de6ddaeef3 Revert "Don't treat 'T &forward(T&&)' as builtin."
This reverts commit e43c93dd63 as the
parent https://reviews.llvm.org/D123345 breaks the AIX CI.
2022-04-20 19:14:36 -04:00
Evgeny Mankov c23147106f [clang][CUDA][Windows] Fix compilation error on Windows with uint32_t __nvvm_get_smem_pointer
The change fixes https://github.com/llvm/llvm-project/issues/54609 (the second reported issue) by eliminating a compilation error occurring only on Windows while trying to compile any CUDA source file by clang (-x cuda).

[Repro]
clang -x cuda <any_cu_source>

[Error]

__clang_cuda_runtime_wrapper.h:473:
__clang_cuda_intrinsics.h(517,19): error GC871EEFB: unknown type name 'uint32_t'; did you mean 'cuuint32_t'?
__device__ inline uint32_t __nvvm_get_smem_pointer(void *__ptr) {
                          ^
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include\cuda.h:57:26: note: 'cuuint32_t' declared here
typedef unsigned __int32 cuuint32_t;

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D122897
2022-04-21 00:41:20 +03:00
Jez Ng 9c4b2ff9cd [MC][NFC] Ensure tests that intended to cover compact unwind code paths do so
These two tests were intended to cover the CU code paths, but invoked
llvm-mc using a generic "darwin" platform. However, MC only attempts to
emit CU for `macos >= 10.6` [1]. Thus we adjust the tests accordingly.

compact-unwind-cfi_def_cfa.s was added in 2fca51d3b4
fp-setup-macho.s was added in 03ffa797ad

[1]: 16c93aaa4a/llvm/lib/MC/MCObjectFileInfo.cpp (L43)

Reviewed By: MaskRay, smeenai

Differential Revision: https://reviews.llvm.org/D124126
2022-04-20 18:11:33 -04:00
V Donaldson 7d61a8419b [flang] Semantics limits on kP scale factors
When known at compile time, Ew.d and Dw.d output edit descriptors
should respect limitations from the standard on the value of a
kP scale factor with respect to the digit count (d), at least for
values of k other than zero.
2022-04-20 14:43:21 -07:00
Krzysztof Parzyszek 16c93aaa4a [Hexagon] Establish size limit for RegisterSet in hexbit
This should reduce compilation time for huge functions.
2022-04-20 14:16:24 -07:00
Nathan James cfb8169059
[clang] Add a raw_ostream operator<< overload for QualType
Under the hood this prints the same as `QualType::getAsString()` but cuts out the middle-man when that string is sent to another raw_ostream.

Also cleaned up all the call sites where this occurs.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D123926
2022-04-20 22:09:05 +01:00
Nikolas Klauser faef447e72 [libc++] Granularize <functional> includes
Reviewed By: Mordante, #libc

Spies: libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D123912
2022-04-20 22:49:18 +02:00
Mehdi Amini 02eac667ed Improve invalid-ir-print-after-failure.mlir to show the effects of -mlir-print-assume-verified (NFC) 2022-04-20 20:40:41 +00:00
Muhammad Omair Javaid 5341b5f8d3 [LLDB] Update inspect getargspec to getfullargspec
This patch replaces getargspec with getfullargspec in funcutils.py.
getargspec has been deprecated by python 11x release. This is
important to run LLDB testsuite in Windows/Arm64 platform
where Python native will be available from python release onwards.

Note: getfullargspec is not available in python 2

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D121786
2022-04-21 01:33:26 +05:00
Pengxuan Zheng 38612fbc89 Reland "[COFF, ARM64] Add __break intrinsic"
https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170

Reland after fixing the test failure. The failure was due to conflict with a
change (D122983) which was merged right before this patch.

Reviewed By: rnk, mstorsjo

Differential Revision: https://reviews.llvm.org/D124032
2022-04-20 13:01:30 -07:00
serge-sans-paille af7b98c383 [clang-tblgen] Automatically document options values
This is a port of f5c666742f to clang's tablegen,
with a better wording.

Differential Revision: https://reviews.llvm.org/D123682
2022-04-20 22:00:06 +02:00
Siva Chandra Reddy 22f9dca113 [libc] Add the implementation of the fflush function.
Note that the underlying flush implementation does not yet fully implement
the POSIX standard. It is complete with respect to the C standard
however. A future change will add the POSIX behavior. It should not affect
the implementation of the fflush function however as the POSIX behavior
will be added in a lower layer.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D124073
2022-04-20 19:43:39 +00:00
Pengxuan Zheng bff8356b19 Revert "[COFF, ARM64] Add __break intrinsic"
This reverts commit 8a9b4fb4aa.
2022-04-20 11:57:49 -07:00
Stanislav Mekhanoshin aa14e2ef3e [AMDGPU] Remove obsolete hack from allowsMisalignedMemoryAccesses. NFCI.
Differential Revision: https://reviews.llvm.org/D124035
2022-04-20 11:52:56 -07:00
Florian Hahn bea69b232f
[VPlan] Initial modeling of middle block in VPlan.
This patch extends the scope of VPlan to also include the exit (aka
middle) block.

For now, the exit block remains empty, but handling of exit values will
subsequently be moved to VPlan, by adding recipes to model exit values
in the exit block.

As a first step, this will allow fixing #51366.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D123457
2022-04-20 19:34:41 +01:00
Eli Friedman ecc8479a01 Look through calls to std::addressof to compute pointer alignment.
This is sort of a followup to D37310; that basically fixed the same
issue, but then the libstdc++ implementation of <atomic> changed. Re-fix
the the issue in essentially the same way: look through the addressof
operation to find the alignment of the underlying object.

Differential Revision: https://reviews.llvm.org/D123950
2022-04-20 11:30:11 -07:00
Paul Kirth 61e36e87df [safestack] Support safestack in stack size diagnostics
Current stack size diagnostics ignore the size of the unsafe stack.
This patch attaches the size of the static portion of the unsafe stack
to the function as metadata, which can be used by the backend to emit
diagnostics regarding stack usage.

Reviewed By: phosek, mcgrathr

Differential Revision: https://reviews.llvm.org/D119996
2022-04-20 18:29:40 +00:00
Jan Svoboda 340654e0f2 Revert "[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::load*()"
This reverts commit 1d3ba05e4a which caused failures of the VFS/real-path-found-first.m test on Windows build bots.
2022-04-20 20:27:14 +02:00
Jan Svoboda 99cfccdcb3 [clang][lex] NFCI: Use FileEntryRef in ModuleMap::diagnoseHeaderInclusion()
This patch removes uses of the deprecated `DirectoryEntry::getName()` from the `ModuleMap::diagnoseHeaderInclusion()` function by using `{File,Directory}EntryRef` instead.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D123856
2022-04-20 20:27:13 +02:00
Pengxuan Zheng 8a9b4fb4aa [COFF, ARM64] Add __break intrinsic
https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170

Reviewed By: rnk, mstorsjo

Differential Revision: https://reviews.llvm.org/D124032
2022-04-20 11:20:26 -07:00
Fangrui Song c79e6007ed Revert D119136 "[clang] Implement Change scope of lambda trailing-return-type" and its follow-up
This reverts commit 69dd89fdcb.
This reverts commit 04000c2f92.

The current states breaks libstdc++ usage (https://reviews.llvm.org/D119136#3455423).
The fixup has been reverted as it caused other valid code to be disallowed.
I think we should start from the clean state by reverting all relevant commits.
2022-04-20 10:57:12 -07:00
Dan Liew 3d612a930d [NFC] Avoid unnecessary duplication of code generating diagnostic.
The previous code unneccessarily duplicated the creation of a diagnostic
where the only difference was the `AssignmentAction` being passed.

rdar://88664722

Differential Revision: https://reviews.llvm.org/D124054
2022-04-20 10:50:21 -07:00
Florian Hahn 5e54a413de
[LICM] Add additional writeonly tests, check attributes.
Add additional test coverage for D123473.
2022-04-20 18:49:37 +01:00
Shoaib Meenai 4641d86e45 [ELF] Shrink binding and type in Symbol
STB_HIPROC and STT_HIPROC are both 15, so we can fit the symbol binding
and type in 4 bits. This gives us an additional byte to use for Symbol
flags (without increasing the type's size), which I'll be making use of
in the next diff.

Reorder type and binding based on a suggestion from @MaskRay, to
optimize st_info computation on little-endian systems (see
https://godbolt.org/z/nMn8Yar43).

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D124042
2022-04-20 10:46:36 -07:00
Shoaib Meenai 610a0e8b53 [ELF] Assert on invalid GOT or PLT relocations
Because of https://llvm.org/PR50675, we can end up producing a PLT
relocation referencing a symbol that's dropped from the dynamic symbol
table, which in turn causes a crash at runtime. We ran into this again
recently, resulting in crashes for our users. A subsequent diff will fix
that issue, but add an assert to catch it if it happens again.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D123985
2022-04-20 10:46:04 -07:00
Aaron Ballman e5f025dad9 Speculatively fix build bot
This should fix the issue found by:
https://lab.llvm.org/buildbot/#/builders/37/builds/12606
2022-04-20 13:39:53 -04:00
Christudasan Devadasan 0d4a49b0f1 [AMDGPU] Regenerate lit test pattern (NFC). 2022-04-20 23:06:35 +05:30
Zequan Wu 2fa2734690 [LLDB][NativePDB] Fix the case when S_DEFRANGE_SUBFIELD_REGISTERs are out of order.
Previously, I was assuming that S_DEFRANGE_SUBFIELD_REGISTERs are always in the
increasing order of offset_in_parent until I saw a counter example.

Using `std::map` so that they are sorted by offset_in_parent.

Differential Revision: https://reviews.llvm.org/D124061
2022-04-20 10:33:00 -07:00
Fangrui Song 0f5dbfd29a Revert D123909 "[Clang] Use of decltype(capture) in parameter-declaration-clause"
This reverts commit daa6d7b250.

It breaks valid code like https://reviews.llvm.org/D123909#3461716
2022-04-20 10:32:41 -07:00
Aaron Ballman 9955f14aaf [C2x] Disallow functions without prototypes/functions with identifier lists
WG14 has elected to remove support for K&R C functions in C2x. The
feature was introduced into C89 already deprecated, so after this long
of a deprecation period, the committee has made an empty parameter list
mean the same thing in C as it means in C++: the function accepts no
arguments exactly as if the function were written with (void) as the
parameter list.

This patch implements WG14 N2841 No function declarators without
prototypes (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2841.htm)
and WG14 N2432 Remove support for function definitions with identifier
lists (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf).

It also adds The -fno-knr-functions command line option to opt into
this behavior in other language modes.

Differential Revision: https://reviews.llvm.org/D123955
2022-04-20 13:28:15 -04:00
Jun Zhang 9c069374ce
Reland "[Clang][Sema] Fix invalid redefinition error in if/switch/for statement"
This reverts commit 9f075c3d84.
The broken build has alreasy been fixed in D124012, so reland it now.
Signed-off-by: Jun Zhang <jun@junz.org>
2022-04-21 01:18:58 +08:00
Mike Kashkarov 39ee23ed5a [flang] Set LBOUND() folding for (x) expression as ones
Set LBOUND() constant folding for parentheses expr. as ones

Array bounds should not propagate throught omitted bounds specifications or
temporary variables - fix constant folding in case of Parentheses<T> expression
by explicitly returning array of ones (or scalar in case of DIM=).

Add set of tests for (x) bounds checks (w/ and w/o 'parameter' arrays)

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D123838
2022-04-20 20:06:11 +03:00
Mike Kashkarov bd5371e4fc [flang] Fix LBOUND() folding for constant arrays
Previously constant folding uses 'dim' without checks which leads to ICE if we
do not have DIM= parameter. And for inputs without DIM= we need to form an
array of rank size with computed bounds instead of single value.

Add additional PackageConstant function to simplify 'if (dim)' handling since we
need to distinguish between scalar initialization in case of DIM= argument and
rank=1 array.

Also add a few more tests with 'parameter' type to verify folding for constant
arrays.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D123237
2022-04-20 20:04:31 +03:00
Yitzhak Mandelbaum c8f822ad51 [clang][dataflow] Ensure well-formed flow conditions.
Ensure that the expressions associated with terminators are associated with a
value. Otherwise, we can generate degenerate flow conditions, where both
branches share the same condition.

Differential Revision: https://reviews.llvm.org/D123858
2022-04-20 17:01:55 +00:00
Jan Svoboda f43ce5199d [clang][lex] NFCI: Use DirectoryEntryRef in FrameworkCacheEntry
This patch changes the member of `FrameworkCacheEntry` from `const DirectoryEntry *` to `Optional<DirectoryEntryRef>` in order to remove uses of the deprecated `DirectoryEntry::getName()`.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D123854
2022-04-20 19:01:02 +02:00
Jan Svoboda ba118f3067 [clang] NFCI: Use DirectoryEntryRef in FrontendAction::BeginSourceFile()
This patch removes use of the deprecated `DirectoryEntry::getName()` from `FrontendAction::BeginSourceFile()`.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D123853
2022-04-20 18:54:39 +02:00
Jan Svoboda 1d3ba05e4a [clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::load*()
This patch removes uses of the deprecated `DirectoryEntry::getName()` from `HeaderSearch::load*()` functions by using `DirectoryEntryRef` instead.

Note that we bail out in one case and use the also deprecated `FileEntry::getLastRef()`. That's to prevent this patch from growing, and is addressed in a follow-up.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D123771
2022-04-20 18:52:27 +02:00
Alexey Bataev 2cca53c815 [DAG]Introduce llvm::processShuffleMasks and use it for shuffles in DAG Type Legalizer.
We can process the long shuffles (working across several actual
vector registers) in the best way if we take the actual register
represantion into account. We can build more correct representation of
register shuffles, improve number of recognised buildvector sequences.
Also, same function can be used to improve the cost model for the
shuffles. in future patches.

Part of D100486

Differential Revision: https://reviews.llvm.org/D115653
2022-04-20 09:37:16 -07:00
Aaron Ballman 37a47aacba Speculatively fix build bot
This should address the issue in:
https://lab.llvm.org/buildbot/#/builders/77/builds/16683
2022-04-20 12:32:57 -04:00
Craig Topper e3f6c2d288 [InstCombine] Don't look through bitcast from vector in collectInsertionElements.
We're making a recursive call here and everything in the function
assumes we're looking at scalars. This would be violated if we
looked through a bitcast from vectors.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D124015
2022-04-20 09:15:32 -07:00
Craig Topper 11db0bb64d [InstCombine] Pre-commit test for D124015
Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D124016
2022-04-20 09:15:32 -07:00
chenglin.bi 1fae4b492d [InstCombine] Fold mul nuw+lshr to a single multiplication when the latter is a factor
if c is divisible by (1 << ShAmtC), we can fold this pattern:
lshr (mul nuw x, c), ShAmtC -> mul nuw x, (c >> ShAmtC)

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

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

Reviewed By: spatel, lebedev.ri, craig.topper

Differential Revision: https://reviews.llvm.org/D123453
2022-04-21 00:13:36 +08:00
Aaron Ballman e0ee080574 Speculatively fix build bots
This should address the issue found in:
https://lab.llvm.org/buildbot/#/builders/215/builds/4610
2022-04-20 12:05:33 -04:00
Aaron Ballman 7661d3bc9d Speculatively fix build bots
This should address the issues found by:
https://lab.llvm.org/buildbot/#/builders/105/builds/24292
2022-04-20 12:02:16 -04:00
Aaron Ballman 4f843f9a9e Removing some ancient, unused testing functionality
This was last touched 13 years ago in
7a1095f243
and is no longer being maintained.
2022-04-20 11:57:25 -04:00
Paul Robinson dfdb2cc0fb [PS5][NFC] Fix a test with a misplaced -x option 2022-04-20 08:56:50 -07:00
Aaron Ballman ef50d817b6 Speculatively fix build bots
This should address build failures found in:

https://lab.llvm.org/buildbot/#/builders/217/builds/3610
https://lab.llvm.org/buildbot/#/builders/215/builds/4609
https://lab.llvm.org/buildbot/#/builders/68/builds/31012
2022-04-20 11:48:06 -04:00