-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[PowerPC] Optimize BUILD_VECTOR from load and zeros #73609
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
Conversation
@@ -3437,6 +3437,12 @@ def : Pat<(store (i32 (extractelt v4i32:$A, 1)), ForceXForm:$src), | |||
def : Pat<(store (f32 (extractelt v4f32:$A, 1)), ForceXForm:$src), | |||
(STIWX (EXTRACT_SUBREG $A, sub_64), ForceXForm:$src)>; | |||
|
|||
// BUILD_VECTOR via loads and zeros. | |||
def : Pat<(v2f64 (build_vector (f64 (extloadf32 ForceXForm:$src)), (f64 fpimm0))), |
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.
Do we not have an opportunity to also improve the following:
- Non-extending load
- Single precision and i32 (other elements are zeros)
- Zero is at a different index
- Little endian
(v2i64 (COPY_TO_REGCLASS (LXSDX ForceXForm:$src), VSRC))>; | ||
def : Pat<(v2i64 BVLoadAndZerosLong<0>.DAG), | ||
(v2i64 (XXPERMDIs | ||
(COPY_TO_REGCLASS (LXSDX ForceXForm:$src), VSRC), 2))>; |
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.
Can we use multiclass
/ defm
to simplify the definitions?
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've tried, however looks not simplified much(Maybe I was using a different approach than what's in your mind).
Ping. |
Take over this patch to get it through reviews and commited in #126599, closing this PR. |
We are encountered with patterns like
BUILD_VECTOR 0, 0, (load), 0
resulted in suboptimal codegen. This PR improves it.