This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][NFC] Add sched for some instructions in Zb extension
ClosedPublic

Authored by Jimerlife on Feb 16 2022, 10:25 PM.

Details

Summary
  1. add sched to brev8, zip and unzip instruction

Diff Detail

Event Timeline

Jimerlife created this revision.Feb 16 2022, 10:25 PM
Jimerlife requested review of this revision.Feb 16 2022, 10:25 PM
craig.topper added inline comments.Feb 16 2022, 10:32 PM
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
602

This change isn't mentioned in the title or the description.

Jimerlife retitled this revision from [RISCV][NFC] Adjust predicates for some instructions in Zb extension to [RISCV][NFC] Add sched and adjust predicates for some instructions in Zb extension.Feb 16 2022, 10:41 PM
Jimerlife edited the summary of this revision. (Show Details)
Jimerlife marked an inline comment as done.
craig.topper added inline comments.Feb 16 2022, 10:49 PM
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
860

Is this not a functional change for RV64 because ZIP_RV32 will put 0b01111 in bits 24:20 which matches the 15 that was requested in the pattern?

Jimerlife added inline comments.Feb 17 2022, 7:18 PM
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
860

This change will not affect RV64. where defined ZIP_RV32 and UNZIP_RV32 also add "IsRV32" constrain.

craig.topper added inline comments.Feb 17 2022, 7:23 PM
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
860

Without this patch isel will pick these instructions on rv64. The IsRV32 on the instructions only affects the assembler or disassembler.

We need to understand what really happens on RV64 so I know if this needs to be bacported to LLVM 14

Jimerlife added inline comments.Feb 17 2022, 7:31 PM
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
860

OK, I will remove this change and keep adding only sched in this patch.

Jimerlife updated this revision to Diff 409846.Feb 17 2022, 7:37 PM
Jimerlife retitled this revision from [RISCV][NFC] Add sched and adjust predicates for some instructions in Zb extension to [RISCV][NFC] Add sched for some instructions in Zb extension.
Jimerlife edited the summary of this revision. (Show Details)

only add sched for instructions

This revision is now accepted and ready to land.Feb 18 2022, 10:12 PM
craig.topper added inline comments.Feb 18 2022, 10:24 PM
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
860

I investigated this, the use of i32 in the pattern prevents it from matching on RV64. So there was no issue. Still a good idea to use IsRV32. I'll go ahead and commit that. Thanks for spotting it.

This revision was landed with ongoing or failed builds.Feb 20 2022, 5:58 PM
This revision was automatically updated to reflect the committed changes.