This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Update input operands information of Power10 scheduling model
ClosedPublic

Authored by qiucf on Jun 27 2023, 1:08 AM.

Details

Summary

Count of input operands affect pipeline forwarding in scheduling model. Previous Power10 model definition arranges some instructions into incorrect group, by counting the wrong number of input operands.

This patch updates the model, setting the input operands count correctly by excluding irrelevant immediate operands and count memory operands of load instructions correctly.

Diff Detail

Event Timeline

qiucf created this revision.Jun 27 2023, 1:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 1:08 AM
qiucf requested review of this revision.Jun 27 2023, 1:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 1:08 AM
shchenz added inline comments.Jul 5 2023, 11:46 PM
llvm/lib/Target/PowerPC/P10InstrResources.td
317

I am not familiar with the syntax here. But seems from the td file:

def BDNZLR : XLForm_2_ext<19, 16, 16, 0, 0, (outs), (ins),
                          "bdnzlr", IIC_BrB, []>;

BDNZLR should have 0 input operands. But after the change, we now treat it as 1 input operand. Do you know why?

qiucf added inline comments.Jul 6 2023, 1:54 AM
llvm/lib/Target/PowerPC/P10InstrResources.td
317

bdnzlr is actually mnemonic of bclr:

Extended mnemonic:
bclr 4,6 Equivalent to bclr 4,6,0
bltlr Equivalent to bclr 12,0,0
bnelr cr2 Equivalent to bclr 4,10,0
bdnzlr Equivalent to bclr 16,0,0

def BCLR  : XLForm_2_br2<19, 16, 12, 0, (outs), (ins crbitrc:$BI),
                         "bclr 12, $BI, 0", IIC_BrB, []>;
shchenz accepted this revision as: shchenz.Jul 7 2023, 12:07 AM

LGTM.

llvm/lib/Target/PowerPC/P10InstrResources.td
317

I see. Thanks for checking.

This revision is now accepted and ready to land.Jul 7 2023, 12:07 AM
This revision was automatically updated to reflect the committed changes.