Commit Graph

9689 Commits

Author SHA1 Message Date
Mitch Phillips c414bbefe4 Make -fsanitize=scudo use scudo_standalone. Delete check-scudo.
Leaves the implementation and tests files in-place for right now, but
deletes the ability to build the old sanitizer-common based scudo. This
has been on life-support for a long time, and the newer scudo_standalone
is much better supported and maintained.

Also patches up some GWP-ASan wording, primarily related to the fact
that -fsanitize=scudo now is scudo_standalone, and therefore the way to
reference the GWP-ASan options through the environment variable has
changed.

Future follow-up patches will delete the original scudo, and migrate all
its tests over to be part of the scudo_standalone test suite.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D138157
2022-12-02 11:29:41 -08:00
serge-sans-paille d14c2d408d
[Nomination] Adding Mozilla representative to security group
Hey folks,

I recently moved from Redhat to Mozilla, still working on compiler /
build issues. I'd like to both

- resign as a member of Redhat

- apply as a member of Mozilla

Mozilla's mission makes it very sensible to compiler security flags, so
it makes sense (at least to me) to have it represented in the group.

Although I've been a discrete member of group, I'm still actively
dealing with some security-related patches [0] and blogging about it [1,2]

[0] https://reviews.llvm.org/D137707
[1] https://developers.redhat.com/articles/2022/06/02/use-compiler-flags-stack-protection-gcc-and-clang
[2] https://developers.redhat.com/articles/2022/09/29/benefits-limitations-flexible-array-members

Differential Revision: https://reviews.llvm.org/D138898
2022-11-30 20:00:10 +01:00
Petr Hosek dabd239176 [CMake] Support injecting extra dependencies for perf-training
It may be necessary to build additional targets before running
perf-training, the typical use case would be builtins and runtimes.

This change allows users to specify those dependencies as:

  set(CLANG_PERF_TRAINING_DEPS builtins runtimes CACHE STRING "")

Differential Revision: https://reviews.llvm.org/D138974
2022-11-30 06:13:33 +00:00
Sjoerd Meijer 3ea6a9a469 Recommit "[LoopFlatten] Enable it by default"
The problem in 58441 that was reported after enabling this last time was fixed
in 8e9e22f07b.
2022-11-29 10:45:13 +00:00
Arthur Eubanks 7ae6838def [LegacyPM] Remove pipeline extension mechanism
Part of gradually removing the legacy PM optimization pipeline.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D136622
2022-11-28 12:23:15 -08:00
Bjorn Pettersson 99c47d9e31 Remove TargetMachine::adjustPassManager
Since opt no longer supports to run default (O0/O1/O2/O3/Os/Oz)
pipelines using the legacy PM, there are no in-tree uses of
TargetMachine::adjustPassManager remaining. This patch removes the
no longer used adjustPassManager functions.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D137796
2022-11-28 10:24:16 +01:00
Shivam Gupta 7603b1e250 [Docs] Mention to add RUN line before running script to generate assertion 2022-11-27 22:14:38 +05:30
Hans Wennborg 907baeec49 Revert "Make -fsanitize=scudo use scudo_standalone. Delete check-scudo."
It broke the build, see comments on code review.

> Leaves the implementation and tests files in-place for right now, but
> deletes the ability to build the old sanitizer-common based scudo. This
> has been on life-support for a long time, and the newer scudo_standalone
> is much better supported and maintained.
>
> Also patches up some GWP-ASan wording, primarily related to the fact
> that -fsanitize=scudo now is scudo_standalone, and therefore the way to
> reference the GWP-ASan options through the environment variable has
> changed.
>
> Future follow-up patches will delete the original scudo, and migrate all
> its tests over to be part of the scudo_standalone test suite.
>
> Reviewed By: vitalybuka
>
> Differential Revision: https://reviews.llvm.org/D138157

This reverts commit ab1a5991fe.
2022-11-23 16:07:07 +01:00
Mitch Phillips ab1a5991fe Make -fsanitize=scudo use scudo_standalone. Delete check-scudo.
Leaves the implementation and tests files in-place for right now, but
deletes the ability to build the old sanitizer-common based scudo. This
has been on life-support for a long time, and the newer scudo_standalone
is much better supported and maintained.

Also patches up some GWP-ASan wording, primarily related to the fact
that -fsanitize=scudo now is scudo_standalone, and therefore the way to
reference the GWP-ASan options through the environment variable has
changed.

Future follow-up patches will delete the original scudo, and migrate all
its tests over to be part of the scudo_standalone test suite.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D138157
2022-11-22 12:08:30 -08:00
zhijian a56d0e84da [XCOFF] llvm-readobj support display symbol table of loader section of xcoff object file.
Reviewers: James Henderson, Esme Yi

Differential Revision: https://reviews.llvm.org/D135887
2022-11-21 10:11:12 -05:00
Vitaly Buka be954243f4 Revert "[XCOFF] llvvm-readobj support display symbol table of loader section of xcoff object file."
Use of uninitialized value.

This reverts commit 037f5c283a.
2022-11-19 09:58:14 -08:00
Michael Maitland 98e342dca2 [RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV
On x86 and AArch, SIMD instructions encode all of the scheduling information in the instruction
itself. For example, VADD.I16 q0, q1, q2 is a neon instruction that operates on 16-bit integer
elements stored in 128-bit Q registers, which leads to eight 16-bit lanes in parallel. This kind
of information impacts how the instruction takes to execute and what dependencies this may cause.

On RISCV however, the data that impacts scheduling is encoded in CSR registers such as vtype or
vl, in addition with the instruction itself. But MCA does not track or use the data in these
registers. This patch fixes this problem by introducing Instruments into MCA.

* Replace `CodeRegions` with `AnalysisRegions`
* Add `Instrument` and `InstrumentManager`
* Add `InstrumentRegions`
* Add RISCV Instrument and `InstrumentManager`
* Parse `Instruments` in driver
* Use instruments to override schedule class
* RISCV use lmul instrument to override schedule class
* Fix unit tests to pass empty instruments
* Add -ignore-im clopt to disable this change

A prior version of this patch was commited in 5e82ee5373. 2323a4ee61 reverted
that change because the unit test files caused build errors. The change with fixes
were committed in b88b8307bf but reverted once again e8e92c8313 due to more
build errors.

This commit adds the prior changes and fixes the build error.

Differential Revision: https://reviews.llvm.org/D137440
2022-11-18 09:55:15 -08:00
zhijian 037f5c283a [XCOFF] llvvm-readobj support display symbol table of loader section of xcoff object file.
Reviewers: James Henderson, Esme Yi

Differential Revision: https://reviews.llvm.org/D135887
2022-11-18 12:11:13 -05:00
Aarush Bhat 96484553d9
[docs] remove extra slash from llvm github url
Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D137418
2022-11-18 21:57:17 +08:00
Matt Arsenault f34fe2a3d2 LangRef: Fix repeated word 2022-11-17 12:54:19 -08:00
Nick Desaulniers 2d3d8c9ad7 [LangRef] remove callbr references from Addresses of BasicBlock section
Since D129288, we no longer use BlockAddress constants as operands of
callbr.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D138080
2022-11-16 09:19:20 -08:00
Yeting Kuo ed9638c44b [VP][RISCV] Add vp.nearbyint and RISC-V support.
nearbyint has the property to execute without exception.
For not modifying fflags, the patch added new machine opcode
PseudoVFROUND_NOEXCEPT_V that expands vfcvt.x.f.v and vfcvt.f.x.v between a pair
of frflags and fsflags.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D137685
2022-11-16 14:05:35 +08:00
Yeting Kuo 5c3ca10b09 [VP][RISCV] Add vp.bswap and RISC-V support.
The patch also added function expandVPBSWAP to expand ISD::VP_BSWAP nodes.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D137928
2022-11-16 11:36:38 +08:00
Michael Maitland e8e92c8313 Revert "[RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV"
This reverts commit b88b8307bf.
2022-11-15 18:01:46 -08:00
Michael Maitland b88b8307bf [RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV
On x86 and AArch, SIMD instructions encode all of the scheduling information in the instruction
itself. For example, VADD.I16 q0, q1, q2 is a neon instruction that operates on 16-bit integer
elements stored in 128-bit Q registers, which leads to eight 16-bit lanes in parallel. This kind
of information impacts how the instruction takes to execute and what dependencies this may cause.

On RISCV however, the data that impacts scheduling is encoded in CSR registers such as vtype or
vl, in addition with the instruction itself. But MCA does not track or use the data in these
registers. This patch fixes this problem by introducing Instruments into MCA.

* Replace `CodeRegions` with `AnalysisRegions`
* Add `Instrument` and `InstrumentManager`
* Add `InstrumentRegions`
* Add RISCV Instrument and `InstrumentManager`
* Parse `Instruments` in driver
* Use instruments to override schedule class
* RISCV use lmul instrument to override schedule class
* Fix unit tests to pass empty instruments
* Add -ignore-im clopt to disable this change

A prior version of this patch was commited in. It was reverted in
5e82ee5373. 2323a4ee61 reverted
that change because the unit test files caused build errors. This commit adds the original changes
and the fixed test files.

Differential Revision: https://reviews.llvm.org/D137440
2022-11-15 17:42:23 -08:00
Michael Maitland 2323a4ee61 Revert "[RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV"
This reverts commit 5e82ee5373.
2022-11-15 08:04:11 -08:00
Michael Maitland 5e82ee5373 [RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV
On x86 and AArch, SIMD instructions encode all of the scheduling information in the instruction
itself. For example, VADD.I16 q0, q1, q2 is a neon instruction that operates on 16-bit integer
elements stored in 128-bit Q registers, which leads to eight 16-bit lanes in parallel. This kind
of information impacts how the instruction takes to execute and what dependencies this may cause.

On RISCV however, the data that impacts scheduling is encoded in CSR registers such as vtype or
vl, in addition with the instruction itself. But MCA does not track or use the data in these
registers. This patch fixes this problem by introducing Instruments into MCA.

* Replace `CodeRegions` with `AnalysisRegions`
* Add `Instrument` and `InstrumentManager`
* Add `InstrumentRegions`
* Add RISCV Instrument and `InstrumentManager`
* Parse `Instruments` in driver
* Use instruments to override schedule class
* RISCV use lmul instrument to override schedule class
* Fix unit tests to pass empty instruments
* Add -ignore-im clopt to disable this change

Differential Revision: https://reviews.llvm.org/D137440
2022-11-15 07:54:06 -08:00
Serge Pavlov ec893da990 [GlobalISel] Remove semantic operand of G_IS_FPCLASS
Instruction G_IS_FPCLASS had an operand that represented floating-point
semantics of its first operand. It allowed types that have the same length,
like `bfloat16` and `half`, to be distinguished. Unfortunately, it is
not sufficient, as other operation still cannot distinguish such types.
Solution of this problem must be more general, so now this operand is removed.

Differential Revision: https://reviews.llvm.org/D138004
2022-11-15 15:48:05 +07:00
Philip Reames 780c539844 [RISCV] Implement assembler support for XVentanaCondOps
This change provides an implementation of the XVentanaCondOps vendor extension. This extension is defined in version 1.0.0 of the VTx-family custom instructions specification (https://github.com/ventanamicro/ventana-custom-extensions/releases/download/v1.0.0/ventana-custom-extensions-v1.0.0.pdf) by Ventana Micro Systems.

In addition to the technical contribution, this change is intended to be a test case for our vendor extension policy.

Once this lands, I plan to use this extension to prototype selection lowering to conditional moves. There's an RVI proposal in flight, and the expectation is that lowering to these and the new RVI instructions is likely to be substantially similar.

Differential Revision: https://reviews.llvm.org/D137350
2022-11-14 09:01:54 -08:00
Mindong Chen 9d78bbe6c4 [docs][OpaquePtr] Fix hyperlinks 2022-11-14 23:21:04 +08:00
Aiden Grossman b9378a60c4 [Docs] Add Documentation on BOLT Build Configs
This patch adds documentation into the advanced builds documentation on
how to use the BOLT caches, including the combinations with the PGO
multistage builds and (Thin)LTO.

Reviewed By: sylvestre.ledru, Amir

Differential Revision: https://reviews.llvm.org/D137899
2022-11-14 07:00:16 +00:00
Aiden Grossman f7dea68066 [Docs] Add Documentation on (Thin)LTO + PGO Build Configs
This patch adds documentation on the AdvancedBuilds page on how to do
PGO builds with (Thin)LTO with the currently undocumented (as far as I
can tell) PGO_INSTRUMENT_LTO option in the Clang PGO caches.

Reviewed By: sylvestre.ledru

Differential Revision: https://reviews.llvm.org/D137898
2022-11-14 06:58:00 +00:00
Aiden Grossman f53fde8e15 [Docs] Minor Fixups in Advanced Builds Documentation
This patch makes some minor fixups in the PGO section of the advanced
builds documentation in preparation for some future changes. Some minor
formatting and wording changes are included to hopefully make the
documentation more clear.

Reviewed By: sylvestre.ledru

Differential Revision: https://reviews.llvm.org/D137880
2022-11-12 22:03:25 +00:00
Tom Stellard b473734efd docs: add instructions for stand-alone builds of lld
Reviewed By: kwk, MaskRay

Differential Revision: https://reviews.llvm.org/D124405
2022-11-11 15:19:26 -08:00
Xiaodong Liu 070ab2bb0b [LangRef][LoongArch] Update inline asm constraint code and operand modifier
According to:
https://reviews.llvm.org/D134157
https://reviews.llvm.org/D136841
https://reviews.llvm.org/D136835

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D137528
2022-11-11 14:25:29 +08:00
Tom Stellard 1cb97a1e2d docs: Add instructions for stand-alone builds of clang
More sub-projects will be added to the table once they have been verified
to be buildable in stand-alone mode.

Reviewed By: MaskRay, mgorny

Differential Revision: https://reviews.llvm.org/D123968
2022-11-10 12:29:20 -08:00
Keith Walker 00d98e6572 [AArch64] RME MEC instructions and system registers
This patch adds assembler/disassembler support for
RME MEC (Memory Encryption Contexts).

Cache maintence instructions added:
- DC CIPAPA
- DC CIGDPAPA

System registers added:
- MECIDR_EL2
- MECID_P0_EL2
- MECID_A0_EL2
- MECID_P1_EL2
- MECID_A1_EL2
- VMECID_P_EL2
- VMECID_A_EL2
- MECID_RL_A_EL3

Differential Revision: https://reviews.llvm.org/D137431
2022-11-10 14:05:12 +00:00
Victor Campos 9d1ff787e5 [AArch64] Add support for the Cortex-X3 CPU
Cortex-X3 is an Armv9-A AArch64 CPU.

This patch introduces support for Cortex-X3.

Technical Reference Manual: https://developer.arm.com/documentation/101593/latest

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D136589
2022-11-09 11:33:48 +00:00
Freddy Ye 84a18a260e [X86] Support -march=sierraforest, grandridge, graniterapids.
Reviewed By: skan, pengfei, MaskRay

Differential Revision: https://reviews.llvm.org/D137153
2022-11-09 16:56:03 +08:00
Bjorn Pettersson ac696ac453 Use opt -passes=<name> instead of opt -name
Updated the RUN line in several test cases to use the new PM syntax
  opt -passes=<pipeline>
instead of the deprecated syntax
  opt -pass1 -pass2
2022-11-08 12:15:42 +01:00
Paulo Matos b293de9880 [Docs] Add my Office Hours 2022-11-07 22:02:07 -08:00
Fangrui Song 90ad3e3c02 [IR] Allow available_externally GlobalAlias
GlobalVariable and Function can be available_externally. GlobalAlias is used
similarly. Allowing available_externally is a natural extension and helps
ThinLTO discard GlobalAlias in a non-prevailing COMDAT (see D135427).

For now, available_externally GlobalAlias must point to an
available_externally GlobalValue (not ConstantExpr).

Differential Revision: https://reviews.llvm.org/D137441
2022-11-07 09:03:23 -08:00
Alexey Bader e0ed3d5d2e Online sync-ups: add SYCL working group sync details. 2022-11-06 08:16:36 -08:00
Nikita Popov 304f1d59ca [IR] Switch everything to use memory attribute
This switches everything to use the memory attribute proposed in
https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579.
The old argmemonly, inaccessiblememonly and inaccessiblemem_or_argmemonly
attributes are dropped. The readnone, readonly and writeonly attributes
are restricted to parameters only.

The old attributes are auto-upgraded both in bitcode and IR.
The bitcode upgrade is a policy requirement that has to be retained
indefinitely. The IR upgrade is mainly there so it's not necessary
to update all tests using memory attributes in this patch, which
is already large enough. We could drop that part after migrating
tests, or retain it longer term, to make it easier to import IR
from older LLVM versions.

High-level Function/CallBase APIs like doesNotAccessMemory() or
setDoesNotAccessMemory() are mapped transparently to the memory
attribute. Code that directly manipulates attributes (e.g. via
AttributeList) on the other hand needs to switch to working with
the memory attribute instead.

Differential Revision: https://reviews.llvm.org/D135780
2022-11-04 10:21:38 +01:00
Freddy Ye a806fc2767 [X86] Support -march=raptorlake, meteorlake
Reviewed By: pengfei, skan, MaskRay

Differential Revision: https://reviews.llvm.org/D135937
2022-11-04 09:32:17 +08:00
Simi Pallipurath fa8aeab606 [AArch64] Add support for the Cortex-A715 CPU
Cortex-A715 is an Armv9-A AArch64 CPU.

This patch introduces support for Cortex-A715.

Technical Reference Manual: https://developer.arm.com/documentation/101590/latest.

Reviewed By: vhscampos

Differential Revision: https://reviews.llvm.org/D136957
2022-11-03 09:28:46 +00:00
Matt Arsenault 5201680249 LangRef: Fix typo in backtick placement 2022-11-02 17:40:33 -07:00
Aaron Ballman 65b130e32c Fix LLVM sphinx build bot
This should address the issue found in:
https://lab.llvm.org/buildbot/#/builders/30/builds/27824
2022-11-02 14:33:39 -04:00
Arthur Eubanks 76b04c2beb [docs][NewPM] Move pass plugin documentation into existing new PM docs
Reviewed By: awarzynski, asbirlea

Differential Revision: https://reviews.llvm.org/D136626
2022-11-02 10:47:17 -07:00
Arthur Eubanks 5b30fc2369 [opt] Add -p alias for -passes
See [1] for background.

Some people have complained that `opt -passes=instcombine` is a lot more typing than `opt -instcombine`.
As a compromise that nobody has objected to in [1], allow `opt -p instcombine`.

[1] https://discourse.llvm.org/t/rfc-legacy-opt-pass-syntax-with-new-pass-manager/65863

Reviewed By: bjope, asbirlea

Differential Revision: https://reviews.llvm.org/D136616
2022-11-02 10:46:34 -07:00
Michał Górny c061892fcd [llvm-config] Remove --src-root option
Remove the `--src-root` option from the deprecated llvm-config tool.
None of the llvm-project projects use this option anymore. The value
was only meaningful for in-tree use and usually became no longer correct
once LLVM was installed -- either because it was built in a temporary
directory, or installed from a binary package and built on a different
system entirely.  Therefore, third-party tools could not have been
relying on it anyway.

The LLVM_SRC_ROOT #define is left intact, as it is used to compute
includedir when llvm-config is used in-source.

Differential Revision: https://reviews.llvm.org/D137144
2022-11-02 18:45:15 +01:00
OCHyams fcbf807b55 Fix Assignment Tracking docs error from 33c7ae55e7
Buildbot link: https://lab.llvm.org/buildbot/#/builders/30/builds/27812
2022-11-02 14:09:41 +00:00
OCHyams 33c7ae55e7 [Assignment Tracking][1/*] Add initial docs for Assignment Tracking
The Assignment Tracking debug-info feature is outlined in this RFC:

https://discourse.llvm.org/t/
  rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir

Add documentation outlining the intent and design.
2022-11-02 13:47:50 +00:00
Matt Arsenault da137e114e LangRef: Attempt to formulate some rules for addrspacecast
Some work will be needed to comply with these rules for non-integral
pointers.
2022-11-01 18:46:18 -07:00
Philip Reames 9395b98ba0 [RISCV][docs] Add some wording around vendor extensions
This adds an initial bit of policy around inclusion of vendor extensions. My intention here is to leave all of the actual decision making to a case by case decision on the regular sync calls, but to spell out some of the pieces we've discussed and (I think) have general agreement on.

Differential Revision: https://reviews.llvm.org/D136968
2022-11-01 09:33:32 -07:00