Commit Graph

459708 Commits

Author SHA1 Message Date
Ilya Kuklin
8be139fc12 [lldb] Add settings for expression evaluation memory allocations.
Expression evaluation allocates memory for storing intermediate data during evaluation. For it to work properly it has to be allocated within target's available address space, for example within first 0xFFFF bytes for the 16-bit MSP430. The memory for such targets can be very tightly packed, but not all targets support GetMemoryRegionInfo API to pick an unused region, like MSP430 with MSPDebug GDB server.

These settings allow the programmer to manually pick precisely where and how much memory to allocate for expression evaluation in order not to overlap with existing data in process memory.

Reviewed By: bulbazord

Differential Revision: https://reviews.llvm.org/D149262
2023-05-02 11:02:44 -07:00
Nikolas Klauser
7e7bd9833b [libc++] Add _LIBCPP_HIDE_FROM_ABI to the unsequenced_policy constructor 2023-05-02 10:49:39 -07:00
Jonas Devlieghere
611bd6c6ae
[lldb] Make exe_ctx an optional argument in OptionValueProperties (NFC)
The majority of call sites are nullptr as the execution context.
Refactor OptionValueProperties to make the argument optional and
simplify all the callers.
2023-05-02 10:36:11 -07:00
Florian Hahn
7f8dee5c54
[X86] Remove stale checks after a30c17aba9. 2023-05-02 18:24:50 +01:00
NAKAMURA Takumi
d091a19e58 Temporary fix for MVT::getSizeInBits() to handle aarch64svcount
Support/MVTTest.cpp was missing text matrix for it.

FIXME: `aarch64svcount` should be in the td.
2023-05-03 02:23:24 +09:00
Florian Hahn
a30c17aba9
[X86] Auto-generate checks for file.
This makes it easier to update the test checks and also adds better
coverage.
2023-05-02 18:21:11 +01:00
Alex Langford
2bea2d7b07 [lldb] Refactor SBFileSpec::GetDirectory
There's no reason to create an entire new filespec to mutate and grab
data from when we can just grab the data directly.

Differential Revision: https://reviews.llvm.org/D149625
2023-05-02 10:01:36 -07:00
Alexey Lapshin
85c2768ce9 [Support][Parallel] Initialize threadIndex and add assertion checking its usage.
That patch adds a check for threadIndex being used with only threads
created by ThreadPoolExecutor. This helps catch two types of errors:

1. If a thread is created not by ThreadPoolExecutor its index may clash
   with the index of another thread. Using threadIndex, in that case, may
   lead to a data race.

2. Index of the main thread(threadIndex == 0) currently clashes with
   the index of thread0 in ThreadPoolExecutor threads. That may lead
   to a data race if main thread and thread0 are executed concurrently.

This patch allows execution tasks on the main thread only in case
parallel::strategy.ThreadsRequested == 1. In all other cases,
assertions check that threadIndex != UINT_MAX(i.e. that task
is executed on a thread created by ThreadPoolExecutor).

Differential Revision: https://reviews.llvm.org/D148916
2023-05-02 18:44:15 +02:00
Ben Langmuir
5437a4c5e9 [llvm][vfs] Avoid silent fallback to process-wide working directory
In createPhysicalFileSystem, preserve the per-instance working
directory, even after the first call to getcwd fails.

rdar://108213753

Differential Revision: https://reviews.llvm.org/D149173
2023-05-02 09:39:07 -07:00
NAKAMURA Takumi
64888d437c SemaRISCVVectorLookup.cpp: Prune default: block. [-Wcovered-switch-default] 2023-05-03 01:37:37 +09:00
Dhruva Chakrabarti
8cd1f0d888 [OpenMP] [OMPT] [amdgpu] [4/8] Implemented callback registration in nextgen plugins
The purpose of this patch is to Implement registration of callback functions in the generic plugin by looking up corresponding callbacks in libomptarget. The overall design document is https://rice.app.box.com/s/pf3gix2hs4d4o1aatwir1set05xmjljc

Defined an object of type OmptDeviceCallbacksTy in the amdgpu plugin for holding the tool-provided callback functions. Implemented a global constructor in the plugin that creates a connector object to connect with libomptarget. The callbacks that are already registered with libomptarget are looked up and registered with the plugin.

Combined with an internal patch from Dhruva Chakrabarti, which fixes the OMPT initialization ordering.
Achieved through removal of the constructor attribute from ompt_init.

Patch from John Mellor-Crummey <johnmc@rice.edu>
With contributions from:
Dhruva Chakrabarti <Dhruva.Chakrabarti@amd.com>
Michael Halkenhaeuser <MichaelGerald.Halkenhauser@amd.com>

Differential Revision: https://reviews.llvm.org/D124070
2023-05-02 18:35:30 +02:00
Fangrui Song
1408504564 [ELF] Name MergeSyntheticSection using an input section instead of the output section
In a link map, the input section name gives more information. See the updated
merge-entsize.s for an example. The output file is unchanged.

Compiler generated input sections with the SHF_MERGE flag have names such as
.rodata.str1.1 and .rodata.cstN, and are not affected by -fdata-sections.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D149466
2023-05-02 09:35:00 -07:00
Quinn Dawkins
009c053e3f [mlir][linalg] Allow outer dims perm and untiled dims in pack/unpack generalization
Extends the pack/unpack generalization patterns to work for any packing
op with only full tiles. This produces a combination of rank-reduced
insert/extract slice ops paired with a transpose on the reduced shape,
similar to what the pattern currently produces for fully tiled
pack/unpacks. Note that only the outer dims are rank-reduced in this
pattern, leaving the shape of the inner tile intact.

Differential Revision: https://reviews.llvm.org/D147555
2023-05-02 12:26:45 -04:00
Alvin Wong
0d5b51e0ac [sanitizer][asan][win] Only unmap unneeded shadow memory on x86_64
D21942 / 1128db8fe1 added support for
committing shadow memory on demand on Win 64-bit. The reason it is not
enabled on 32-bit wasn't clear but the page table overhead on Windows 7
may be a contributing factor.

In `AsanMapUnmapCallback::OnUnmap`, `FlushUnneededASanShadowMemory` is
called to release shadow memory. It calls `ReleaseMemoryPagesToOS`,
which had been a no-op on Windows, until D95892 /
81b1d3da09 in which it was changed to
unmap full pages that the memory region covers. This was done on both
32-bit and 64-bit.

AddressSanitizerInterface.GetHeapSizeTest appears to fail on i686
targets as a side effect of this. This test allocates and frees a huge
chunk of memory which causes shadow memory to be unmapped immediately.
When the test allocates the chunk of memory a second time, asan tries to
reuse the same shadow memory region, but because the shadow memory has
now been unmapped, it causes an access violation and crashes the test.

x86_64 is not affected, because the code that handles commiting shadow
memory on demand also handles this situation, allowing the test to work
without crashing.

Therefore, this patch changes `FlushUnneededASanShadowMemory` on Windows
to only release/unmap the shadow memory on x86_64 to stop this from
happening on i686.

Differential Revision: https://reviews.llvm.org/D149025
2023-05-03 00:23:12 +08:00
4vtomat
e6ffd42a93 [tests] Add missing REQUIRES: riscv-registered-target to clang test 2023-05-02 09:19:32 -07:00
Shao-Ce SUN
fe558efe71 [RISCV][CodeGen] Support Zfinx codegen
This patch was split from D122918 . Co-Author: @liaolucy @realqhc

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D148874
2023-05-03 00:13:38 +08:00
NAKAMURA Takumi
ea2b79d48d Try to fix CodeGenTypes issues in mlir 2023-05-03 00:58:57 +09:00
Dan McGregor
ea6ecdbfe0 Call printName to get name of Decl
Rather than sending a name directly to the stream, use printName
to preserve any PrintingPolicy. This ensures that names are properly
affected by path remapping.

Fixes: https://github.com/llvm/llvm-project/issues/62192
Differential Revision: https://reviews.llvm.org/D149272
2023-05-02 11:56:23 -04:00
Mark de Wever
d5442761f9 [libc++][ranges] Fixes as_rvalue's linkage.
This was discovered while working on modules. They can't export
declarations with internal linkage.

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D149593
2023-05-02 17:55:16 +02:00
Adrian Prantl
45905b53f0 Add missing include 2023-05-02 08:37:40 -07:00
Spenser Bauman
19109a274e [mlir][tosa] Fix crash when inferring shape of tosa.equal
The tosa-infer-shapes pass crashes when trying to infer the output shape
of tosa.equal when the input shape is unranked.
This is due to tosa-infer-shapes requiring at least information on the
base type of the resulting operation from inferReturnTypeComponents.
This change enhances EqualOp::inferReturnTypeComponents to always supply
the inferred elementType.

Reviewed By: eric-k256

Differential Revision: https://reviews.llvm.org/D149582
2023-05-02 08:18:35 -07:00
NAKAMURA Takumi
631bfdbee5 Switch llvm/CodeGen/MachineValueType.h to the generated one
Prune `SupportTests/MVTTest` since it is no longer needed.

Depends on D148769

Differential Revision: https://reviews.llvm.org/D148770
2023-05-03 00:13:20 +09:00
NAKAMURA Takumi
5d71ec6e44 Split out CodeGenTypes from CodeGen for LLT/MVT
This reduces dependencies on `llvm-tblgen` so much.

`CodeGenTypes` depends on `Support` at the moment.
Be careful to append deps on this, since Targets' tablegens
depend on this.

Depends on D149024

Differential Revision: https://reviews.llvm.org/D148769
2023-05-03 00:13:20 +09:00
NAKAMURA Takumi
c1221251fb Restore CodeGen/MachineValueType.h from Support
This is rework of;

  - rG13e77db2df94 (r328395; MVT)

Since `LowLevelType.h` has been restored to `CodeGen`, `MachinveValueType.h`
can be restored as well.

Depends on D148767

Differential Revision: https://reviews.llvm.org/D149024
2023-05-03 00:13:20 +09:00
NAKAMURA Takumi
9cfeba5b12 Restore CodeGen/LowLevelType from Support
This is rework of;
  - D30046 (LLT)

Since I have introduced `llvm-min-tblgen` as D146352, `llvm-tblgen`
may depend on `CodeGen`.

`LowLevlType.h` originally belonged to `CodeGen`. Almost all userse are
still under `CodeGen` or `Target`. I think `CodeGen` is the right place
to put `LowLevelType.h`.

`MachineValueType.h` may be moved as well. (later, D149024)

I have made many modules depend on `CodeGen`. It is consistent but
inefficient. It will be split out later, D148769

Besides, I had to isolate MVT and LLT in modmap, since
`llvm::PredicateInfo` clashes between `TableGen/CodeGenSchedule.h`
and `Transforms/Utils/PredicateInfo.h`.
(I think better to introduce namespace llvm::TableGen)

Depends on D145937, D146352, and D148768.

Differential Revision: https://reviews.llvm.org/D148767
2023-05-03 00:13:19 +09:00
NAKAMURA Takumi
2df215f7a6 [Bazel] Update for D148308 (riscv-sifive) 2023-05-03 00:13:19 +09:00
Erich Keane
3e850a6eea Revert "[Clang][Sema] Fix comparison of constraint expressions"
This reverts commit e3b1083e00.

This was reverted because it breaks a number of libstdc++ examples, AND
required a workaround that causes hiding of legitimate bugs.
2023-05-02 08:09:35 -07:00
Erich Keane
ad7111495f Revert "[Clang][Sema] Add a temporary workaround in SemaConcept.cpp"
This reverts commit ce861ec782.
2023-05-02 08:09:01 -07:00
Jakub Kuderski
9701c5abd6 [mlir][arith] Add narrowing patterns for max*i and min*i
Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D149583
2023-05-02 10:50:07 -04:00
Teresa Johnson
48f18ecd82 [ThinLTO] Loosen up variable importing correctness checks
After importing variables, we do some checking to ensure that variables
marked read or write only, which have been marked exported (e.g.
because a referencing function has been exported), are on at least one
module's imports list. This is because the read or write only variables
will be internalized, so we need a copy any any module that references
it.

This checking is overly conservative in the case of linkonce_odr or
other linkage types where there can already be a duplicate copy in
existence in the importing module, which therefore wouldn't need to
import it. Loosen up the checking for these linkage types.

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

Differential Revision: https://reviews.llvm.org/D149630
2023-05-02 07:49:03 -07:00
Jakub Kuderski
46740dd02b [mlir][arith] Add narrowing patterns for subi, divsi, and divui
Each of these ops is compatible with only one extension kind and
produces an extra result bit.

I checked these transformation in Alive2:
1. subi + extsi: https://alive2.llvm.org/ce/z/ipmZZA
2. divsi + extsi: https://alive2.llvm.org/ce/z/fAcqUv
3. divui + extui: https://alive2.llvm.org/ce/z/QZJpFp

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D149531
2023-05-02 10:44:29 -04:00
Cullen Rhodes
707b6e94b8 [mlir][SparseTensor][ArmSVE] Fix missing lli substitutions
The MLIR SVE integration tests are now enabled in the
clang-aarch64-full-2stage buildbot under emulation (QEMU) and two of the
sparse integration tests are failing [1]:

  * mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sorted_coo.mlir
  * mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir

The reason for this is the SVE RUN lines use plain 'lli' rather than the
'%lli_host_or_aarch64_cmd' substitution that's necessary to run under
emulation. The CI doesn't support SVE so the tests will SIGILL unless
run under emulation.

I should note the logs don't show a SIGILL, only the non-descript:

  FileCheck error: '<stdin>' is empty.

but I expect this is what's actually happening.

https://lab.llvm.org/buildbot/#/builders/179/builds/6051/steps/12/logs/stdio
2023-05-02 14:43:48 +00:00
Joseph Huber
2353b52eae [libc] Fix some missing features from the hermetic test support
This patch addresses some of the flags and features that are currently
missing from the hermetic test support. This mostly just fixes the
`add_libc_test` option failing to find a few dependencies or missing
arguments from the previous unit test support.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D149629
2023-05-02 09:40:24 -05:00
Job Noorman
d755e10e7a [BOLT] Make sure Mach-O binaries are actually linked
Note that this issue is also solved by D147544.

Reviewed By: alexander-shaposhnikov

Differential Revision: https://reviews.llvm.org/D149244
2023-05-02 16:22:49 +02:00
Job Noorman
f3ea4228fd [BOLT] Make sure all section allocations have deterministic contents
For empty sections, RuntimeDyld always allocates 1 byte but leaves it
uninitialized. This causes the contents of some output sections to be
non-deterministic.

Note that this issue is also solved by D147544.

Fixes #59008

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D149243
2023-05-02 16:18:01 +02:00
Jakub Kuderski
e2f7563d7c [mlir][arith] Add narrowing patterns for addi and muli
These two ops are handled in a very similar way -- the only difference
in the number result bits produced.

I checked these transformation with Alive2:
1.  addi + sext: https://alive2.llvm.org/ce/z/3NSs9T
2.  addi + zext: https://alive2.llvm.org/ce/z/t7XHOT
3.  muli + sext: https://alive2.llvm.org/ce/z/-7sfW9
4.  muli + zext: https://alive2.llvm.org/ce/z/h4yntF

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D149530
2023-05-02 10:10:10 -04:00
Jay Foad
55678b43b5 [CodeGen] One more use of MachineBasicBlock::phis. NFC. 2023-05-02 14:55:24 +01:00
Joel E. Denny
fa280c1994 [OpenMP] In libomptarget, assume alignment at powers of two
This patch fixes a bug introduced by D142586, which landed as
434992c96e.  The fix was to only look for alignments that are powers
of 2.  See the new test case for details.

Reviewed By: jdoerfert, jhuber6

Differential Revision: https://reviews.llvm.org/D149490
2023-05-02 09:44:58 -04:00
Alexey Lapshin
709bc11266 [DWARFLinker][NFC] Make interfaces to be compatible.
This patch makes interface of AddressManager from DWARFLinker
to be compatible with AddressesMap from DWARFLinkerParallel.
This makes both linkers to be interchangeable.

Differential Revision: https://reviews.llvm.org/D147455
2023-05-02 14:59:23 +02:00
4vtomat
fa43608d16 [RISCV][RISCV][clang] Split out SiFive Vector C intrinsics from riscv_vector.td
Since we don't always need the vendor extension to be in riscv_vector.td,
so it's better to make it be in separated header.

Depends on D148223 and D148680

Differential Revision: https://reviews.llvm.org/D148308
2023-05-02 05:51:51 -07:00
Alexandre Ganea
8efc7de0e6 [llvm][unittests] Silence warning on MSVC after 5b2423183c
Differential revision: https://reviews.llvm.org/D149609
2023-05-02 08:49:47 -04:00
Dmitry Chernenkov
73e15b5edb [lldb] Add cstdio include to fix a595b931f1 2023-05-02 12:47:37 +00:00
4vtomat
4bf846ba40 [RISCV] Split out part of riscv_vector.td to riscv_vector_common.td
This makes other new targets able to reuse predefined classes
in their own *.td files.

Differential Revision: https://reviews.llvm.org/D148680
2023-05-02 05:40:13 -07:00
Nelson Chu
8ed9cf06e9 [SiFive][RISCV][clang] Support C intrinsics for xsfvcp extension.
Depends on D147934 and D147935

Differential Revision: https://reviews.llvm.org/D148223
2023-05-02 05:40:13 -07:00
Jay Foad
4b2381a5f0 [CodeGen] Make use of MachineBasicBlock::phis. NFC. 2023-05-02 13:39:01 +01:00
Shilei Tian
8a11c5522f Revert "[OpenMP] Make libomptarget link against libomp"
This reverts commit dc049a4ea6.

It causes issue of export target.
2023-05-02 08:35:55 -04:00
Mariya Podchishchaeva
7133283835 [clang] Do not attempt to zero-extend _BitInt(1) when not required
`ConvertTypeForMem` doesn't return wider type for _BitInt unless it is
used in a bitfield, so no need to extend when trying to initialize a
global variable.

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

Reviewed By: erichkeane, shafik

Differential Revision: https://reviews.llvm.org/D149436
2023-05-02 08:23:22 -04:00
Zhiyao Ma
1d0ccebcd7 [ARM] Don't allocate memory if free space in segmented stack is just enough
Assuming that the stack grows downwards, it is fine if the stack
pointer is exactly at the stacklet boundary. We should use
less-or-equal condition when deciding whether to skip new memory
allocation.

Differential Revision: https://reviews.llvm.org/D149315
2023-05-02 13:09:49 +01:00
Kiran Chandramohan
39e8e59950 [Flang][OpenMP] Use fir.if instead of scf.if in lastprivate lowering
For finding the last iteration of a loop, or the last section an
if condition is generated. Using scf::if can cause some lowering
issues since the code contained inside it can have branches. Using
fir::if instead ensures that the fir::if is lowered into branches
along with any code contained inside that can generate branches.

Fixes #62458.

Reviewed By: NimishMishra

Differential Revision: https://reviews.llvm.org/D149547
2023-05-02 12:02:04 +00:00
Michael Buch
52882de0e6 [lldb][test] TestCPP20Standard.py: make it a libc++ test
We just want to test whether the language switch works.
This is easier to control for libc++, since for bots building
the tests against libstdc++ we might not have the necessary
`<compare>` header available currently.
2023-05-02 07:38:53 -04:00