Commit Graph

9147 Commits

Author SHA1 Message Date
Nikita Popov 5a43a278f7 [Docs] Update OpaquePointers transition state (NFC)
We're at a point where working optimized binaries can be produced
in opaque pointer mode.
2022-02-14 12:55:58 +01:00
Markus Böck e101eb5c7b [llvm][doc] Add Aarch64 to list of architectures supporting statepoints
Fixes https://github.com/llvm/llvm-project/issues/53655

Differential Revision: https://reviews.llvm.org/D119659
2022-02-13 20:35:15 +01:00
YASHASVI KHATAVKAR f9f78a2c40 Fix build broken by missing empty line in SourceLevelDebugging.rst 2022-02-11 15:19:07 -05:00
YASHASVI KHATAVKAR 70fdbf35de Adding DiBuilder interface for assumed length strings 2022-02-11 14:40:02 -05:00
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
Louis Dionne 6a7f6e9404 [docs] Fix missing space in the GettingStarted documentation 2022-02-11 09:17:37 -05:00
Arthur Eubanks 2fa87ab524 [docs] Replace `opt -analyze` with better alternatives.
`opt -analyze` is legacy PM-specific. Show better ways of doing the same
thing, generally with some sort of `-passes=print<foo>`.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D119486
2022-02-10 15:38:31 -08:00
YASHASVI KHATAVKAR 93d1a623ce Reverting an entire stack of changes causing build failures 2022-02-10 17:58:22 -05:00
YASHASVI KHATAVKAR ac15cd7af6 Modified SourceLevelDebugging.rst to include information about memory location exp 2022-02-10 15:24:51 -05:00
Louis Dionne 4ae83bb2b1 Update all LLVM documentation mentioning runtimes in LLVM_ENABLE_PROJECTS
We are moving away from building the runtimes with LLVM_ENABLE_PROJECTS,
however the documentation was largely outdated. This commit updates all
the documentation I could find to use LLVM_ENABLE_RUNTIMES instead of
LLVM_ENABLE_PROJECTS for building runtimes.

Note that in the near future, libcxx, libcxxabi and libunwind will stop
supporting being built with LLVM_ENABLE_PROJECTS altogether. I don't know
what the plans are for other runtimes like libc, openmp and compiler-rt,
so I didn't make any changes to the documentation that would imply
something for those projects.

Once this lands, I will also cherry-pick this on the release/14.x branch
to make sure that LLVM's documentation is up-to-date and reflects what
we intend to support in the future.

Differential Revision: https://reviews.llvm.org/D119351
2022-02-10 15:05:23 -05:00
David Spickett 2937b28218 Reland "[lldb] Remove non address bits when looking up memory regions"
This reverts commit 0df522969a.

Additional checks are added to fix the detection of the last memory region
in GetMemoryRegions or repeating the "memory region" command when the
target has non-address bits.

Normally you keep reading from address 0, looking up each region's end
address until you get LLDB_INVALID_ADDR as the region end address.
(0xffffffffffffffff)

This is what the remote will return once you go beyond the last mapped region:
[0x0000fffffffdf000-0x0001000000000000) rw- [stack]
[0x0001000000000000-0xffffffffffffffff) ---

Problem is that when we "fix" the lookup address, we remove some bits
from it. On an AArch64 system we have 48 bit virtual addresses, so when
we fix the end address of the [stack] region the result is 0.
So we loop back to the start.

[0x0000fffffffdf000-0x0001000000000000) rw- [stack]
[0x0000000000000000-0x0000000000400000) ---

To fix this I added an additional check for the last range.
If the end address of the region is different once you apply
FixDataAddress, we are at the last region.

Since the end of the last region will be the last valid mappable
address, plus 1. That 1 will be removed by the ABI plugin.

The only side effect is that on systems with non-address bits, you
won't get that last catch all unmapped region from the max virtual
address up to 0xf...f.

[0x0000fffff8000000-0x0000fffffffdf000) ---
[0x0000fffffffdf000-0x0001000000000000) rw- [stack]
<ends here>

Though in some way this is more correct because that region is not
just unmapped, it's not mappable at all.

No extra testing is needed because this is already covered by
TestMemoryRegion.py, I simply forgot to run it on system that had
both top byte ignore and pointer authentication.

This change has been tested on a qemu VM with top byte ignore,
memory tagging and pointer authentication enabled.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D115508
2022-02-10 10:42:49 +00:00
Lu Weining 42fd2bfc90 [LoongArch 1/6] Add triples loongarch{32,64} for the upcoming LoongArch target
This is the first patch to incrementally add an MC layer for LoongArch to LLVM.
This patch also adds unit testcases for these new triples.

RFC for adding this new backend:
https://lists.llvm.org/pipermail/llvm-dev/2021-December/154371.html

Differential revision: https://reviews.llvm.org/D115857
2022-02-10 10:23:34 +00:00
Daniel Thornburgh 694f384553 [Debuginfod] Flag-determine debuginfod lookups in llvm-symbolizer.
This change adds a pair of flags controlling whether llvm-symbolizer
attempts debuginfod lookups. Lookups are attempted if --debuginfod is
passed and disabled if --no-debuginfod is passed.

The default behavior is made more nuanced: debuginfod lookups are now
only attempted if an HTTP client is compiled in and at least one backing
debuginfod URL was configured via environment variable. Previously,
debuginfod lookups would always be attempted, even if there were no
chance that they could succeed.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D118665
2022-02-09 22:20:54 +00:00
Craig Topper 60745fb16f [VP] llvm.vp.fneg intrinsic and LangRef
Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D119262
2022-02-09 07:54:36 -08:00
Daniel Thornburgh dcd4950d42 [Symbolizer] Add Build ID flag to llvm-symbolizer.
This adds a --build-id=<hex build ID> flag to llvm-symbolizer. If --obj
is unspecified, this will attempt to look up the provided build ID using
whatever mechanisms are available to the Symbolizer (typically,
debuginfod). The semantics are then as if the found binary were given
using the --obj flag.

Reviewed By: jhenderson, phosek

Differential Revision: https://reviews.llvm.org/D118633
2022-02-08 23:08:18 +00:00
Lancelot Six 046017291f [AMDGPU][NFC] AMDGPUUsage.rst: fix wording. 2022-02-07 20:06:17 -05:00
Craig Topper cef177d186 [VP] llvm.vp.fma intrinsic and LangRef
Differential Revision: https://reviews.llvm.org/D119185
2022-02-07 15:53:27 -08:00
Keith Smiley 4c12a75e69 [llvm-libtool-darwin] Add -warnings_as_errors
libtool can currently produce 2 warnings:

1. No symbols were in the object file
2. An object file with the same basename was specified multiple times

The first warning here is often harmless and may just mean you have some
translation units with no symbols for the target you're building for.
The second warning can lead to real issues like those mentioned in
https://reviews.llvm.org/D113130 where ODR violations can slip in.

This introduces a new -warnings_as_errors flag that can be used by build
systems that want to verify they never hit these warnings. For example
with bazel the libtool caller first uniques names to make sure the
duplicate base name case is not possible, but if that doesn't work as
expected, having it fail would be preferred.

It's also worth noting that llvm-libtool-darwin works around an issue
that cctools libtool experiences related to debug info and duplicate
basenames, the workaround is described here:
30baa5d2a4/llvm/lib/Object/ArchiveWriter.cpp (L424-L465)
And it avoids this bug:
f0cbbb1c37/DuplicateBasenameIssue

Differential Revision: https://reviews.llvm.org/D118931
2022-02-07 14:39:21 -08:00
Mark Murray 3d7662142d [ARM] Undeprecate complex IT blocks
AArch32/Armv8A  introduced the performance deprecation of certain patterns
of IT instructions.  After some debate internal to ARM, this is now being
reverted; i.e. no IT instruction patterns are performance deprecated
anymore, as the perfomance degredation is not significant enough.

This reverts the following:

"ARMv8-A deprecates some uses of the T32 IT instruction. All uses of
IT that apply to instructions other than a single subsequent 16-bit
instruction from a restricted set are deprecated, as are explicit
references to the PC within that single 16-bit instruction. This permits
the non-deprecated forms of IT and subsequent instructions to be treated
as a single 32-bit conditional instruction."

The deprecation no longer applies, but the behaviour may be controlled
by the -arm-restrict-it and -arm-no-restrict-it command-line options,
with the latter being the default. No warnings about complex IT blocks
will be generated.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D118044
2022-02-07 15:47:53 +00:00
Volodymyr Turanskyy c127ba25fb Add LLVM Embedded Toolchains call to the table of sync ups.
LLVM Embedded Toolchains working group regular sync up calls to start in early
March, adding details to the table of sync ups for general reference.

Differential Revision: https://reviews.llvm.org/D118884
2022-02-07 16:38:42 +01:00
Dmitry Preobrazhensky 95a52b376a [AMDGPU][GFX9][DOC][NFC] Corrected description of registers available via getreg/setreg
This is to reflect changes introduced by https://reviews.llvm.org/D118860.
2022-02-04 17:55:32 +03:00
Nikita Popov e990e591c9 [LangRef] Require elementtype attribute for gc.statepoint intrinsic
The gc.statepoint intrinsic currently determines the target function
type based on the pointer element type of the argument. In order to
support opaque pointers, require that the argument is annotated with
an elementtype attribute.

Here's an example of the change:

    ; Before:
      %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0)

    ; After:
      %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0)

    ; After with opaque pointers:
      %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0)

Differential Revision: https://reviews.llvm.org/D117890
2022-02-04 09:47:31 +01:00
Changpeng Fang 022c8d4a3f AMDGPU [NFC]: Fix a few typos in docs AMDGPUUsage.rst
Summery:
  Fix a few typos in docs AMDGPUUsage.rst

Differential Revision:
  https://reviews.llvm.org/D118272
2022-02-02 14:22:52 -08:00
Lancelot SIX 73ed118eda [Docs][NFC] Contributing.rst: fix wording
Fix a sentence containing two consecutive 'and'.
2022-02-02 13:49:03 +01:00
Tom Stellard a2601c9887 Bump the trunk major version to 15 2022-02-01 23:54:52 -08:00
Tom Stellard e80c52986e [docs] Remove hard-coded version numbers from sphinx configs
This updates all the non-runtime project release notes to use the
version number from CMake instead of the hard-coded version numbers
in conf.py.

It also hides warnings about pre-releases when the git suffix
is dropped from the LLVM version in CMake.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D112181
2022-02-01 23:14:12 -08:00
Tanya Lattner 1b12e92c80 Update status on migration again. Add note about issues with reply by email from emails pre-migration. 2022-02-01 22:25:31 -08:00
Tanya Lattner bbc5b62e85 Add new status of the move to Discourse. 2022-02-01 18:30:46 -08:00
Tanya Lattner e36afc6511 Update discourse migration status. 2022-02-01 18:09:31 -08:00
Tanya Lattner 769d634789 Update status of move. 2022-02-01 10:45:40 -08:00
Fangrui Song 30e8f83c84 [GlobalOpt] Don't replace alias with aliasee if either alias/aliasee may be preemptible
Generalize D99629 for ELF. A default visibility non-local symbol is preemptible
in a -shared link. `isInterposable` is an insufficient condition.

Moreover, a non-preemptible alias may be referenced in a sub constant expression
which intends to lower to a PC-relative relocation. Replacing the alias with a
preemptible aliasee may introduce a linker error.

Respect dso_preemptable and suppress optimization to fix the abose issues. With
the change, `alias = 345` will not be rewritten to use aliasee in a `-fpic`
compile.
```
int aliasee;
extern int alias __attribute__((alias("aliasee"), visibility("hidden")));
void foo() { alias = 345; } // intended to access the local copy
```

While here, refine the condition for the alias as well.

For some binary formats like COFF, `isInterposable` is a sufficient condition.
But I think canonicalization for the changed case has little advantage, so I
don't bother to add the `Triple(M.getTargetTriple()).isOSBinFormatELF()` or
`getPICLevel/getPIELevel` complexity.

For instrumentations, it's recommended not to create aliases that refer to
globals that have a weak linkage or is preemptible. However, the following is
supported and the IR needs to handle such cases.
```
int aliasee __attribute__((weak));
extern int alias __attribute__((alias("aliasee")));
```

There are other places where GlobalAlias isInterposable usage may need to be
fixed.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D107249
2022-02-01 10:41:16 -08:00
Fangrui Song dd6e7e0d57 [llvm-ar] Add --thin for creating a thin archive
In GNU ar (since 2008), the modifier 'T' means creating a thin archive.
In many other ar implementations (FreeBSD, macOS, elfutils, etc), -T
means "allow filename truncation of extracted files", as specified by
X/Open System Interface.

For portability, 'T' with thin archive semantics should be avoided.

See https://sourceware.org/bugzilla/show_bug.cgi?id=28759 binutils 2.38
will deprecate 'T' (without diagnostic) and add --thin.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D116979
2022-02-01 09:56:50 -08:00
Tanya Lattner acef496b5e Add status of migration. 2022-01-31 19:03:29 -08:00
Changpeng Fang 1194b9cdda AMDGPU {NFC}: Add code object v5 support and generate metadata for implicit kernel args
Summary:
  Add code object v5 support (deafult is still v4)
  Generate metadata for implicit kernel args for the new ABI
  Set the metadata version to be 1.2

Reviewers:
  t-tye, b-sumner, arsenm, and bcahoon

Fixes:
  SWDEV-307188, SWDEV-307189

Differential Revision:
  https://reviews.llvm.org/D118272
2022-01-31 18:07:47 -08:00
Daniel McIntosh 0ee7a2c304 [docs] Update Prolog/Epilog Code Insertion docs to show it's still incomplete
Compact Unwind is a subsection, but that was lost in rGff9feeb520a32d076c3095468208ae116c428285

Reviewed By: void

Differential Revision: https://reviews.llvm.org/D118499
2022-01-31 15:25:46 -05:00
Jeff Bailey f86844da49 Remove reference to LLVMLibC as the doc has moved.
https://reviews.llvm.org/D117436 caused a build failure
due to this error.

Tested:
ninja docs-llvm-libc builds

Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D118537
2022-01-29 23:39:03 +00:00
Simon Pilgrim 058c5dfc78 Raise the minimum Visual Studio version to VS2019
As raised here: https://lists.llvm.org/pipermail/llvm-dev/2021-November/153881.html

Now that VS2022 is on general release, LLVM is expected to build on VS2017, VS2019 and VS2022, which is proving hazardous to maintain due to changes in behaviour including preprocessor and constexpr changes. Plus of the few developers that work with VS, many have already moved to VS2019/22.

This patch proposes to raise the minimum supported version to VS2019 (16.x) - I've made the hard limit 16.0 or later, with the soft limit VS2019 16.7 - older versions of VS2019 are "allowed" (at your own risk) via the LLVM_FORCE_USE_OLD_TOOLCHAIN cmake flag.

Differential Revision: https://reviews.llvm.org/D114639
2022-01-29 10:56:41 +00:00
Jeff Bailey 4465c29906 Move LLVM Proposal to doc directory, create index
The LLVM Libc project is no longer just a proposal and should have
a webpage tracking the status of the project.  This changes
puts the pieces into the right place so that the webpage can be
created.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D117436
2022-01-29 00:29:31 +00:00
Ahmed Bougacha 634ca7349d [ObjCARC] Require the function argument in the clang.arc.attachedcall bundle.
Currently, the clang.arc.attachedcall bundle takes an optional function
argument.  Depending on whether the argument is present, calls with this
bundle have the following semantics:

- on x86, with the argument present, the call is lowered to:
    call _target
    mov rax, rdi
    call _objc_retainAutoreleasedReturnValue

- on AArch64, without the argument, the call is lowered to:
    bl _target
    mov x29, x29

  and the objc runtime call is expected to be emitted separately.

That's because, on x86, the objc runtime checks for both the mov and
the call on x86, and treats the combination as the ARC autorelease elision
marker.

But on AArch64, it only checks for the dedicated NOP marker, as that's
historically been sufficiently unique.  Thanks to that, the runtime call
wasn't required to be adjacent to the NOP marker, so it wasn't emitted
as part of the bundle sequence.

This patch unifies both architectures: on AArch64, we now emit all
3 instructions for the bundle.  This guarantees that the runtime call
is adjacent to the marker in the sequence, and that's information the
runtime can use to further optimize this.

This helps simplify some of the handling, in particular
BundledRetainClaimRVs, which no longer needs to know whether the bundle
is sufficient or not: it now always should be.

Note that this does not include an AutoUpgrade for the nullary bundles,
as they are only produced in ObjCContract as part of the obj/asm emission
pipeline, and are not expected to be in bitcode.

Differential Revision: https://reviews.llvm.org/D118214
2022-01-28 12:41:45 -08:00
Ellis Hoag 11d3074267 [InstrProf] Add single byte coverage mode
Use the llvm flag `-pgo-function-entry-coverage` to create single byte "counters" to track functions coverage. This mode has significantly less size overhead in both code and data because
  * We mark a function as "covered" with a store instead of an increment which generally requires fewer assembly instructions
  * We use a single byte per function rather than 8 bytes per block

The trade off of course is that this mode only tells you if a function has been covered. This is useful, for example, to detect dead code.

When combined with debug info correlation [0] we are able to create an instrumented Clang binary that is only 150M (the vanilla Clang binary is 143M). That is an overhead of 7M (4.9%) compared to the default instrumentation (without value profiling) which has an overhead of 31M (21.7%).

[0] https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D116180
2022-01-27 17:38:55 -08:00
Tanya Lattner 586759cee5 Add email addresses to create a topic via email in a specific category. 2022-01-26 23:22:04 -08:00
Aaron Ballman f3e22946e5 Update the Bug Life Cycle docs for the switch to GitHub issues
This updates the Bug Life Cycle docs now that we've switched to GitHub
issues. The intent is to retain the same general process we used to
use for triaging bugs under Bugzilla, but with the facilities we have
available in GitHub.
2022-01-26 15:55:36 -05:00
Matt Arsenault e6564f39c7 AMDGPU: Emit user sgpr count directives in text asm
We were emitting these in the object file but not printing them.
2022-01-26 13:51:12 -05:00
David Spickett 070090d08e [lldb] Add option to show memory tags in memory read output
This adds an option --show-tags to "memory read".

(lldb) memory read mte_buf mte_buf+32 -f "x" -s8 --show-tags
0x900fffff7ff8000: 0x0000000000000000 0x0000000000000000 (tag: 0x0)
0x900fffff7ff8010: 0x0000000000000000 0x0000000000000000 (tag: 0x1)

Tags are printed on the end of each line, if that
line has any tags associated with it. Meaning that
untagged memory output is unchanged.

Tags are printed based on the granule(s) of memory that
a line covers. So you may have lines with 1 tag, with many
tags, no tags or partially tagged lines.

In the case of partially tagged lines, untagged granules
will show "<no tag>" so that the ordering is obvious.
For example, a line that covers 2 granules where the first
is not tagged:

(lldb) memory read mte_buf-16 mte_buf+16 -l32 -f"x" --show-tags
0x900fffff7ff7ff0: 0x00000000 <...> (tags: <no tag> 0x0)

Untagged lines will just not have the "(tags: ..." at all.
Though they may be part of a larger output that does have
some tagged lines.

To do this I've extended DumpDataExtractor to also print
memory tags where it has a valid execution context and
is asked to print them.

There are no special alignment requirements, simply
use "memory read" as usual. All alignment is handled
in DumpDataExtractor.

We use MakeTaggedRanges to find all the tagged memory
in the current dump, then read all that into a MemoryTagMap.

The tag map is populated once in DumpDataExtractor and re-used
for each subsequently printed line (or recursive call of
DumpDataExtractor, which some formats do).

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D107140
2022-01-26 14:40:39 +00:00
Fangrui Song d2cc23a337 [docs] HowToCrossCompileLLVM.rst: prefer --target= over legacy -target 2022-01-25 12:39:32 -08:00
Hsiangkai Wang 901dd53cbf [docs] There are more than three bit storage containers.
To avoid listing all the bit containers in the title and do not use the
specific number for the number of bit containers.

Differential Revision: https://reviews.llvm.org/D117849
2022-01-25 10:09:18 +00:00
Hsiangkai Wang 48f763edb4 [docs] Refine the description in Set-Like and Map-Like container options.
In "Other Set-Like Container Options":
* Drops the references to C++ TR1 and SGI and hash_set.
* Drops the worry about portability (this was a problem with hash_set, but
std::unordered_set has worked portably since LLVM started depending
on C++11).

It is similar in "Other Map-Like Container Options" section.

Differential Revision: https://reviews.llvm.org/D117858
2022-01-25 10:09:18 +00:00
Changpeng Fang 4cfea311cb [AMDGPU][NFC] Update to AMDGPUUsage for default Code Object Version
Summary:
  Update the documentation for default code object version (from v3 to v4).

Reviewers:
  kzhuravl

Differential Revision:
  https://reviews.llvm.org/D117845
2022-01-24 14:33:12 -08:00
David Spickett 473aa8e10c [llvm][docs] Fix code-block in the testing guide
Without a langauge name it's an error (with some verisons of Sphinx
it seems) or the block is simply missing in the output.
2022-01-24 14:56:31 +00:00
David Spickett 3e6be0241b [lldb] Update release notes with non-address bit handling changes
This adds the "memory find" (https://reviews.llvm.org/D117299)
and "memory tag" (https://reviews.llvm.org/D117672) commands
and puts them all in one list.
2022-01-24 11:19:49 +00:00