This is an archive of the discontinued LLVM Phabricator instance.

[libunwind][RISC-V] Rewrite testcase with C as possible.
ClosedPublic

Authored by kito-cheng on Mar 3 2023, 1:46 AM.

Details

Summary

Fix #60472

The testcase is writen in all inline asm but it seems not well
maintained for the CFI directive, of cause we can fix that, but this
patch also contain another issue is it use s0 and s1 without
store/restore.

This patch proposed another way to testing that, use inline asm to
generate dummy def and use, so compiler will generate store/restore for
the vector register, and then generate the CFI directives.

Also check __riscv_vector as the testcase guard, because the testcase
will read vlenb which is only available when V or zve* extensions is
present.

Diff Detail

Event Timeline

kito-cheng created this revision.Mar 3 2023, 1:46 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 3 2023, 1:46 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
kito-cheng requested review of this revision.Mar 3 2023, 1:46 AM
asb accepted this revision.Mar 8 2023, 1:56 AM

LGTM in that the reasoning seems sensible, but this also isn't an area I've done a huge amount of work in. If you have a high degree of confidence about the change I think it's good to commit - if not, best to wait for another review.

MaskRay accepted this revision.Mar 8 2023, 9:49 AM
MaskRay added inline comments.
libunwind/test/unwind_scalable_vectors.pass.cpp
29

Add noinline and make it static

31

"#" can be ""

This revision is now accepted and ready to land.Mar 8 2023, 9:49 AM