Skip to content

[SYCL-MLIR]: Argument Promotion Transformation (part 2) #8730

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 22 commits into from
Mar 24, 2023

Conversation

etiotto
Copy link

@etiotto etiotto commented Mar 21, 2023

Enhance ArgumentPromotion to allow processing calls with only some peelable arguments.
Example:

    func.func private @foo(%arg0: memref<?x!llvm.struct<(i32)>>, %arg1: memref<?x!llvm.struct<(f32)>>) {
      %c0 = arith.constant 0 : index
      %0 = "polygeist.subindex"(%arg0, %c0) : (memref<?x!llvm.struct<(i32)>>, index) -> memref<?xi32>
      %1 = sycl.addrspacecast %arg1 : memref<?x!llvm.struct<(f32)>> to memref<?x!llvm.struct<(f32)>, 4>
      ... 

Only %arg0 can be peeled because %arg1 is not used by a subindex instruction.

etiotto added 17 commits March 16, 2023 10:24
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
Signed-off-by: Tiotto, Ettore <[email protected]>
@etiotto etiotto added the sycl-mlir Pull requests or issues for sycl-mlir branch label Mar 21, 2023
@etiotto etiotto self-assigned this Mar 21, 2023
@etiotto
Copy link
Author

etiotto commented Mar 21, 2023

Depends on #8679

@etiotto etiotto changed the title [SYCL-MLIR]: Enhance ArgumentPromotion to allow processing calls with only *some* peelable arguments. [SYCL-MLIR]: Argument Promotion Transformation (part 2) Mar 22, 2023
@etiotto etiotto requested a review from victor-eds March 22, 2023 00:01
@etiotto etiotto marked this pull request as ready for review March 22, 2023 16:03
@etiotto etiotto requested a review from whitneywhtsang as a code owner March 22, 2023 16:03
Signed-off-by: Tiotto, Ettore <[email protected]>
@etiotto etiotto requested a review from whitneywhtsang March 23, 2023 14:43
Copy link
Contributor

@victor-eds victor-eds left a comment

Choose a reason for hiding this comment

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

Can we have the tests mentioned here? I'm not asking for all of them to produce the expected outcome, but at least having them there with a comment in case they don't to have in mind there's room for improvement

@etiotto
Copy link
Author

etiotto commented Mar 23, 2023

Can we have the tests mentioned here? I'm not asking for all of them to produce the expected outcome, but at least having them there with a comment in case they don't to have in mind there's room for improvement

I have added them. I have:

 // COM:      Test that a peelable argument can be peeled when another argument with the expected type 
 // COM-NEXT: cannot be peeled (because used in the callee by an invalid instruction).
 gpu.func @test5() kernel {

 // COM: Test that an argument that is a multidimentionsal memref is not peeled.
 gpu.func @test6() kernel {
 
  // COM: Test that an argument that is a memref with non-id layouit is not peeled.
 gpu.func @test7() kernel {

 // COM: Test that an argument that is a memref with element type 'struct<(struct<(...)>)>' is not peeled.
 gpu.func @test8() kernel {

Signed-off-by: Tiotto, Ettore <[email protected]>
@whitneywhtsang whitneywhtsang merged commit c68157d into intel:sycl-mlir Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sycl-mlir Pull requests or issues for sycl-mlir branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants