Skip to content

Commit

Permalink
[RISCV] Add isMoveReg to vmv1r/vmv2r/vmv4r/vmv8r.v.
Browse files Browse the repository at this point in the history
This allows TII isCopyInstrImpl to consider them copies.

Reviewed By: wangpc

Differential Revision: https://reviews.llvm.org/D155140
  • Loading branch information
topperc committed Jul 18, 2023
1 parent 7767297 commit cdee88a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVInstrInfoV.td
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ let Constraints = "@earlyclobber $vd", RVVConstraint = Vcompress in {
defm VCOMPRESS_V : VCPR_MV_Mask<"vcompress", 0b010111>;
} // Constraints = "@earlyclobber $vd", RVVConstraint = Vcompress

let hasSideEffects = 0, mayLoad = 0, mayStore = 0,
let hasSideEffects = 0, mayLoad = 0, mayStore = 0, isMoveReg = 1,
RVVConstraint = NoConstraint in {
// A future extension may relax the vector register alignment restrictions.
foreach n = [1, 2, 4, 8] in {
Expand Down
3 changes: 1 addition & 2 deletions llvm/test/CodeGen/RISCV/rvv/copyprop.mir
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
; CHECK-NEXT: li a2, 128
; CHECK-NEXT: bgeu a0, a2, .LBB0_2
; CHECK-NEXT: .LBB0_4: # %entry
; CHECK-NEXT: vmv1r.v v8, v9
; CHECK-NEXT: vse64.v v8, (a1)
; CHECK-NEXT: vse64.v v9, (a1)
; CHECK-NEXT: ret
entry:
ret void
Expand Down

0 comments on commit cdee88a

Please sign in to comment.