-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RISCV] Fold PseudoVMV_V_V with undef passthru, handling policy #106943
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
Changes from all 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 |
---|---|---|
|
@@ -199,10 +199,8 @@ define <vscale x 2 x i32> @unfoldable_mismatched_sew(<vscale x 2 x i32> %passthr | |
define <vscale x 1 x i64> @undef_passthru(<vscale x 1 x i64> %passthru, <vscale x 1 x i64> %x, <vscale x 1 x i64> %y, iXLen %avl) { | ||
; CHECK-LABEL: undef_passthru: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma | ||
; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma | ||
; CHECK-NEXT: vadd.vv v8, v9, v10 | ||
; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma | ||
; CHECK-NEXT: vmv.v.v v8, v8 | ||
; CHECK-NEXT: ret | ||
%a = call <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64(<vscale x 1 x i64> %passthru, <vscale x 1 x i64> %x, <vscale x 1 x i64> %y, iXLen %avl) | ||
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. Does this actually hold? Consider: Oh, I see it. You're not changing passthru or VL on Src, you're basically just dropping MI. I think this might be cleaner if expressed as an early continue here. This is arguably a different combine entirely. You're basically just using properties of the vmv.v.v itself to prove it can be elided entirely. Actually, now that I say that, yeah, this really doesn't depend on Src at all does it? I don't think you even need the single use condition. 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. Yup, that's exactly what I did in #106840. I added a new peephole that doesn't check Src, but I closed it because I thought it was too similar to foldVMV_V_V. However I've since realised that if the vmv.v.v passthru is undef, then we can still relax Src's policy to be tail agnostic if vmv.v.s tail subsumes it. E.g. if we have
We should actually be able to fold it into:
Hence why I moved it back into foldVMV_V_V, so it could take advantage of #105788. But I completely agree with you here that this is could be much cleaner. I'm going to try again to do this as a separate peephole, but explicitly relaxing Src's policy if possible. |
||
%b = call <vscale x 1 x i64> @llvm.riscv.vmv.v.v.nxv1i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %a, iXLen %avl) | ||
|
Uh oh!
There was an error while loading. Please reload this page.