[PATCH] D152313: [RISCV] Remove RISCVII::hasMergeOp. NFC
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 12 12:20:56 PDT 2023
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVMCInstLower.cpp:176
+ // operand after the result.
+ if (OpNo == MI->getNumExplicitDefs() &&
+ MCID.getOperandConstraint(OpNo, MCOI::TIED_TO) == 0) {
----------------
craig.topper wrote:
> frasercrmck wrote:
> > 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`?
> `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.
I think I want to leave it as getOperandConstaint using the operand numbers we are currently processing.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152313/new/
https://reviews.llvm.org/D152313
More information about the llvm-commits
mailing list