This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][RISCV] Recognize mapping symbols
ClosedPublic

Authored by jobnoorman on Jun 19 2023, 7:39 AM.

Diff Detail

Event Timeline

jobnoorman created this revision.Jun 19 2023, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2023, 7:39 AM
jobnoorman requested review of this revision.Jun 19 2023, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2023, 7:39 AM
Amir added a comment.Jun 19 2023, 9:28 AM

The test is failing in pre-merge checks – can you please verify why?

The test is failing in pre-merge checks – can you please verify why?

Ugh, this is caused by the pre-merge checks using the system's clang (-DBOLT_CLANG_EXE=/usr/bin/clang is passed to cmake). This patch depends on a change in the RISC-V MC layer (D153260) so won't work with an old clang.

I'm not quite sure how to solve this, other than updating the pre-merge checks to build clang itself. Would this be an option?

Note that this isn't the first time I had to make MC changes for BOLT RISC-V support and I assume it won't be the last so I'm a bit afraid this issue might come up again in the future.

Amir accepted this revision.Jun 19 2023, 10:07 AM

The test is failing in pre-merge checks – can you please verify why?

Ugh, this is caused by the pre-merge checks using the system's clang (-DBOLT_CLANG_EXE=/usr/bin/clang is passed to cmake). This patch depends on a change in the RISC-V MC layer (D153260) so won't work with an old clang.

I'm not quite sure how to solve this, other than updating the pre-merge checks to build clang itself. Would this be an option?

Note that this isn't the first time I had to make MC changes for BOLT RISC-V support and I assume it won't be the last so I'm a bit afraid this issue might come up again in the future.

Thanks for checking. Yes, it's an inconvenience that we need to keep in mind. It's a choice not to overburden the pre-merge builder with clang and lld builds that are needed for tests only.

LG in general, but let's wait until the dependencies are landed.

This revision is now accepted and ready to land.Jun 19 2023, 10:07 AM
Amir added inline comments.Jun 19 2023, 10:11 AM
bolt/test/RISCV/mapping-syms.s
2

Suggestion: you can switch to llvm-mc to pick up MC changes.

yota9 accepted this revision.Jun 19 2023, 10:14 AM

Use llvm-mc+lld instead of clang for the tests.

This patch relies on a recent MC-layer change but the pre-merge check bots use
the system's clang. Until the MC change is released, we cannot use clang.

jobnoorman marked an inline comment as done.Jun 19 2023, 10:30 AM
jobnoorman added inline comments.
bolt/test/RISCV/mapping-syms.s
2

Thanks, done!

This revision was automatically updated to reflect the committed changes.
jobnoorman marked an inline comment as done.
jrtc27 added inline comments.Jul 29 2023, 12:27 AM
bolt/lib/Core/BinaryContext.cpp
1778

This won't handle the $x<isa> and $x<isa>.<uniquifier> symbols present for RISC-V but not AArch64