[clang] Ensure -mno-outline adds attributes
Before this change, `-mno-outline` and `-moutline` only controlled the
pass pipelines for the invoked compiler/linker.
The drawback of this implementation is that, when using LTO, only the
flag provided to the linker invocation is honoured (and any files which
individually use `-mno-outline` will have that flag ignored).
This change serialises the `-mno-outline` flag into each function's
IR/Bitcode, so that we can correctly disable outlining from functions in
files which disabled outlining, without affecting outlining choices for
functions from other files. This matches how other optimisation flags
are handled so the IR/Bitcode can be correctly merged during LTO.
[clang] Add clang::nooutline Attribute
This change:
- Adds a `[[clang::nooutline]]` function attribute for C and C++. There
is no equivalent GNU syntax for this attribute, so no `__attribute__`
syntax.
- Uses the presence of `[[clang::nooutline]]` to add the `nooutline`
attribute to IR function definitions.
- Adds test for the above.
The `nooutline` attribute disables both the Machine Outliner (enabled at
Oz for some targets), and the IR Outliner (disabled by default).
Code Review Updates:
- Use AttrsToAdd/AttrsToRemove
- Use --implict-check-not in the test
- Change LLVM IR editor languages
- Propagage NoOutline in CodeExtractor (as `"nooutline"` was)
[AMDGPU] Asynchronous loads from global/buffer to LDS on pre-GFX12
The existing "LDS DMA" builtins/intrinsics copy data from global/buffer pointer
to LDS. These are now augmented with their ".async" version, where the compiler
does not automatically track completion. The completion is now tracked using
explicit mark/wait intrinsics, which must be inserted by the user. This makes it
possible to write programs with efficient waits in software pipeline loops. The
program can now wait for only the oldest outstanding operations to finish, while
launching more operations for later use.
This change only contains the new names of the builtins/intrinsics, which
continue to behave exactly like their non-async counterparts. A later change
will implement the actual mark/wait semantics in SIInsertWaitcnts.
Fixes: SWDEV-521121
[outliners] Turn nooutline into an Enum Attribute
This change turns the `"nooutline"` attribute into an enum attribute
called `nooutline`, and adds an auto-upgrader for bitcode to make the
same change to existing IR.
This IR attribute disables both the Machine Outliner (enabled at Oz for
some targets), and the IR Outliner (disabled by default).
[OpenCL] Diagnose invalid conversion from pointer to vector (#180318)
Fix crash in clang PrepareScalarCast when compiling OpenCL source: void
foo() {
int a[3] = {1, 2, 3};
int3 b = (int3)(a);
}
PrepareScalarCast requires scalar src, but the provided src is a
pointer.
Resolves https://github.com/intel/compute-runtime/issues/888
[clang] Ensure -mno-outline adds attributes
Before this change, `-mno-outline` and `-moutline` only controlled the
pass pipelines for the invoked compiler/linker.
The drawback of this implementation is that, when using LTO, only the
flag provided to the linker invocation is honoured (and any files which
individually use `-mno-outline` will have that flag ignored).
This change serialises the `-mno-outline` flag into each function's
IR/Bitcode, so that we can correctly disable outlining from functions in
files which disabled outlining, without affecting outlining choices for
functions from other files. This matches how other optimisation flags
are handled so the IR/Bitcode can be correctly merged during LTO.
[clang] Add clang::nooutline Attribute
This change:
- Adds a `[[clang::nooutline]]` function attribute for C and C++. There
is no equivalent GNU syntax for this attribute, so no `__attribute__`
syntax.
- Uses the presence of `[[clang::nooutline]]` to add the `nooutline`
attribute to IR function definitions.
- Adds test for the above.
The `nooutline` attribute disables both the Machine Outliner (enabled at
Oz for some targets), and the IR Outliner (disabled by default).
[outliners] Turn nooutline into an Enum Attribute
This change turns the `"nooutline"` attribute into an enum attribute
called `nooutline`, and adds an auto-upgrader for bitcode to make the
same change to existing IR.
This IR attribute disables both the Machine Outliner (enabled at Oz for
some targets), and the IR Outliner (disabled by default).
[clang][Driver] Support Outline Flags on RISC-V and X86 (#163664)
These two targets both also support the machine outliner, so these flags
should probably be cross-target. This updates the docs for these flags
as well.
x86: keep legacy generated vdso files around in .gitignore file
Commit 93d73005bff4 ("x86/entry/vdso: Rename vdso_image_* to
vdso*_image") updated the vdso .gitignore file with the new filenames,
which is certainly not incorrect.
However, while adding new generated names is obviously the right thing
to do, you should *not* immediately remove the old filenames from the
.gitignore file when things move around or get renamed, because people
still have those old generated files in their build trees - and they
haven't suddenly become valid files to commit to the repository just
because they were moved or renamed.
While it's mostly just a slight visual nuisance for 'git status' that
can be fixed up with a clean build tree, it can become more serious than
that: see for example commit 04a3389b3535 ("Remove stale generated
'genheaders' file").
That commit removed up a stale generated file that had been carelessly
[7 lines not shown]
Merge tag 'x86_misc_for_7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull misc x86 updates from Dave Hansen:
"The usual smattering of x86/misc changes.
The IPv6 patch in here surprised me in a couple of ways. First, the
function it inlines is able to eat a lot more CPU time than I would
have expected. Second, the inlining does not seem to bloat the kernel,
at least in the configs folks have tested.
- Inline x86-specific IPv6 checksum helper
- Update IOMMU docs to use stable identifiers
- Print unhashed pointers on fatal stack overflows"
* tag 'x86_misc_for_7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/traps: Print unhashed pointers on stack overflow
Documentation/x86: Update IOMMU spec references to use stable identifiers
x86/lib: Inline csum_ipv6_magic()