Commit Graph

481077 Commits

Author SHA1 Message Date
Jonas Devlieghere
ec6a34e2a7 [lldb] Pass important options to dsymForUUID (#72669)
On macOS, we usually use the DebugSymbols framework to find dSYMs, but
we have a few places (including crashlog.py) that calls out directly to
dsymForUUID. Currently, this invocation is missing two important
options:

* `--ignoreNegativeCache`: Poor network connectivity or lack of VPN can
lead to a negative cache hit. Avoiding those issues is worth the penalty
of skipping these caches.
* `--copyExecutable`: Ensure we copy the executable as it might not be
available at its original location.

rdar://118480731
2023-11-17 08:00:07 -08:00
Youngsuk Kim
3f225708c4 [llvm][InstrProfiling] Remove ptr-to-ptr bitcasts (NFC)
Opaque ptr cleanup effort (NFC).
2023-11-17 09:57:10 -06:00
erichkeane
7d1a9e81b0 [OpenACC] Rename ParseOpenACCDirective to ParseOpenACCDirectiveDecl
The former name is more useful as a callee of the function in a future
patch, so as suggested in that review, move the rename here.
2023-11-17 07:28:33 -08:00
Nemanja Ivanovic
227607190e [RISCV] Fix crash in PEI with empty entry block with Zcmp (#72117)
We check the opcode of the first instruction in the block where the
prologue is inserted without checking if the iterator points to any
instructions. When the basic block is empty, that causes a crash. One
way the prologue block can be empty is when it starts with a call to
__builtin_readcyclecounter on RV32 since that produces a loop.

Co-authored-by: Nemanja Ivanovic <nemanja@synopsys.com>
2023-11-17 16:18:44 +01:00
Nemanja Ivanovic
0765f6451f [RISCV] Use correct register class for Z[df]inx inline asm (#71872)
Allocate a register of the correct register class for inline asm
constraint "r" when used for FP values with -Zfinx/-Zdinx.

---------

Co-authored-by: Nemanja Ivanovic <nemanja@synopsys.com>
2023-11-17 16:17:48 +01:00
santhoshe447
06effaf43e [lldb][test] Add the ability to extract the variable value out of the summary. (#72631)
Fix for https://github.com/llvm/llvm-project/issues/71897
When it comes to test infrastructure the test (TestDAP_variables.py:
test_scopes_variables_setVariable_evaluate_with_descriptive_summaries)
will fail if the variable has a summary along with value.

I just tried to add a summary to a variable before we set a value to the
variable using below expression from “request_setVariable” function.
RunLLDBCommands(llvm::StringRef(), {std::string("type summary add
--summary-string "{sample summary}" (const char **) argv")});

As value has nonnumeric characters where we are trying to convert into
integer, python is throwing an error. We did not see this issue in
upstream as we are not adding summary explicitly, by default we are
getting empty summary & value for all children’s of argv parameter (even
after auto summary).

The test is failing with below error:
ERROR:
test_scopes_variables_setVariable_evaluate_with_descriptive_summaries
(TestDAP_variables.TestDAP_variables)
Traceback (most recent call last):
File
"/llvm/llvm-project/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py",
line 372, in
test_scopes_variables_setVariable_evaluate_with_descriptive_summaries
enableAutoVariableSummaries=True
File
"/llvm/llvm-project/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py",
line 266, in do_test_scopes_variables_setVariable_evaluate
argv = self.get_local_as_int("argv")
File
"//llvm/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py",
line 199, in get_local_as_int
return int(value, 16)
ValueError: invalid literal for int() with base 16: '0x0000000000001234
sample summary'
Config=x86_64-//llvm/llvm-build/bin/clang

Co-authored-by: Santhosh Kumar Ellendula <sellendu@hu-sellendu-hyd.qualcomm.com>
2023-11-17 10:15:23 -05:00
Timm Baeder
965d301dff [clang][Interp] Implement __builtin_classify_type (#71972)
This adds some infrastructure for unevaluated builtin calls, and uses the implementation from ExprConstant.cpp
2023-11-17 16:13:23 +01:00
Philip Reames
8f81c605f5 [RISCV] Remove custom instruction selection for VFCVT_RM and friends (#72540)
We already have the pseudo's for lowering these as MI nodes with
rounding mode operands, and the generic FRM insertion pass. Doing the
insertion later in the backend allows SSA level passes to avoid
reasoning about physical register copies, and happens to produce better
code in practice. The later is mostly an accident of our insertion
order; we happen to place the frm write after the vsetvli, and it's very
common for a register to be killed at the vsetvli. End result is that we
get slightly better scalar register allocation.

I'm a bit unclear on the history here. I was surprised to find this code
in ISEL lowering at all, but am also surprised once I found it that all
the patterns and pseudos seem to already exist. My best guess is that
maybe we didn't do all the possible cleanup after introducing the
HasRoundMode mechanism?
2023-11-17 07:07:37 -08:00
Cyndy Ishida
f501659768 [TextAPI] don't write out empty/zeroed out min os (#72603) 2023-11-17 06:54:52 -08:00
Danila Malyutin
44af5924b1 [Statepoint] Return undef value for the statepoint of the none token (#72552)
Helps avoid the crash in verifier when it tries to print the error.
`none` token might be produced by llvm-reduce, since it's a default
value, so by extension this also fixes llvm-reduce crash, allowing it to
just discard invalid IR.

---------

Co-authored-by: arpilipe <apilipenko@azul.com>
2023-11-17 18:32:52 +04:00
Simon Pilgrim
2ed15877e7 [X86] Ensure asm comments only print the constant values for the vector load's register width
We were printing the entire Constant, which if we were loading from a wider constant pool entry meant that we were confusing the asm comment with upper bits that aren't actually part of the load result
2023-11-17 14:30:30 +00:00
Erich Keane
ff219ea9ca [OpenACC] Initial commits to support OpenACC (#70234)
Initial commits to support OpenACC.  This patchset:

adds a clang-command line argument '-fopenacc', and starts
 to define _OPENACC, albeit to '1' instead of the standardized
value (since we don't properly implement OpenACC yet).

The OpenACC spec defines `_OPENACC` to be equal to the latest standard
implemented. However, since we're not done implementing any standard,
we've defined this by default to be `1`. As it is useful to run our
compiler against existing OpenACC workloads, we're providing a
temporary override flag to change the `_OPENACC` value to be any
entirely digit value, permitting testing against any existing OpenACC
project.

Exactly like the OpenMP parser, the OpenACC pragma parser needs to
consume and reprocess the tokens. This patch sets up the infrastructure
to do so by refactoring the OpenMP version of this into a more general
version that works for OpenACC as well.

Additionally, this adds a few diagnostics and token kinds to get us
started.
2023-11-17 06:29:02 -08:00
Joseph Huber
9c0e64999b [Offloading][NFC] Refactor handling of offloading entries (#72544)
Summary:
This patch is a simple refactoring of code out of the linker wrapper
into a common location. The main motivation behind this change is to
make it easier to change the handling in the future to accept a triple
to be used to emit entries that function on that target.
2023-11-17 08:26:20 -06:00
Jessica Del
b1e039f3b7 [AMDGPU] - Add constant folding for s_quadmask (#72381)
If the input is a constant we can constant fold the `s_quadmask`
intrinsic.
2023-11-17 15:24:23 +01:00
Cullen Rhodes
95acb33b45 [mlir][vector] Move transpose with unit-dim to shape_cast pattern (#72493)
Moved from lowering to canonicalization.
2023-11-17 14:06:03 +00:00
Stephen Tozer
e77af7e1b0 [DebugInfo] Make DIArgList inherit from Metadata and always unique (#72147)
This patch changes the `DIArgList` class's inheritance from `MDNode` to
`Metadata, ReplaceableMetadataImpl`, and ensures that it is always
unique, i.e. a distinct DIArgList should never be produced.

This should not result in any changes to IR or bitcode parsing and
printing, as the format for DIArgList is unchanged, and the order in which it
appears should also be identical. As a minor note, this patch also fixes
a gap in the verifier, where the ValueAsMetadata operands to a DIArgList
would not be visited.
2023-11-17 14:04:54 +00:00
Florian Hahn
e5e71affb7 [LV] Reverse mask up front, not when creating vector pointer. (#72163)
Reverse mask early on when populating BlockInMask. This will enable
separating mask management and address computation from the memory
recipes in the future and is also needed to enable explicit unrolling in
VPlan.
2023-11-17 13:59:35 +00:00
Eric
9ed4a57e31 Add libc++ github actions workflow to replace buildkite (#71836)
This change ports almost all of the linux buildkite builders to github
actions.

I would like to have this transition occur as soon as possible.
2023-11-17 08:57:01 -05:00
Yingwei Zheng
26ce3e4239 [InstCombine] Preserve NSW flags for lshr (mul nuw X, C1), C2 -> mul nuw nsw X, (C1 >> C2) (#72625)
Alive2: https://alive2.llvm.org/ce/z/TU_V9M

This missed optimization is discovered with the help of
https://github.com/AliveToolkit/alive2/pull/962.
2023-11-17 21:50:21 +08:00
Egor Zhdan
f049395fc8 [APINotes] Upstream APINotesManager
This upstreams more of the Clang API Notes functionality that is
currently implemented in the Apple fork:
https://github.com/apple/llvm-project/tree/next/clang/lib/APINotes
2023-11-17 13:28:51 +00:00
Jacek Caban
ec42d547eb [lld][COFF][NFC] Factor out exception table sorting. (#72518)
This is a preparation for ARM64EC support, which needs to sort both ARM
and x86_64 tables separately.
2023-11-17 12:42:32 +01:00
Matheus Izvekov
a67b85ef63 Add llvm-dlltool to the toolchain list (#72563)
This adds dlltool to the list of tools which don't get excluded from
installation when LLVM_INSTALL_TOOLCHAIN_ONLY is set.

The most important effect here is that this tool will now be included in
the official Windows release.

While llvm-lib reuses the dlltool machinary internally and has many of
the same capabilities, it does not expose the functionality controller
by the '-k' flag, which is currently the only way to create import
libraries for i386 with stdcall symbols from a module definition alone.

We avoid changing llvm-lib tool, since it is designed to emulate LIB.EXE
from MSVC toolchain, and as this functionality is not supported there,
we would have had to introduce an LLVM extension flag in order to
support it.

See https://reviews.llvm.org/D36548 for reference on rationale for
dlltool '-k' flag.
2023-11-17 11:39:20 +01:00
Kadir Cetinkaya
7aaa86b28d [include-cleaner] Add regression tests for outliving File&Source Manager 2023-11-17 11:32:51 +01:00
Simon Pilgrim
0b0440613f [X86] vec_fabs.ll - regenerate checks and add common AVX512 prefixes 2023-11-17 10:31:19 +00:00
Simon Pilgrim
a66085c84c [X86] vec_fabs.ll - sort tests into 128/256/512-bit vector types 2023-11-17 10:31:19 +00:00
jeanPerier
915f6c3d6a [flang][RFC] Adding a design document for assumed-rank objects (#71959)
This patch adds a document describing assumed-rank objects and the
related features as well as how they will be implemented in Flang.
2023-11-17 11:10:15 +01:00
Simon Pilgrim
58253dcbcd [X86] getTargetConstantBitsFromNode - bail if we're loading from a constant vector element type larger than the target value size
This can be improved upon by just truncating the constant value, but the crash needs to be addressed first.

Fixes #72539
2023-11-17 10:01:31 +00:00
Florian Hahn
1c05fe3500 [InstCombine] Pass InstCombineOptions instead of separate flags (NFC). (#72566)
This makes it simpler to pass additional flags/options in the future.
2023-11-17 09:57:05 +00:00
Adrian Kuegel
b4c1421466 [mlir] Apply ClangTidy fix
Remove redundant return.
2023-11-17 09:56:07 +00:00
Nikita Popov
8775232c49 [ValueTracking] Remove handling of KnownBits assumptions with invert
For all practical purposes, we only care about comparisons with
constant RHS in this code. In that case, an invert will be
canonicalized into the constant and it will be handled by other cases.

Given the complete lack of test coverage, I'm removing this code.
2023-11-17 10:42:18 +01:00
Marius Brehler
c4fd1fd6d4 [mlir][emitc] Rename call op to call_opaque (#72494)
This renames the `emitc.call` op to `emitc.call_opaque` as the existing
call op does not refer to the callee by symbol. The rename allows to
introduce a new call op alongside with a future `emitc.func` op to model
and facilitate functions and function calls.
2023-11-17 10:22:15 +01:00
Fangrui Song
76a441a6ef [MC] Fix compression header size check in ELF writer
This is #66888 with a test. For MC we only use a zstd test, as zlib has
a lot of versions/forks with different speed/size tradeoff, which would
make the test more brittle. If clang/test/Misc/cc1as-compress.s turns
out to be brittle, we could make the string longer.
2023-11-17 01:13:38 -08:00
kadir çetinkaya
fd2d5add43 [include-cleaner] Make sure exports of stdlib also works for physical files (#72246)
This was creating discrepancy in cases where we might have a physical
file entry (e.g. because we followed a source location from a stdlib
file) and tried to find its exporters.
2023-11-17 10:11:21 +01:00
Nikita Popov
de176d8c54 [SCEV][LV] Invalidate LCSSA exit phis more thoroughly (#69909)
This an alternative to #69886. The basic problem is that SCEV can look
through trivial LCSSA phis. When the phi node later becomes non-trivial,
we do invalidate it, but this doesn't catch uses that are not covered by
the IR use-def walk, such as those in BECounts.

Fix this by adding a special invalidation method for LCSSA phis, which
will also invalidate all the SCEVUnknowns/SCEVAddRecExprs used by the
LCSSA phi node and defined in the loop.

We should probably also use this invalidation method in other places
that add predecessors to exit blocks, such as loop unrolling and loop
peeling.

Fixes #69097.
Fixes #66616.
Fixes #63970.
2023-11-17 09:34:24 +01:00
Fangrui Song
47b8763f8a [ELF][test] gitBitcodeMachineKind: test EM_ARM 2023-11-17 00:26:26 -08:00
Aiden Grossman
d8ab8b95ba [Docs][llvm-exegesis] Fix minor issues in llvm-exegesis docs 2023-11-16 23:41:16 -08:00
Maksim Panchenko
f653f6d57a [BOLT][NFC] Delete unused declarations (#72596) 2023-11-16 23:36:19 -08:00
Timm Baeder
ea316625d1 [clang] Add bitint classification for __builtin_classify_type (#72036)
See #71911
2023-11-17 08:31:25 +01:00
Timm Baeder
3defe8facc [clang][Interp] Implement __builtin_bitreverse (#71687)
Since the return value of this function is slightly more involved than
the void/bool/int/size_t return values we've seen so far, also refactor
this.
2023-11-17 08:29:13 +01:00
Timm Bäder
894a38753e [clang][Interp][NFC] Properly implement IntegralAP::from(IntegralAP)
This used to just pass on the given parameter, but we need to respect
the given bit width.
2023-11-17 08:04:30 +01:00
Yingwei Zheng
865c1fda6f [InstCombine] Preserve NSW flags for neg instructions (#72548)
Alive2: https://alive2.llvm.org/ce/z/F9HG3M

This missed optimization is discovered with the help of
https://github.com/AliveToolkit/alive2/pull/962.
2023-11-17 14:02:47 +08:00
Matthias Braun
5353d3f509 Remove unused LoopInfo from InlineSpiller and SpillPlacement (NFC) (#71874) 2023-11-16 21:20:30 -08:00
Fangrui Song
ae7fb21b5a [ELF] Make some InputSection/InputFile member functions const. NFC 2023-11-16 20:24:14 -08:00
Louis Dionne
b034da7dad [libc++][NFC] Fix include guard for simd helper header 2023-11-16 22:00:37 -05:00
Tacet
00da5eb86e [NFC] Remove outdated comment (#72591)
Special-casing has been already removed.
2023-11-16 21:23:07 -05:00
Tacet
09ac2ec3ad Remove deprecated warning from cmake files (#72595)
`LIBCXXABI_SYSROOT`, `LIBCXXABI_TARGET_TRIPLE` and
`LIBCXXABI_GCC_TOOLCHAIN` are not supported anymore. Based on the
comment, the warning should be removed after branching for LLVM 15.
2023-11-16 21:20:12 -05:00
Alexey Bataev
72b97630bc [SLP][NFC]Fix comparison of integers of different signs warning, NFC. 2023-11-16 17:18:28 -08:00
Shraiysh
c06700bd75 Revert "[flang][OpenMP] Add semantic check for declare target" (#72592)
Reverts llvm/llvm-project#71861
2023-11-16 19:17:56 -06:00
Aart Bik
83cf0dc982 [mlir][sparse] implement direct IR alloc/empty/new for non-permutations (#72585)
This change implements the correct *level* sizes set up for the direct
IR codegen fields in the sparse storage scheme. This brings libgen and
codegen together again.

This is step 3 out of 3 to make sparse_tensor.new work for BSR
2023-11-16 17:17:41 -08:00
Lang Hames
d97981c98a [ORC-RT] Add missing cstdint include.
This should have been included in b2bbe8cc1c. Adding it should fix the bot
failures in https://lab.llvm.org/buildbot/#/builders/85/builds/20288
2023-11-16 16:45:29 -08:00