Skip to content

LLVM and SPIRV-LLVM-Translator pulldown (WW25) #10039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1,697 commits into from
Closed

Conversation

sys-ce-bb
Copy link
Contributor

@sys-ce-bb sys-ce-bb commented Jun 23, 2023

LLVM: llvm/llvm-project@af35be5
SPIRV-LLVM-Translator: KhronosGroup/SPIRV-LLVM-Translator@9823690

Community has started to refactor some code assuming opaque pointer only,
however the SPIRV component used in sycl is not ready to enable the opaque pointer by default,
so we have to revert some of the commit by guarding them within macro INTEL_SYCL_OPAQUEPOINTER_READY,
and keep both version of the code.
The old code should be removed once we enable opaque pointer by default.

amy-kwan and others added 30 commits June 19, 2023 12:17
This patch adds support for the TLS local-exec access model on AIX to allow
for the ability to generate the 64-bit (specifically, non-optimized) code sequence.

For this patch in particular, the sequence that is generated involves a load of the
variable offset, followed by an add of the loaded variable offset to r13 (which is
thread pointer, respectively). This code sequence looks like the following:
```
ld reg1,var[TC](2)
add reg2, reg1, r13     // r13 contains the thread pointer
```
The TOC (.tc pseudo-op) entries generated in the assembly files are also
changed where we add the @le relocation for the variable offset.

Differential Revision: https://reviews.llvm.org/D149722
`TrigramIndex` was added back in https://reviews.llvm.org/D27188 as an optimization to make `SpecialCaseList::match()` faster. I've found that `TrigramIndex` actually makes the function slower and it has no functional use, so we can remove it.

I grabbed the list of queries passed to `SpecialCaseList::match()` on a random very large file (`AArch64ISelLowering.cpp`) and measured the runtime to call `match()` on all of them with [this line](https://github.com/llvm/llvm-project/blob/8e1f820bb4eadf5c0704818f6063e0db1006e32d/llvm/lib/Support/SpecialCaseList.cpp#L64) disabled and then enabled.

```
$ hyperfine --warmup 3 'GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=1 build/unittests/Support/SupportTests' 'GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=0 build/unittests/Support/SupportTests'
Benchmark 1: GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=1 build/unittests/Support/SupportTests
  Time (mean ± σ):     575.9 ms ±  20.3 ms    [User: 573.1 ms, System: 2.7 ms]
  Range (min … max):   555.5 ms … 620.0 ms    10 runs

Benchmark 2: GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=0 build/unittests/Support/SupportTests
  Time (mean ± σ):     283.4 ms ±   6.7 ms    [User: 280.3 ms, System: 3.0 ms]
  Range (min … max):   277.0 ms … 294.9 ms    10 runs

Summary
  'GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=0 build/unittests/Support/SupportTests' ran
    2.03 ± 0.09 times faster than 'GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=1 build/unittests/Support/SupportTests'
```

Using `perf` I found that most of the runtime in `TrigramIndex::isDefinitelyOut()` comes from a division operation that seems to come from `std::unordered_map`: https://github.com/llvm/llvm-project/blob/8e1f820bb4eadf5c0704818f6063e0db1006e32d/llvm/include/llvm/Support/TrigramIndex.h#L62

Removing `TrigramIndex` will make it easier to potentially switch to using `GlobPattern` instead of a full regex for `SpecialCaseList`. See discussion in https://reviews.llvm.org/D152762 for details.

Reviewed By: MaskRay, #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D153171
…exical block scopes (4/7)"

Test "local-type-as-template-parameter.ll" now requires linux-system.

Authored-by: Kristina Bessonova <[email protected]>

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

Depends on D144005
…bstraction.

The libc flush operation is not supposed to trigger a platform level
flush operation. See "Notes" on this Linux man page:
    https://man7.org/linux/man-pages/man3/fflush.3.html

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D153182
Update DWARFExpression::Operation and LVOperation to support more than
2 operands.

Take the opportunity to use a SmallVector, which will handle at least 2
operands without allocation anyway, and removes the static limit
completely.

As there is no longer the concept of an "unused operand", remove
Operation::Encoding::SizeNA. Any use of it is now replaced with explicit
checks for how many operands an operation has.

There are still places where the limit remains 2, namely in the
DWARFLinker and in DIExpressions, but these can be updated in later
patches as-needed.

There are no explicit tests as this is nearly NFC: no new operation is
added which makes use of the additional operand capacity yet. A future
patch adding a new DWARF extension point will include operations which
require the support.

Reviewed By: Orlando, CarlosAlbertoEnciso

Differential Revision: https://reviews.llvm.org/D147270
and removed unused CC1Option.
Also change -whole-archive to the canonical spelling and improve tests.
The extension codespace for DWARF expressions (DW_OP_LLVM_{lo,hi}_user)
has shrunk over time, as no extension is ever "retired" in practice. To
facilitate future extensions, this patch reserves one open opcode as an extension
point (0xfe), which is followed by a ULEB128-encoded SubOperation, and
then by the subop's operands.

There is some prior-art, namely DW_OP_AARCH64_operation
(see https://github.com/ARM-software/abi-aa/blob/edd7460d87493fff124b8b5713acf71ffc06ee91/aadwarf64/aadwarf64.rst#45dwarf-expression-operations).

This version makes some different tradeoffs, opting to use a ULEB128 for
the subop encoding for future-proofing.

Reviewed By: #debug-info, dblaikie

Differential Revision: https://reviews.llvm.org/D147271
…pes in lexical block scopes (4/7)""

This reverts commit 2da4517.
Test local-type-as-template-parameter.ll fails on ppc64-aix.
…exical block scopes (4/7)" (2)

Test "local-type-as-template-parameter.ll" is now enabled only for
x86_64.

Authored-by: Kristina Bessonova <[email protected]>

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

Depends on D144005
This patch fixes:

  bolt/lib/Core/BinarySection.cpp:120:24: error: unused variable
  'Relocation' [-Werror,-Wunused-variable]
The Clang built-in function is void __xray_typedevent(size_t, const void *, size_t),
but the LLVM intrinsics has smaller integer types. Since we only allow
64-bit ELF/Mach-O targets, we can change llvm.xray.typedevent to
i64/ptr/i64.

This allows encoding more information and avoids i16 legalization for
many non-X86 targets.

fdrLoggingHandleTypedEvent only supports uint16_t event type.
…vent

The intrinsic has a smaller integer type than the parameter type of
builtin-function/API. Fix this similar to commit 3fa3cb4.
…ore into tilestore

%tile = call x86_amx @llvm.x86.tileloadd64.internal(i16 8, i16 32, i8* %src_ptr, i64 64)
%vec = call <256 x i8> @llvm.x86.cast.tile.to.vector.v256i8(x86_amx...%tile)
store <256 x i8> %vec, <256 x i8>* %dst_ptr, align 256
=>
%tile = call x86_amx @llvm.x86.tileloadd64.internal(i16 8, i16 32, i8* %src_ptr, i64 64)
%stride = sext i16 32 to i64
call void @llvm.x86.tilestored64.internal(i16 8, i16 32, i8* %dst_ptr, i64 32, x86_amx %tile)

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D153002
For simd vector selects, use cmeq + bsl for v2f32/v4f32/v2f64, so their cost are cheep.
Fix llvm/llvm-project#63082

Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D152523
This removes dependence on the libc abort function.
Optimize (cmp+beq => cbz), duduplicate code (SAVE_REGISTERS/RESTORE_REGISTERS),
improve portability (use ASM_SYMBOL to be compatible with Mach-O), and fix style
issues.
Also, port D37965 (x86 tail call) to __xray_FunctionTailExit.
This transform op runs a pass on the target op.

Differential Revision: https://reviews.llvm.org/D153143
The binary tool only works on working source code, if the source code is
not compilable, don't perform any analysis and edits.

Differential Revision: https://reviews.llvm.org/D153271
Add a section to AMDGPUUsage.rst about calling conventions and list the
ones from the CallingConv enum. Full descriptions can come later (help
appreciated).

Differential Revision: https://reviews.llvm.org/D151996
This reverts commit dfbcee2.

This was causing unit tests to fail on Gentoo, see comments on
https://reviews.llvm.org/D152696.
This reverts commit aa7b127.

...because I really ought to install sphinx.
@Chenyang-L Chenyang-L temporarily deployed to aws June 30, 2023 09:14 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws June 30, 2023 10:32 — with GitHub Actions Inactive
@bader bader dismissed their stale review July 6, 2023 00:49

Description is fixed.

@jsji
Copy link
Contributor

jsji commented Jul 6, 2023

@Chenyang-L What is holding this pulldown?

@Chenyang-L Chenyang-L marked this pull request as ready for review July 6, 2023 16:58
@Chenyang-L Chenyang-L requested review from a team as code owners July 6, 2023 16:58
@Chenyang-L Chenyang-L requested a review from bader July 6, 2023 16:58
@bader
Copy link
Contributor

bader commented Jul 6, 2023

@Chenyang-L, please, fix CI checks.

@Chenyang-L Chenyang-L temporarily deployed to aws July 6, 2023 17:05 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 6, 2023 17:36 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 6, 2023 18:29 — with GitHub Actions Inactive
@Chenyang-L
Copy link
Contributor

Chenyang-L commented Jul 6, 2023

@Chenyang-L, please, fix CI checks.

@bader I don't think there are any outstanding fails from last week's checks that should be blocking. Latest run fails for unrelated reasons. What specifically do you see is blocking?

@bader
Copy link
Contributor

bader commented Jul 6, 2023

Latest run fails for unrelated reasons. What specifically do you see is blocking?

Could you clarify what are the reasons?
I expect only two checks to fail:

  • SYCL Nightly / ubuntu2204_opaque_pointers_build_test / Build + LIT (pull_request)
  • SYCL Pre Commit / lint (pull_request_target)

All other check pass in current CI, so this PR seems to introduce regressions. They must be addressed before PR can be merged.

@jsji jsji force-pushed the llvmspirv_pulldown branch from 9944033 to 138c387 Compare July 6, 2023 21:16
@jsji jsji temporarily deployed to aws July 6, 2023 21:35 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to aws July 6, 2023 23:27 — with GitHub Actions Inactive
Due to issue #7268
I changed old exceptions to new ones (`sycl::exception`)
@Chenyang-L Chenyang-L temporarily deployed to aws July 10, 2023 19:23 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 10, 2023 20:01 — with GitHub Actions Inactive
`sycl::runtime_error` is deprecated in SYCL 2020. Therefore, removing
its uses (at least some) from our RT headers.

This PR **does not** cover:
- some of our extensions, like `fixed_size_group` or `matrix`
- `detail/common.hpp`, because it depends on RT library update
- RT library (i.e. `source/` dir)
@Chenyang-L Chenyang-L temporarily deployed to aws July 10, 2023 20:50 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 10, 2023 21:29 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L closed this Jul 11, 2023
@Chenyang-L Chenyang-L temporarily deployed to aws July 11, 2023 21:51 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 11, 2023 22:51 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 12, 2023 17:01 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 12, 2023 17:01 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 12, 2023 23:43 — with GitHub Actions Inactive
@Chenyang-L Chenyang-L temporarily deployed to aws July 12, 2023 23:43 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disable-lint Skip linter check step and proceed with build jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.