Page MenuHomePhabricator

[RISCV] Add CodeGen support of RISCV zcmp Extension
Needs ReviewPublic

Authored by VincentWu on Sep 25 2022, 4:26 AM.

Details

Summary

This patch adds codegen support to the zcmp extension.

it add is two passes:
RISCVMoveOptimizer.cpp which combines two mv inst into one cm.mva01s or cm.mva01s.

RISCVPushPopOptimizer.cpp generates and inserts push/pop instructions. In addition to that, the stack order of the eplog and prolog has been reordered for push/pop inst.

co-author: @Lukacma

Diff Detail

Event Timeline

VincentWu created this revision.Sep 25 2022, 4:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2022, 4:26 AM
VincentWu requested review of this revision.Sep 25 2022, 4:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2022, 4:26 AM
VincentWu updated this revision to Diff 473904.Tue, Nov 8, 12:52 AM

Do not emit Push/Pop when FP is in used

Fixed the problem mentioned in https://github.com/plctlab/llvm-project/issues/58

For the reason that the Spec of the ZCMP extension is not currently modified for this purpose, the LLVM implementation is modified first to avoid this problem. When DisableFramePointerElim is set, the generation of Push/Pop instructions is stopped.