You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This reverts commit f2e38e8.
In downstream testing, this folder appeared to cause assertions in
upstream MLIR to fail with the following:
```
llvm::APSInt mlir::IntegerAttr::getAPSInt() const: Assertion
`!getType().isSignlessInteger() && "Signless integers don't carry a
sign for APSInt"' failed.
```
@mikeurbach I took a look at it and it seems that for other dialects, Ops (and respective folders) provide additionally a signedness, like in HWArith.
In my folders to construct a return attribute type I use IntegerType::get(context, resultWidth) - the same way as the existing IntegerShlOp::fold that doesn't cause trouble.
It seems that for add and mulIntegerType::get(getContext(), resultWidth) results that output attribute is sometime signless, for the tests that you run.
My proposition is that I can make it IntegerType::get(getContext(), resultWidth, signedness) and replicate AddOp/MulOp::inferReturnTypes from other dialects for add and sub folders in FIRRTLFolds.cpp (I think it's one more thing that these folds should also do).
@seldridge did some digging:
The issue appears to be that we have an i8 attribute and it is being converted to an APSInt:
The text was updated successfully, but these errors were encountered: