Implement packet_in.extract logic for hs.next.#327
Implement packet_in.extract logic for hs.next.#327vaalfreja wants to merge 1 commit intop4lang:mainfrom
Conversation
| } | ||
| }; | ||
|
|
||
| static std::optional<Value> detectNextPattern(P4HIR::CallMethodOp extractOp) { |
There was a problem hiding this comment.
Value is nullable. No need for optional here
e7880b3 to
41b09ab
Compare
|
Looking at
I looked a bit further and noticed that the IR that we transform is already partly processed ( Can you investigate the implementation again? Can we adjust the strategy (possibly including modifications in the translator) so that we are not depending on very particular IR being matched for this to work? |
Last time we discussed it with @asl, it was that we can't modify the frontend, because other things relies on it, so we need to rely on pattern match, but I agree it's better to drag it as some kind of intrinsic if something changed and it's an option now |
Ok, that's understandable, that's why I said possibly. Let's see what @asl thinks about |
Alternatively I can propose to separate it to some kind of pattern matching pass and run it(I don't know if we plan to have more things like this) just after the translator like I do in a test. All other operations can be safely optimized around it afterwards. Maybe it should be P4HIR.Extract in this case though. |
Signed-off-by: Julia Koval <c_yuliak@xsightlabs.com>
41b09ab to
e440f4b
Compare
Fixes #273. Adds required verify operation an nextIndex field increase in case of extract being used with header_stack.next
Signed-off-by: Julia Koval c_yuliak@xsightlabs.com