-
Notifications
You must be signed in to change notification settings - Fork 81
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
core: Add support for typed SSA values in isa #3988
base: math-fehr/stack/2
Are you sure you want to change the base?
Conversation
`isa(arg, SSAValue[T])` will check that `arg` is an SSA value, and that its type is `T`. stack-info: PR: #3988, branch: math-fehr/stack/3
94c3082
to
df1b555
Compare
43a5756
to
1c59e49
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## math-fehr/stack/2 #3988 +/- ##
=====================================================
+ Coverage 89.99% 90.16% +0.17%
=====================================================
Files 466 458 -8
Lines 59260 58315 -945
Branches 5800 5693 -107
=====================================================
- Hits 53330 52581 -749
+ Misses 4500 4341 -159
+ Partials 1430 1393 -37 ☔ View full report in Codecov by Sentry. |
if origin is SSAValue: | ||
if not isinstance(arg, SSAValue): | ||
return False | ||
arg = cast(SSAValue, arg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to do isa(arg.type, get_args(hint)[0])
here?
|
||
assert isa(a, SSAValue) | ||
assert isa(a, SSAValue[IntegerType]) | ||
assert not isa(a, SSAValue[StringAttr]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a test with a generic attribute like VectorType[IntegerType]
or something.
1c59e49
to
1f5d2be
Compare
df1b555
to
d825f9f
Compare
`isa(arg, SSAValue[T])` will check that `arg` is an SSA value, and that its type is `T`. stack-info: PR: #3988, branch: math-fehr/stack/3
Stacked PRs:
core: Add support for typed SSA values in isa
isa(arg, SSAValue[T])
will check thatarg
is an SSA value, and thatits type is
T
.