Page MenuHomePhabricator

[RISCV] Add Stackmap/Statepoint/Patchpoint support with targets
Needs ReviewPublic

Authored by Zeavee on Jul 15 2022, 5:08 AM.

Details

Reviewers
llvm.org
Summary

This patch adds stackmap support for RISC-V with call targets.

Depends on D123496

Diff Detail

Event Timeline

Zeavee created this revision.Jul 15 2022, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 5:08 AM
Zeavee requested review of this revision.Jul 15 2022, 5:08 AM
Zeavee updated this revision to Diff 445140.Jul 15 2022, 3:03 PM

Update tests that do not check data directive using update_llc_test_checks.py.

Avoid RISC-V fixups for StkMapRecord Instruction Offset as they them to be 0.

jrtc27 added inline comments.Jul 15 2022, 3:11 PM
llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
262 ↗(On Diff #445140)

This seems extremely dubious

llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
147

This seems like a lot of duplication of what already exists for expanding PseudoLI

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
1029

Why initialise to 0? And why have this large scope when it's only for one case?

llvm/test/CodeGen/RISCV/rv64-patchpoint.ll
42

Why the blank lines?

53

These look like some rather machine-generated names; if you don't want to name them, make them %0/1/2/...

101–112

What's the actual point of this test? It seems like a bit of a mess of random arithmetic, pointer casting and memory operations, with a return of 10 for unknown reasons. Are the instructions themselves interesting? If not, make them simpler.

Zeavee added inline comments.Jul 16 2022, 3:46 AM
llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
262 ↗(On Diff #445140)

I understand, and it is. I tried to look at where exactly the OffsetExpr is reduced to 0 in the fixups, but I did not find it. I will search more.

llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
147

I will check if emitting a PseudoLI works correctly.

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
1029

I will put it in a smaller scope.

llvm/test/CodeGen/RISCV/rv64-patchpoint.ll
42

They seem to have been added by update_llc_test_checks.py, as I do not have them in previous versions.

101–112

To be honest, I used tests from AArch64, because I thought they would better than test I would create myself. I do not think the instructions themselves are interesting, so I will modify it.

Zeavee updated this revision to Diff 446430.Jul 21 2022, 4:28 AM

Remove useless test and refactor generateInstSeq by adding generateMCInstSeq to avoid code duplication between PseudoLI and Stackmap.

Zeavee updated this revision to Diff 446866.Jul 22 2022, 9:09 AM

Update rv64-patchpoint.ll test.

Zeavee updated this revision to Diff 448032.Jul 27 2022, 7:26 AM

Remove dubious check in RISCVELFStreamer.cpp.