-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
refactor: using emit_cmp helper to refactor lowering of selection ins… #7344
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.
Thanks! One formatting nit below, otherwise this seems correct.
Do you expect codegen to improve for any combination of compare and select instructions? If so, could we add a test showing that?
@@ -2082,8 +2082,7 @@ | |||
;; than one instruction for certain types (e.g., XMM-held, I128). | |||
|
|||
(rule (lower (has_type ty (select (maybe_uextend (icmp cc a @ (value_type (fits_in_64 a_ty)) b)) x y))) | |||
(let ((size OperandSize (raw_operand_size_of_type a_ty))) | |||
(with_flags (x64_cmp size b a) (cmove_from_values ty cc x y)))) | |||
(lower_select_icmp ty (emit_cmp cc a b ) x y)) |
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.
formatting nit: remove the space between b
and the right-paren?
Hi @cfallin thanks for your review, I think this change will behave the same as before, just a simple refactor to using Because I am new to both ISLE and clif IR, I might be missing some potential improvements we can make. if so please point it out to me , thanks ~ |
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.
Looks good, thanks! I didn't necessarily expect any codegen changes either, I was just curious if there were any intended. This looks like a pure refactor which is perfectly fine!
This PR implements the second part of issue #5869 .
As lowering the
select
instruction based onfcmp
. I declare a helper function for loweringicmp
-based select instruction.