Skip to content

[SYCL-MLIR] Merge from intel/llvm sycl branch #8395

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

Merged
merged 2,301 commits into from
Feb 17, 2023

Conversation

whitneywhtsang
Copy link
Contributor

@whitneywhtsang whitneywhtsang commented Feb 17, 2023

Please only review dc6ee4b and files below:

.github/CODEOWNERS
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp

Upstream commit 505aa7d causes build failures, so is temporarily reverted in sycl-mlir branch.
#8396 is created to investigate the issue.

Please do not squash and merge this PR.

mordante and others added 30 commits January 18, 2023 17:01
These macros make it easier to log additional information. This is
useful for formatting tests. It also properly disables additional
information when locales are disabled in libc++.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D140651
    Currently we build tests as long as the libraries are found on the
    machine. This doesn't necessarily mean there is a GPU to use though.
    This patch changes it to where we only will build the tests if we found
    a compatible GPU via `nvptx-arch` or `amdgpu-arch`.

    The only downside to this I could see if someone were to build LLVM on a
    home node of a cluster and then wished to run the tests after switching
    to a compute node. For this I think we should allow it to be overridden.
    I think that's better than allowing us to run tests that will fail by
    default.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D142018
The patterns used to lower tosa.reshape to linalg are order
dependent which varies depending on platform. Setting the
benefit appropriately guarantees compilation executes the
rewriters in the correct ordering.

Reviewed By: benvanik

Differential Revision: https://reviews.llvm.org/D141981
…shape

It is preferred to merge tosa.transpose operations together rather than convert
one to a tosa.reshape. This is to leverage the tosa.transpose -> tosa.transpose
merging canonicalization.

Reviewed By: AviadCo

Differential Revision: https://reviews.llvm.org/D141434
Try to decrease the block depth here a bit.
Summary:
This works for `OpenMP` and supports the `native` option. It should be
better documented.
Source allocation is similar to mold allocation + assignment. Use
ApplyMold runtime entry point for polymorphic source allocation.
It could be generalized for other source allocation.

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D141996
…olymorphic with intrinsic type spec

When an unlimited polymorphic descriptor is establish for an intrinsic
type spec, the `PointerNullifyIntrinsic` or `AllocatableInitIntrinsic` runtime
function is called. These functions do not initialize an addendum with a derivedType.
When the deallocation on this descriptor is performed, the runtime should not
crash if the addendum is not present. This patch updates `PointerDeallocatePolymorphic`
and `AllocatableDeallocatePolymorphic` for this use case.

Depends on D141996

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D142010
Pass to `getPackingInfoFromConsumer` the tensor.pack op instead of all
the arguments derived from it. Additionally, remove the padding from the
struct, as we currently don't handle propagation when `tensor.pack`
requires padding. We will add back the field when we will need it.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D141837
According to Software Developer Manual, modules should be value 3 and
tile should be value 4.
Before:
```
(lldb) expr --language abc -- 1 + 1
error: unknown language type: 'abc' for expression
```

After:
```
(lldb) expr --language abc -- 1 + 1
error: unknown language type: 'abc' for expression. List of supported languages:
  c++
  objective-c++
  c++03
  c++11
  c++14
  objc++
```

We choose to only list the languages which `expr` will actually
accept instead of all the language constants defined in `Language.cpp`
since that's what the user will most likely need.

Differential Revision: https://reviews.llvm.org/D142034
…ts; NFC

This gives mul the same capabilities as add/sub.
A potential improvement with nsw was noted in:
1720ec6
There are plenty of assumptions in `libomptarget` and the device runtime
about the pointer size or `size_t`, etc. 32-bit systems are not supported. There
is no point to refine whole things to make it portable. This patch simply disables
building on 32-bit systems.

Fix #60121.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D142023
With the addition of `getFileRange`, we rename `getRangeForEdit` as
`getFileRangeForEdit` for consistency in the API.

Depends on D141634

Differential Revision: https://reviews.llvm.org/D141636
Lines with 'record_addr:' are not processed when failing to decode
access tag. The regular format is: %02x/%02x but for a short tag it's:
%02x/%02x(%02x). Now it will handle both cases.

Tested-by: Ivar Henckel <[email protected]>

Reviewed By: fmayer

Differential Revision: https://reviews.llvm.org/D141906
This patch enables to store bitcode images when JIT is enabled for the record-and-replay functionality (see https://reviews.llvm.org/D138931). Credits to @jdoerfert for refactoring the code.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D141986
… TargetMachine. NFC

The MCSTI variable is initialized to TM.getMCSubtargetInfo(), but is
re-assigned in every call to runOnMachineFunction. emitAttributes is
called before any call to runOnMachineFunction, but it's not
immediately obvious.

This patch removes the MCSTI variable, and instead queries
TM.getMCSubtargetInfo() at the time emitAttributes is called.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D142037
…sanMemaccessSymbols.

The STI object in the class is updated each time runOnMachineFunction
is called. That means STI will be based on the last function processed.
If that function has different attributes than the rest of the module
that could theoretically result in odd behavior.

Use the copy in TargetMachine instead. That will use the global
CPU and mattrs.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D142041
…MemaccessSymbols.

We were using an OR with X0 which is the canonical move for AArch64.
The canonical move for RISC-V is ADDI reg1, reg2, 0.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D142044
With recent (> 15, as far as I can tell, possibly > 16) clang, c++17,
and GNU's libstdc++ (versions 9 and 10 and maybe others), LLVM fails
to compile due to an is_invocable() check in unique_ptr::reset().

To resolve this issue, add a template argument to ImplDeleter to make
things work.

Differential Revision: https://reviews.llvm.org/D141865
  CONFLICT (content): Merge conflict in clang/include/clang/Driver/Options.td
The remote stub may give lldb hints about binaries to
be loaded, especially in a firmware type environment, and
relay those hints in the qProcessInfo response.  The
binary loading was done very early in Process setup, before
we had any threads, and this made it complicated for people
to write dSYM python scripts which need access to a thread.
Delay the binary loading until a bit later in the Process
startup.

Differential Revision: https://reviews.llvm.org/D141972
rdar://104235301
Add support for _FLT_ROUNDS_ in SystemZ.

Patch by Tulio Magno Quites Machado Filho.

Reviewed By: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D140988
@etiotto
Copy link

etiotto commented Feb 17, 2023

Good that now othe OCL x64 LLVM test suite run has 9 new passed tests:

Unexpectedly Passed Tests (9):
  SYCL :: Basic/buffer/reinterpret.cpp
  SYCL :: HostInteropTask/host-task-two-queues.cpp
  SYCL :: KernelFusion/abort_fusion.cpp
  SYCL :: KernelFusion/abort_internalization.cpp
  SYCL :: KernelFusion/jit_caching.cpp
  SYCL :: KernelFusion/sync_two_queues_requirement.cpp
  SYCL :: OneapiDeviceSelector/case_sensitivity.cpp
  SYCL :: Regression/group_local_linear_id.cpp
  SYCL :: SubGroup/sub_groups_sycl2020.cpp

@etiotto
Copy link

etiotto commented Feb 17, 2023

Similarly the OCL GEN9 LLVM test suite has Unexpectedly Passed: 12

@etiotto
Copy link

etiotto commented Feb 17, 2023

And the L0 GEN9 LLVM test suite has Unexpectedly Passed: 18 !! Cool!

Copy link

@etiotto etiotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks @whitneywhtsang !

@whitneywhtsang whitneywhtsang merged commit 55c95b6 into intel:sycl-mlir Feb 17, 2023
@whitneywhtsang whitneywhtsang deleted the merge branch February 17, 2023 21:41
whitneywhtsang added a commit to intel/llvm-test-suite that referenced this pull request Mar 1, 2023
Fixed by intel/llvm#8395.

Signed-off-by: Tsang, Whitney <[email protected]>
whitneywhtsang added a commit to intel/llvm-test-suite that referenced this pull request Mar 27, 2023
Fixed by intel/llvm#8395.

Signed-off-by: Tsang, Whitney <[email protected]>
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 sycl-mlir Pull requests or issues for sycl-mlir branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.