Skip to content

Conversation

@victor-eds
Copy link
Contributor

Enable addition/subtraction of floating point vectors.

Make integer and pointer addition commutative.

Instead of generating an incorrect getelementptr instruction with a null pointer argument, generate an inttoptr using the index as an argument.

Use polygeist.subindex instead of
polygeist.memref2pointer+llvm.getelementptr+polygeist.pointer2memref when subtracting an index to a pointer.

Cast pointers to void and functions to i8 before operating.

Signed-off-by: Victor Perez [email protected]

@victor-eds victor-eds added the sycl-mlir Pull requests or issues for sycl-mlir branch label Nov 16, 2022
@victor-eds victor-eds self-assigned this Nov 16, 2022
Copy link
Contributor Author

@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.

NOTE: We cannot generate NUW, NSW, exact or inbounds op flags. Not supported in MLIR yet.

@victor-eds
Copy link
Contributor Author

First of two PRs addressing binary arithmetic operations.

Enable addition/subtraction of floating point vectors.

Make integer and pointer addition commutative.

Instead of generating an incorrect `getelementptr` instruction with a
`null` pointer argument, generate an `inttoptr` using the index as an
argument.

Use polygeist.subindex instead of
polygeist.memref2pointer+llvm.getelementptr+polygeist.pointer2memref
when subtracting an index to a pointer.

Cast pointers to void and functions to i8 before operating.

Signed-off-by: Victor Perez <[email protected]>
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 - Added some comments on the lit tests and other minor comments.

@victor-eds victor-eds merged commit 9ac759f into intel:sycl-mlir Nov 22, 2022
@victor-eds victor-eds deleted the visit-add-sub branch November 22, 2022 10:34
etiotto pushed a commit to etiotto/intel-llvm that referenced this pull request Nov 22, 2022
Enable addition/subtraction of floating point vectors.

Make integer and pointer addition commutative.

Instead of generating an incorrect `getelementptr` instruction with a
`null` pointer argument, generate an `inttoptr` using the index as an
argument.

Use polygeist.subindex instead of
polygeist.memref2pointer+llvm.getelementptr+polygeist.pointer2memref
when subtracting an index to a pointer.

Cast pointers to void and functions to i8 before operating.

Signed-off-by: Victor Perez <[email protected]>
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