-
Notifications
You must be signed in to change notification settings - Fork 15k
[RISCV] Re-work how VWADD_W_VL and similar _W_VL nodes are handled in combineOp_VLToVWOp_VL. #159205
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
[RISCV] Re-work how VWADD_W_VL and similar _W_VL nodes are handled in combineOp_VLToVWOp_VL. #159205
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,3 +58,26 @@ define <2 x i16> @vwmul_v2i16_multiple_users(ptr %x, ptr %y, ptr %z) { | |
| %i = or <2 x i16> %h, %g | ||
| ret <2 x i16> %i | ||
| } | ||
|
|
||
| ; FIXME: We should have a vsext.vl instead of vzext.vl. | ||
topperc marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| define <4 x i32> @pr159152(<4 x i8> %x) { | ||
| ; NO_FOLDING-LABEL: pr159152: | ||
| ; NO_FOLDING: # %bb.0: | ||
| ; NO_FOLDING-NEXT: vsetivli zero, 4, e16, mf2, ta, ma | ||
| ; NO_FOLDING-NEXT: vsext.vf2 v9, v8 | ||
| ; NO_FOLDING-NEXT: li a0, 9 | ||
| ; NO_FOLDING-NEXT: vwaddu.vx v8, v9, a0 | ||
| ; NO_FOLDING-NEXT: ret | ||
| ; | ||
| ; FOLDING-LABEL: pr159152: | ||
| ; FOLDING: # %bb.0: | ||
| ; FOLDING-NEXT: vsetivli zero, 4, e16, mf2, ta, ma | ||
| ; FOLDING-NEXT: vsext.vf2 v9, v8 | ||
| ; FOLDING-NEXT: li a0, 9 | ||
| ; FOLDING-NEXT: vwaddu.vx v8, v9, a0 | ||
| ; FOLDING-NEXT: ret | ||
| %a = sext <4 x i8> %x to <4 x i16> | ||
| %b = zext <4 x i16> %a to <4 x i32> | ||
| %c = add <4 x i32> %b, <i32 9, i32 9, i32 9, i32 9> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The constant vector allows a RISCVISD::VWADDU_W_VL to be formed between LegalizeVectorOps and LegalizeDAG. LegalizeDAG will turn the build_vector into RISCVISD::VMV_V_X_VL. Then we will try to turn the VWADDU_W_VL into VWADD_VL. If we don't use a constant vector we'll go straight to VWADD_VL after LegalizeVectorOps. |
||
| ret <4 x i32> %c | ||
| } | ||
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.
Mixed up the comments here