-
Notifications
You must be signed in to change notification settings - Fork 79
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
[WIP] dialects: (arith) Fix arith.constant
to return only signless integers
#3802
base: main
Are you sure you want to change the base?
Conversation
I'm a bit confused by the "fix", why is this desirable? |
What fix are you referring to? The arith or the CSL part? If it is for arith, then |
The second, I can't find this constraint in the description here: https://mlir.llvm.org/docs/Dialects/ArithOps/#arithconstant-arithconstantop |
Yeah, that's right, I think the docs should say "signless integer-like" etc. I believe that's why it slipped. But thinking about it, arith is a high enough level of abstraction to deal with signless only integers, so it makes sense within the MLIR rationale, just poor documentation.
|
This PR to de-indents tests by removing the implicitly added `builtin.module`. @superlopuh I applied my script to similar files within that test subfolder while at it. As discussed [here](#3802 (comment)).
34e7293
to
ab1834d
Compare
This PR:
arith.constant
to return only signless integersResolves #1101
cc @n-io @dk949
A side effect of this is that some of CSL backend tests are broken, as they use
arith.constant
to generate signed and unsigned integers for various bit widths.I've fixed
print_csl.mlir
by addingcsl.mlir.signedness_cast
s which creates benign(?) artifacts of@as(i32, 100)
vs plain100
. I'm hoping these are essentially optimized away by the CSL compiler/SDK, but I couldn't find anything related by a cursory look in the docs.More involved fixes would be need in the CSL canonicalization patterns, as they explicitly check for the existence of
arith.constant
ops.@superlopuh my suggestion would be for the CSL ppl to create a separate PR to fix these before this going in, not sure if you agree.
Failing filecheck tests: