-
Notifications
You must be signed in to change notification settings - Fork 0
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
[VAN-753] Change GEP style for array constraints #60
[VAN-753] Change GEP style for array constraints #60
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few suggestions.
@@ -860,3 +860,18 @@ pub fn create_switch<'a>( | |||
) -> InstructionValue<'a> { | |||
producer.builder().build_switch(value, else_block, cases) | |||
} | |||
|
|||
pub fn get_index_from_gep(gep: PointerValue) -> usize { | |||
let op = gep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it should assert that gep
has the GEP opcode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also assert that operand 1 is 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting a 0 as the first argument of a gep seems to be the standard, I would not worry too much about that, but Im adding the opcode check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly why I would add the assert. If some weird case ever appeared where it wasn't 0 for some reason, we would want to know.
Looking at the failing test case I think this may not work with subcomponent signals but Im not sure yet |
Yeah, I'm creating GEPs from %0 when one of them should be from %6 (in this case) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.