Commit Graph

406761 Commits

Author SHA1 Message Date
Nico Weber 63d518f31a [tsan] Move tsan/rtl build rules into tsan/rtl/CMakeLists.txt
That way, the build rules are closer to the source files they describe.

No intended behavior change.

Differential Revision: https://reviews.llvm.org/D115155
2021-12-06 19:58:30 -05:00
Nico Weber 50dda49c7d Tweak diagnostic text from e4eb6216c2 2021-12-06 19:57:28 -05:00
Ye Luo 21a51cebf1 [OpenMP][libomptarget] amdgpu plugin adds runpath for dependencies
amdgpu plugin depends on libhsa-runtime64 library. Add runpath in case it is not on the LD_LIBRARY_PATH.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D115198
2021-12-06 18:19:18 -06:00
Med Ismail Bennani caea440a11 [lldb/plugins] Add arm64(e) support to ScriptedProcess
This patch adds support for arm64(e) targets to ScriptedProcess, by
providing the `DynamicRegisterInfo` to the base `lldb.ScriptedThread` class.
This allows create and debugging ScriptedProcess on Apple Silicon
hardware as well as Apple mobile devices.

It also replace the C++ asserts on `ScriptedThread::GetDynamicRegisterInfo`
by some error logging, re-enables `TestScriptedProcess` for arm64
Darwin platforms and adds a new invalid Scripted Thread test.

rdar://85892451

Differential Revision: https://reviews.llvm.org/D114923

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2021-12-06 16:11:59 -08:00
Nico Weber 6fef466779 [gn build] Port 3678326d28 2021-12-06 19:08:59 -05:00
Nico Weber 3678326d28 Revert "ext-tsp basic block layout"
This reverts commit c68f71eb37.

Breaks tests on arm hosts, see comments on https://reviews.llvm.org/D113424
2021-12-06 19:08:20 -05:00
Nico Weber 1262cf7f04 Fix incorrect fallthrough in e4eb6216c2 2021-12-06 18:41:52 -05:00
Rob Suderman 05e33d846f [mlir][tosa] Resubmit add tosa.conv2d as tosa.fully_connected canonicalization
Fixed the tosa.conv2d to tosa.fully_connected canonicalization for incorrect
output channels. Included uptes to tests to include checks for the result
shapes during canonicalization.

This allows conv2d to transform to the simpler fully_connected operation.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D115170
2021-12-06 15:33:07 -08:00
Dave Lee 13278efd0c [lldb] Remove some trivial scoped timers
While profiling lldb (from swift/llvm-project), these timers were noticed to be short lived and high firing, and so they add noise more than value.

The data points I recorded are:

`FindTypes_Impl`: 49,646 calls, 812ns avg, 40.33ms total
`AppendSymbolIndexesWithName`: 36,229 calls, 913ns avg, 33.09ms total
`FindAllSymbolsWithNameAndType`: 36,229 calls, 1.93µs avg, 70.05ms total
`FindSymbolsWithNameAndType`: 23,263 calls, 3.09µs avg, 71.88ms total

Differential Revision: https://reviews.llvm.org/D115182
2021-12-06 15:22:28 -08:00
Chris Davis e4eb6216c2 Enable pdbpagesize to allow support for PDB file sizes > 4GB
Enable the pdbpagesize flag to allow linking of PDB files > 4GB.
Also includes a couple small fixes to change to uint64_t to support the
larger file sizes.  I updated the max file size check in MSFBuilder.cpp
to take into account the page size.

Differential Revision: https://reviews.llvm.org/D115051
2021-12-06 18:22:08 -05:00
LLVM GN Syncbot 92b94dabef [gn build] Port cc3bb85580 2021-12-06 23:16:18 +00:00
Nico Weber 0890efe613 Reland "[gn build] (manually) port 4a16fe1369 (debuginfod)"
This reverts commit 4b63562ebc.
The debuginfod change relanded in 0e0f1b28fc
2021-12-06 18:15:20 -05:00
Kirill Stoimenov f4606d2b70 Revert "[ASan] Added asan_shadow_defines.h, which contatins shadow offset for various platforms."
This reverts commit 2f3bb59f51.

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D115193
2021-12-06 23:13:31 +00:00
Daniele Castagna abbdc13e68 [CUDA][SPIRV] Use OpenCLKernel CC for CUDA -> SPIRV
Select the OpenCLKernel calling convention for kernels when compiling
CUDA targeting SPIR-V.

In this way the generated LLVM IR will have a spir_kernel calling
convention that will be translated to an OpEntryPoint when converting
to SPIRV.

Reviewed By: jlebar, tra

Differential Revision: https://reviews.llvm.org/D114407
2021-12-06 15:06:57 -08:00
James Nagurne cc3bb85580 [llvm][Hexagon] Generalize VLIWResourceModel, VLIWMachineScheduler, and ConvergingVLIWScheduler
The Pre-RA VLIWMachineScheduler used by Hexagon is a relatively generic
implementation that would make sense to use on other VLIW targets.

This commit lifts those classes into their own header/source file with the
root VLIWMachineScheduler. I chose this path rather than adding the
strategy et al. into MachineScheduler to avoid bloating the file with other
implementations.

Target-specific behaviors have been captured and replicated through
function overloads.

- Added an overloadable DFAPacketizer creation member function. This is
  mainly done for our downstream, which has the capability to override
  the DFAPacketizer with custom implementations. This is an upstreamable
  TODO on our end. Currently, it always returns the result of
  TargetInstrInfo::CreateTargetScheduleState
- Added an extra helper which returns the number of instructions in the
  current packet. This is used in our downstream, and may be useful
  elsewhere.
- Placed the priority heuristic values into the ConvergingVLIWscheduler
  class instead of defining them as local statics in the implementation
- Added a overridable helper in ConvergingVLIWScheduler so that targets
  can create their own VLIWResourceModel

Differential Revision: https://reviews.llvm.org/D113150
2021-12-06 16:23:48 -06:00
wren romano f527fdf51e [mlir][sparse] Code cleanup for SparseTensorConversion
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D115004
2021-12-06 14:13:35 -08:00
Noah Shutty 0e0f1b28fc [llvm] [Debuginfo] Debuginfod client library.
This adds a Debuginfod client library which queries servers specified by the `DEBUGINFOD_URLS` environment variable for the debuginfo, executable, or a specified source file associated with a given build id.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D112758
2021-12-06 21:52:38 +00:00
Kirill Stoimenov 2f3bb59f51 [ASan] Added asan_shadow_defines.h, which contatins shadow offset for various platforms.
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D115075
2021-12-06 21:45:46 +00:00
Yaxun (Sam) Liu 3b172f60c6 [HIP] Fix -fgpu-rdc for Windows
This patch fixes issues for -fgpu-rdc for Windows MSVC
toolchain:

Fix COFF specific section flags and remove section types
in llvm-mc input file for Windows.

Escape fatbin path in llvm-mc input file.

Add -triple option to llvm-mc.

Put __hip_gpubin_handle in comdat when it has linkonce_odr
linkage.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D115039
2021-12-06 16:42:23 -05:00
Danil Stefaniuc 6622c14113 [formatters] Add a pointer and reference tests for a list and forward_list formatters for libstdcpp and libcxx
This adds extra tests for libstdcpp and libcxx list and forward_list formatters to check whether formatter behaves correctly when applied on pointer and reference values.

Reviewed By: wallace

Differential Revision: https://reviews.llvm.org/D115137
2021-12-06 13:42:03 -08:00
Walter Erquinigo 2ea3c8a50a [formatters] Add a deque formatter for libstdcpp and fix the libcxx one
This adds the formatters for libstdcpp's deque as a python
implementation. It adds comprehensive tests for the two different
storage strategies deque uses. Besides that, this fixes a couple of bugs
in the libcxx implementation. Finally, both implementation run against
the same tests.

This is a minor improvement on top of Danil Stefaniuc's formatter.
2021-12-06 13:42:03 -08:00
Eugene Zhulenev 68a7c001ad [mlir] Improve async parallel for tests + fix typos
Do load and store to verify that we process each element of the iteration space once.

Reviewed By: cota

Differential Revision: https://reviews.llvm.org/D115152
2021-12-06 13:27:54 -08:00
David Blaikie 097a1cb1d5 Bazel: add new llvm-c/Deprecated.h header 2021-12-06 12:18:02 -08:00
Michael Kruse fed966f2a4 [OpenMPIRBuilder] Implicitly defined control blocks. NFC.
Do not explicitly store the BasicBlocks for Preheader, Body and After inside CanonicalLoopInfo, but look the up when needed using their position relative to the other loop control blocks. By definition, instructions inside these are not managed by CanonicalLoopInfo (except terminator for Preheader) hence it makes sense to think of them as connections to the CanonicalLoopInfo instead of part of the CanonicalLoopInfo itself.

In particular for Preheader, it makes using SplitBasicBlock easier since inserting control flow at an InsertPoint may otherwise require updating the CanonicalLoopInfo's Preheader because the branch that jumps to the header is moved to another BasicBlock.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D114368
2021-12-06 14:08:07 -06:00
Rob Suderman c5fef77bc3 [mlir] Add CtPop to MathOps with lowering to LLVM
math.ctpop maths to the llvm.ctpop intrinsic.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D114998
2021-12-06 11:54:20 -08:00
Arnold Schwaighofer 7c0e066869 [coro async] Don't use lifetime.start based alloca localization for ABI.Async/ABI.Retcon
Infinite loops can lead to an IR representation where the lifetime.end
intrinsice is missing. The code to do lifetime based optimization then
fails to see that an address escapes (is life) accross a supspend.

Eventually, we could detect such situations and disable it under more narrow
circumstances. For now, do the correct thing.

rdar://83635953

Differential Revision: https://reviews.llvm.org/D110949
2021-12-06 11:50:51 -08:00
Simon Pilgrim 5983cfdc50 [X86] LowerRotate - fix assertion. NFC.
v32i16 rotation lowering is only lowered on non-BWI targets.
2021-12-06 19:46:22 +00:00
Balázs Kéri 341a30a4ba [clang][ASTImporter] Update lookup table correctly at deduction guides.
Declaration context of template parameters of a FunctionTemplateDecl
may be different for each one parameter if the template is a
deduction guide. This case is handled correctly after this change.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D114418
2021-12-06 20:40:16 +01:00
Nick Desaulniers 73ee4e1cbd [clang][ARM] only check -mtp=cp15 for non-asm sources
This diagnostic is really to highlight lack of support for hard thread
pointers in post-RA instruction scheduling for non-armv6k+ targets;
something that isn't run for assembler sources.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1502
Link: https://lore.kernel.org/all/814585495.6773.1636629846970@jenkins.jenkins/

Reviewed By: ardb

Differential Revision: https://reviews.llvm.org/D114124
2021-12-06 11:31:23 -08:00
Nico Weber 4b63562ebc Revert "[gn build] (manually) port 4a16fe1369 (debuginfod)"
This reverts commit f0cda7155c.
4a16fe1369 got reverted in f45c9c56c5.
2021-12-06 14:24:01 -05:00
Noah Shutty f45c9c56c5 Revert "[llvm] [Debuginfo] Debuginfod client library."
This reverts commit 4a16fe1369 because it
caused failures on Windows builds.
2021-12-06 19:19:14 +00:00
Aaron Ballman ead449aee4 Fixing this test which failed due to different warnings 2021-12-06 14:13:29 -05:00
Arnold Schwaighofer 64ba9dd943 [coro async] Disable lifetime.start sinking for ABI::Async and ABI::Retcon
It does not handle loops correctly i.e it moves the lifetime.start
intrinsic into a loop rendering the stack object as not alive for part
of the loop.

```
  entry:
    %obj = alloca i8
    lifetime.start(%obj)

    br loop

  loop:
    coro.suspend()
    escape(%obj)
    cond_br %cond, label %exit, label loop

    br loop

  exit:
    lifetime.end(%obj

```

After sinking:

```
  entry:
    %obj = alloca i8
    br loop

  loop:
    coro.suspend()
    lifetime.start(%obj)
    escape(%obj)
    cond_br %cond, label %exit, label loop

    br loop

  exit:
    lifetime.end(%obj

```

rdar://83411917

Differential Revision: https://reviews.llvm.org/D110953
2021-12-06 10:59:43 -08:00
Aaron Ballman 0ef8ad08db Fix a failing test case after 6c75ab5f66
The test is the same whether it's testing _BitInt or _ExtInt, so use
the type which is not deprecated.
2021-12-06 13:53:43 -05:00
Louis Dionne 2db67e9771 [libc++] Fix the return value of max_size()
I assume nobody ever uses std::string_view::max_size() outside of
testing. However, we should still return a value that is based on
something with a reasonable rationale. Previously, we would forget
to take into account the size of the character type stored in the
string, and this patch takes that into account.

Thanks to @mclow.lists for pointing out this issue.

Differential Revision: https://reviews.llvm.org/D114395
2021-12-06 13:53:25 -05:00
Alexey Bataev a101a9b64b [SLP]Fix compiler crash when calculating extract cost for undefs.
Need to add an extra check for potential undef values in
computeExtractCost function to avoid compiler crash on casting to
instructon.

Differential Revision: https://reviews.llvm.org/D115162
2021-12-06 10:46:13 -08:00
Louis Dionne 5871969048 [libc++][NFC] Fix release note indentation 2021-12-06 13:44:15 -05:00
Florian Hahn 07276e49e3
[LV] Check VPValue operand instead of Cost::isUniformAfterVec (NFC).
ILV::scalarizeInstruction still uses the original IR operands to check
if an input value is uniform after vectorization.

There is no need to go back to the cost model to figure that out, as the
information is already explicit in the VPlan. Just check directly
whether the VPValue is defined outside the plan or is a uniform
VPReplicateRecipe.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D114253
2021-12-06 18:32:35 +00:00
Aaron Ballman 1f257accd7 Speculatively fix the LLDB build bots from 6c75ab5f66
It looks like some renames got missed.
2021-12-06 13:30:15 -05:00
Nico Weber f0cda7155c [gn build] (manually) port 4a16fe1369 (debuginfod) 2021-12-06 13:19:09 -05:00
Aaron Ballman 1feb8ab0d3 Update the status of N2412 in C (we do not implement large parts of it) 2021-12-06 13:14:13 -05:00
Jonas Paulsson cbf682cb1c [SystemZ] Improve codegen for memset.
Memset with a constant length was implemented with a single store followed by
a series of MVC:s. This patch changes this so that one store of the byte is
emitted for each MVC, which avoids data dependencies between the MVCs. An
MVI/STC + MVC(len-1) is done for each block.

In addition, memset with a variable length is now also handled without a
libcall. Since the byte is first stored and then MVC is used from that
address, a length of two must now be subtracted instead of one for the loop
and EXRL. This requires an extra check for the one-byte case, which is
handled in a special block with just a single MVI/STC (like GCC).

Review: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D112004
2021-12-06 12:10:58 -06:00
Martin Probst 327d966365 clang-format: [JS] test case for numeric separators.
ES2021 allows numeric literals using `_` as a separator. This already
works, but had no test.

Differential Revision: https://reviews.llvm.org/D115147
2021-12-06 19:01:24 +01:00
Noah Shutty 4a16fe1369 [llvm] [Debuginfo] Debuginfod client library.
This adds a Debuginfod client library which queries servers specified by the `DEBUGINFOD_URLS` environment variable for the debuginfo, executable, or a specified source file associated with a given build id.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D112758
2021-12-06 17:52:35 +00:00
Aaron Ballman 6c75ab5f66 Introduce _BitInt, deprecate _ExtInt
WG14 adopted the _ExtInt feature from Clang for C23, but renamed the
type to be _BitInt. This patch does the vast majority of the work to
rename _ExtInt to _BitInt, which accounts for most of its size. The new
type is exposed in older C modes and all C++ modes as a conforming
extension. However, there are functional changes worth calling out:

* Deprecates _ExtInt with a fix-it to help users migrate to _BitInt.
* Updates the mangling for the type.
* Updates the documentation and adds a release note to warn users what
is going on.
* Adds new diagnostics for use of _BitInt to call out when it's used as
a Clang extension or as a pre-C23 compatibility concern.
* Adds new tests for the new diagnostic behaviors.

I want to call out the ABI break specifically. We do not believe that
this break will cause a significant imposition for early adopters of
the feature, and so this is being done as a full break. If it turns out
there are critical uses where recompilation is not an option for some
reason, we can consider using ABI tags to ease the transition.
2021-12-06 12:52:01 -05:00
Balazs Benics a6816b957d [analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions
Previously, the `SValBuilder` could not encounter expressions of the
following kind:

  NonLoc OP Loc
  Loc OP NonLoc

Where the `Op` is other than `BO_Add`.

As of now, due to the smarter simplification and the fixedpoint
iteration, it turns out we can.
It can happen if the `Loc` was perfectly constrained to a concrete
value (`nonloc::ConcreteInt`), thus the simplifier can do
constant-folding in these cases as well.

Unfortunately, this could cause assertion failures, since we assumed
that the operator must be `BO_Add`, causing a crash.

---

In the patch, I decided to preserve the original behavior (aka. swap the
operands (if the operator is commutative), but if the `RHS` was a
`loc::ConcreteInt` call `evalBinOpNN()`.

I think this interpretation of the arithmetic expression is closer to
reality.

I also tried naively introducing a separate handler for
`loc::ConcreteInt` RHS, before doing handling the more generic `Loc` RHS
case. However, it broke the `zoo1backwards()` test in the `nullptr.cpp`
file. This highlighted for me the importance to preserve the original
behavior for the `BO_Add` at least.

PS: Sorry for introducing yet another branch into this `evalBinOpXX`
madness. I've got a couple of ideas about refactoring these.
We'll see if I can get to it.

The test file demonstrates the issue and makes sure nothing similar
happens. The `no-crash` annotated lines show, where we crashed before
applying this patch.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D115149
2021-12-06 18:38:58 +01:00
James Farrell 63a6348cad Revert "Use VersionTuple for parsing versions in Triple, fixing issues that caused the original change to be reverted. This makes it possible to distinguish between "16" and "16.0" after parsing, which previously was not possible."
This reverts commit 5032467034.
2021-12-06 17:35:26 +00:00
Jonas Devlieghere 4cb79294e8 Revert "[clang][DebugInfo] Allow function-local statics and types to be scoped within a lexical block"
This reverts commit e403f4fdc8 because it
breaks TestSetData.py on GreenDragon:

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/39089/
2021-12-06 09:34:53 -08:00
Craig Topper acdbd34cfb [RISCV] Loosen some restrictions on lowering constant BUILD_VECTORs using vid.v.
The immediate size check on StepNumerator did not take into account
that vmul.vi does not exist. It also did not account for power of 2
constants that can be done with vshl.vi.

This patch fixes this by moving the conversion from mul to shift
further up. Then we can consider the immediates separately for MUL
vs SHL. For MUL I've allowed simm12 which requires a single addi
before a vmul.vx. For SHL I've allowed any uimm5 which works with
vshl.vi. We could relax these further in the future. This is a
starting point that allows us to emit the same number of instructions
we were already using for smaller numerators.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D115081
2021-12-06 09:34:40 -08:00
Joseph Huber 744aa09f52 [OpenMP] Make reduction functions SPMD compatible
Reduction functions were guarded before which was wrong, these are SPMD
compatible.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D115159
2021-12-06 12:32:02 -05:00