Adds convenience methods to the lambda node for retrieving the memory state region argument or result.
Uses them to remove some FIXMEs in the memory state encoder.
Fixes an FreeNull RVSDG test where the memory state was not the last argument/result.
It is currently not enforced on lambda creation that the last argument/result of a lambda node needs to be a memory state. This is only enforced on the call nodes at the moment. The reason why we currently cannot enforce this is because the HLS dialect uses the same lambda, but without memory states. This tight coupling will hopefully be resolved in the near future and then we can start to enforce it on the lambda side as well.
This PR does the following:
It is currently not enforced on lambda creation that the last argument/result of a lambda node needs to be a memory state. This is only enforced on the call nodes at the moment. The reason why we currently cannot enforce this is because the HLS dialect uses the same lambda, but without memory states. This tight coupling will hopefully be resolved in the near future and then we can start to enforce it on the lambda side as well.