Open Xazax-hun opened 3 years ago
Also for comparison operators, we might be able to fold when only one argument is constant. E.g. false && var
.
Yeah, that seems quite plausible! I'd be happy to merge those identities in the example LVN implementation if they're not too tricky to implement.
Since bril
doesn't support logical operators (please correct me if I'm wrong), this should be OK to close?
We do have and
, or
, and not
: https://capra.cs.cornell.edu/bril/lang/core.html#logic
Well that's embarrassing. I'll get a patch in for this.
As far as I understand, if two values have the same value number, they are guaranteed to be the same at runtime. As a result, for operator
eq
, if both operands have the same value number (even if they are not constants) we could fold the operator to a constant true.