This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Remove RISCVII::hasMergeOp. NFC
ClosedPublic

Authored by craig.topper on Jun 6 2023, 3:30 PM.

Details

Summary

We can mostly get this from the operand info in MCInstrDesc.
The exception is the _TIED pseudos so I've added a new flag for those.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 6 2023, 3:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2023, 3:30 PM
craig.topper requested review of this revision.Jun 6 2023, 3:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2023, 3:30 PM
Herald added subscribers: eopXD, MaskRay. · View Herald Transcript
frasercrmck added inline comments.Jun 12 2023, 2:06 AM
llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
176 ↗(On Diff #529059)

I notice that code checks getNumExplicitDefs but isFirstDefTiedToFirstUse checks jut getNumDefs - is this significant? The number of "explicit" defs seems more correct to me.

If that were fixed up, could this code use isFirstDefTiedToFirstUse?

craig.topper added inline comments.Jun 12 2023, 12:08 PM
llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
176 ↗(On Diff #529059)

isFirstDefTiedToFirstUse uses getNumDefs from MCInstrDesc. There is no getNumExplicitDefs in MCInstrDesc.

I can use isFirstDefTiedToFirstUse here but it doesn't remove the need to check OpNo == MI->getNumExplicitDefs() first. We still need to know we're on the loop iteration corresponding to the first use. isFirstDefTiedToFirstUse is only an instruction property not an operand property.

craig.topper added inline comments.Jun 12 2023, 12:20 PM
llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
176 ↗(On Diff #529059)

I think I want to leave it as getOperandConstaint using the operand numbers we are currently processing.

Rebase. Use MachineOperand::isTied to avoid going through MCID if we don't have to.

frasercrmck accepted this revision.Jun 13 2023, 1:23 AM

LGTM. I like what you've done in the most recent patch - it's much clearer

This revision is now accepted and ready to land.Jun 13 2023, 1:23 AM
This revision was landed with ongoing or failed builds.Jun 13 2023, 10:54 AM
This revision was automatically updated to reflect the committed changes.