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

[RISCV] Unnecessary move of undefined with subregister liveness enabled #63554

Closed
lukel97 opened this issue Jun 27, 2023 · 4 comments
Closed

Comments

@lukel97
Copy link
Contributor

lukel97 commented Jun 27, 2023

define void @repeat_shuffle(<2 x double> %v, ptr noalias %q) {
  %w = shufflevector <2 x double> %v, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
  store <4 x double> %w, ptr %q
  ret void
}

When compiled with llc -mattr=+v, there's an unnecessary vmv1r.v v13, v10 emitted, which copies an implicit def to v13.

repeat_shuffle:                         # @repeat_shuffle
	.cfi_startproc
# %bb.0:
	vmv2r.v	v12, v8
	vsetivli	zero, 4, e64, m2, ta, ma
	vmv1r.v	v13, v10
	vslideup.vi	v8, v12, 2
	vse64.v	v8, (a0)
	ret

Compiling with -riscv-enable-subreg-liveness=0 avoids this:

repeat_shuffle:                         # @repeat_shuffle
	.cfi_startproc
# %bb.0:
                                        # kill: def $v8 killed $v8 def $v8m2
	vsetivli	zero, 4, e64, m2, ta, ma
	vmv2r.v	v10, v8
	vslideup.vi	v10, v8, 2
	vse64.v	v10, (a0)
	ret
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 27, 2023

@llvm/issue-subscribers-backend-risc-v

@topperc
Copy link
Collaborator

topperc commented Jun 28, 2023

cc: @BeMg

BeMg added a commit that referenced this issue Jul 21, 2023
@BeMg
Copy link
Contributor

BeMg commented Aug 2, 2023

This patch fix it.

@kito-cheng
Copy link
Member

Fixed via 1e86abc914bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants