[llvm] [RISCV] Add missing RISCVMaskedPseudo for TIED pseudos (PR #86787)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 05:08:22 PDT 2024


lukel97 wrote:

> LGTM w/comment.
> 
> Note that this is a slightly larger change than it first appears. We're not adding the annotation for _another_ instance of a TIED pseudo, this is the _first_ instance of the TIED pseudo.
> 
> Looking at the existing code in performCombineVMergeAndVOps, I don't see a problem, but please make sure you audit this code closely - if you haven't already.

Yeah, we should already have all the bits in place to handle tied pseudos since they share the same operand layout as VPseudoUnaryNoMask. As far as I can tell the two pseudo classes are almost the same

```tablegen
class VPseudoTiedBinaryNoMask<VReg RetClass,
                              DAGOperand Op2Class,
                              string Constraint,
                              int TargetConstraintType = 1> :
      Pseudo<(outs RetClass:$rd),
             (ins RetClass:$rs2, Op2Class:$rs1, AVL:$vl, ixlenimm:$sew,
                  ixlenimm:$policy), []>,
      RISCVVPseudo {
  let mayLoad = 0;
  let mayStore = 0;
  let hasSideEffects = 0;
  let Constraints = !interleave([Constraint, "$rd = $rs2"], ",");
  let TargetOverlapConstraintType = TargetConstraintType;
  let HasVLOp = 1;
  let HasSEWOp = 1;
  let HasVecPolicyOp = 1;
  let isConvertibleToThreeAddress = 1;
  let IsTiedPseudo = 1;
}

class VPseudoUnaryNoMask<DAGOperand RetClass,
                         DAGOperand OpClass,
                         string Constraint = "",
                         int TargetConstraintType = 1> :
      Pseudo<(outs RetClass:$rd),
             (ins RetClass:$merge, OpClass:$rs2,
                  AVL:$vl, ixlenimm:$sew, ixlenimm:$policy), []>,
      RISCVVPseudo {
  let mayLoad = 0;
  let mayStore = 0;
  let hasSideEffects = 0;
  let Constraints = !interleave([Constraint, "$rd = $merge"], ",");
  let TargetOverlapConstraintType = TargetConstraintType;
  let HasVLOp = 1;
  let HasSEWOp = 1;
  let HasVecPolicyOp = 1;
}
```


https://github.com/llvm/llvm-project/pull/86787


More information about the llvm-commits mailing list