This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Implement COPY for Zvlsseg registers
ClosedPublic

Authored by arcbbb on Apr 11 2021, 8:07 PM.

Details

Summary

When copying Zvlsseg register tuples, we split the COPY into NF whole register moves
as below:

    
$v10m2_v12m2 = COPY $v4m2_v6m2 # NF = 2

>

$v10m2 = PseudoVMV2R_V $v4m2
$v12m2 = PseudoVMV2R_V $v6m2

This patch copies forwardCopyWillClobberTuple from AArch64 to check
register overlapping.

Diff Detail

Event Timeline

arcbbb created this revision.Apr 11 2021, 8:07 PM
arcbbb requested review of this revision.Apr 11 2021, 8:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2021, 8:07 PM
HsiangKai added inline comments.Apr 12 2021, 2:45 AM
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
132–133

Registers for Zvlsseg are also scalable vector. How about to set IsScalableVector to true by default and turn it off for scalar register classes. (Refer to storeRegToStackSlot()).

212–213

How about

If (IsScalableVector) {
  if (NF == 1) {
    // processing scalable vector registers.
  } else {
    // processing Zvlsseg registers.
  }
} else {
  // processing scalar registers
}
arcbbb updated this revision to Diff 336807.Apr 12 2021, 5:05 AM

Address HsiangKai's comment.

craig.topper added inline comments.Apr 12 2021, 10:21 AM
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
146

Consistently use curly braces on all the blocks.

214

Put curly braces on this to match the else.

235

Curly braces around this else to match the if

arcbbb updated this revision to Diff 337011.Apr 12 2021, 6:07 PM

Address Craig's comment.

This revision is now accepted and ready to land.Apr 13 2021, 2:30 AM
This revision was automatically updated to reflect the committed changes.