-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: common simplifications #208
Conversation
@wsmoses is if (isa<IntegerType>(op.getType().getElementType()) &&
op.getLhs() == op.getRhs()) { |
To be compliant it might also require checking it isn't nan (or enabling the equivalent of fast math) |
does stablehlo provide fast math flags? arith seems to provide but can't find anything in stablehlo specs |
No we've usually been just parameterizing the canonicalizations here where relevant (eg search for like using or something) |
|
ff7d754
to
af99cdf
Compare
721156d
to
3cac288
Compare
a + (-b)
=>a - b
if-b
isn't used anywhere<op>(transpose(a), transpose(b))
=>transpose(<op>(a, b))
if only use<op>(transpose(a), cst)
=>transpose(<op>(a, transposed_cst))
a - a
=>0
c = a + b
;d = c - b
=>d = a
c = a + b
;d = b - c
=>d = -a