This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Support parsing target specific flags for MIR
ClosedPublic

Authored by wangleiat on Nov 4 2022, 11:42 PM.

Details

Summary

These hooks ensure that the LoongArch backend can serialize and parse
MIR correctly.

Diff Detail

Event Timeline

wangleiat created this revision.Nov 4 2022, 11:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2022, 11:42 PM
wangleiat requested review of this revision.Nov 4 2022, 11:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2022, 11:42 PM
MaskRay accepted this revision.Nov 5 2022, 4:47 PM

LGTM.

llvm/test/CodeGen/LoongArch/mir-target-flags.ll
4

llc --mtriple=loongarch64 --run-pass loongarch-prera-expand-pseudo does not change the output. Is it needed?

This revision is now accepted and ready to land.Nov 5 2022, 4:47 PM
wangleiat added inline comments.Nov 5 2022, 5:16 PM
llvm/test/CodeGen/LoongArch/mir-target-flags.ll
4

llc --mtriple=loongarch64 --run-pass loongarch-prera-expand-pseudo does not change the output. Is it needed?

Thanks for your review. Yes, it is necessary. In fact, this step is the real test for parsing target flags.

wangleiat added inline comments.Nov 5 2022, 5:22 PM
llvm/test/CodeGen/LoongArch/mir-target-flags.ll
4

llc --mtriple=loongarch64 --run-pass loongarch-prera-expand-pseudo does not change the output. Is it needed?

4

llc --mtriple=loongarch64 --run-pass loongarch-prera-expand-pseudo does not change the output. Is it needed?

Thanks for your review. Yes, it is necessary. In fact, this step is the real test for parsing target flags.

I seem to have misunderstood your meaning, maybe I don't need that pass? It may not be needed, I will verify and modify it.

wangleiat added inline comments.Nov 5 2022, 5:47 PM
llvm/test/CodeGen/LoongArch/mir-target-flags.ll
4

llc --mtriple=loongarch64 --run-pass loongarch-prera-expand-pseudo does not change the output. Is it needed?

I verified it, and it seems that there is no good way to remove this pass to verify that the correct flags are generated in the mir, unless the previous step adds check. The benefit of this is that both the output and the input are validated.