Allow calling MethodInstance::resolve without a typemap
- once typechecking/type inferencing is done and types are updated in
the IR, the typeMap is unnecessary.
9de755b...
by
Carl Geoffrion <email address hidden>
Update StrengthReduction pass relative to signed shift left operation (#2754)
* Update StrengthReduction pass relative to signed shift left operation
The current code does not slice a shift left operation if the source
field is signed, e.g.:
unsigned_val[7:0] = (signed_val << 3)[15:8];
to something like this:
unsigned_val[7:0] = signed_val[12:5];
This is not in-line with the P4 Spec "8.6. Operations on fixed-width
signed integers" chapter which state "Shifting left produces the exact
same bit pattern as a shift left of an unsigned value. Shift left can
thus overflow, when it leads to a change of the sign bit."
Slicing the operation also help reduce field constraints down the road.