Skip to content
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

[LLVM][XTHeadVector] Add RedundantVSETVLIElimination pass to remove unnecessary vtype-preserving sequences #99

Merged
merged 9 commits into from
Apr 15, 2024

Conversation

imkiva
Copy link
Collaborator

@imkiva imkiva commented Apr 10, 2024

In #38 we generated prologue and epilogue for COPY nodes, which looks like:

csrr <r1>, vl
csrr <r2>, vtype
th.vsetvli zero, <the-real-vtypei>
<COPY-node>
th.vsetvl zero, <r1>, <r2>

After pass RedundantCopyElimination, some <COPY-node> will be removed from the basic block, thus the sequence becomes:

csrr <r1>, vl
csrr <r2>, vtype
th.vsetvli zero, <the-real-vtypei>
th.vsetvl zero, <r1>, <r2>

And this PR added a new pass RedundantVSETVLIElimination to remove the above sequence pattern.

NOTE: this PR is based on #98, so it should be merged before this one 😉

/cc @AinsleySnow

@imkiva imkiva force-pushed the eliminate-vsetvli branch from 043953b to e29122e Compare April 11, 2024 04:46
@imkiva imkiva changed the title [LLVM][XTHeadVector] Remove <backup-vtype>-<action>-<restore-vtype> where <action> has no side effiect [LLVM][XTHeadVector] Add RedundantVSETVLIElimination pass to remove unnecessary vtype-preserving sequences Apr 11, 2024
@imkiva imkiva force-pushed the eliminate-vsetvli branch from e29122e to 07b6431 Compare April 11, 2024 06:56
@imkiva imkiva force-pushed the eliminate-vsetvli branch from 07b6431 to 4c99a7e Compare April 15, 2024 03:01
@imkiva imkiva marked this pull request as ready for review April 15, 2024 03:02
@imkiva
Copy link
Collaborator Author

imkiva commented Apr 15, 2024

Let's wait for CI results 😉

@ChunyuLiao ChunyuLiao merged commit b0d2834 into ruyisdk:rebase-17.0.6 Apr 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants