<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55710>55710</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
              Are comments on SDTCisVTSmallerThanOp out of date?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          csstormq
      </td>
    </tr>
</table>

<pre>
    - First, the comment on SDTCisVTSmallerThanOp as follows (in llvm/include/llvm/Target/TargetSelectionDAG.td):

```
// SDTCisVTSmallerThanOp - The specified operand is a VT SDNode, and its type is
// smaller than the 'Other' operand.
class SDTCisVTSmallerThanOp<int OpNum, int OtherOp> : SDTypeConstraint<OpNum> {
  int OtherOperandNum = OtherOp;
}
```

As the comment says above, the value type of 'Other' operand is bigger. But in practice, I find the  'Other' operand is smaller one.

Here are my test code:

```
def SDT_TEST : SDTypeProfile<1, 2, [
  SDTCisVTSmallerThanOp<2, 1>
]>;

def TEST_SDNode : SDNode<"MyRISCVISD::TEST", SDT_TEST>;

def : Pat<(i32 (TEST_SDNode i32:$rs1, i16:$rs2)), (ADD GPR:$rs1, GPR:$rs2)>;

def : Pat<(v32i1 (TEST_SDNode v32i1:$rs1, v16i1:$rs2)), (ADD GPR:$rs1, GPR:$rs2)>;

def : Pat<(f16 (TEST_SDNode f32:$rs1, f16:$rs2)), (ADD GPR:$rs1, GPR:$rs2)>;

def : Pat<(v2i16 (TEST_SDNode v2i16:$rs1, v1i16:$rs2)), (ADD GPR:$rs1, GPR:$rs2)>;

def : Pat<(v2f16 (TEST_SDNode v2f16:$rs1, v1f16:$rs2)), (ADD GPR:$rs1, GPR:$rs2)>;`
```

- Second, the other comment on SDTCisVTSmallerThanOp as follows (in llvm/utils/TableGen/CodeGenDAGPatterns.cpp):

```
  case SDTCisVTSmallerThanOp: {
    // The NodeToApply must be a leaf node that is a VT.  OtherOperandNum must
    // have an integer type that is smaller than the VT.
    if (!NodeToApply->isLeaf() ||
        !isa<DefInit>(NodeToApply->getLeafValue()) ||
        !static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef()
               ->isSubClassOf("ValueType")) {
      TP.error(N->getOperator()->getName() + " expects a VT operand!");
      return false;
    }
```

As the comment says above, the 'Other' operand must have an integer type. But as my test code shown, the 'Other' operand can have a floating point type.

So are the two comments out of date?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1Vltz6jgM_jXhxdNM4jRcHnig4bTbmd3TzoHpa8ckCnjHxFnbocu_X8kJECjtObO7ZUIusvXpk2RLXuliP71h99JYF_CMuQ2wXG-3UDmmK7aYLzNpX5aLrVAKzHIjqqeaCctKrZR-syzgY1kxpXbbgN_LKldNAfjWCZbCrMEdXxagIHdSV_PZQ-iKgE-CZBZE8yA63IdRd7Wf_B6vD0jcsCVytTXkspRQMF2DEVXBpGWCvSxR67smLhnzUmeZ29eAw2fYtsVEv0XlnQ_46AmfBp8HyLDVyJWw9jqZIMkkBuyp_t5syaL_IBQa-sbQS9JD85murDMCx1GlnU7jo7vWBOtrets4A9XnJ7RuZjCaXw-Zv8_sWSKt2GNQVnoHhxTvhGqgDYgur_lMYVzJ9RpMyO4ah7xYbQQmL_cYj6yUOImgPtI-RFZXEPa5_QYGmMD_ds8cWIcsMU2froMCSorf6_LbYtkL5rPRpVSom8XEidMtSI-h_ChTfl6Mce9spXN6Pwb2aJGsvbarqDPqF1SSBZz_sf_xuMheHhdzYp7MaC6KCflA9DooAT0L51HGMuG0gfqGUESI_NZY75SMh4dvTvuFroyUZvM5e3j-cTa59-0n_5zBLuEyvuTghWfAu3h4knwFjzIeXrIoLyJRfnEk0Od3HLzwIhJfnRF-JRZeeMHjf4jHsWhcqyE3bAG5ropDydC0x_99b2icVNZ3gpWCB6jwNUPX8A2bAXrvwFQ2zOv6p12BsVxY-Gh7z_rVlIqTL_PUKiiSSz2ra7Vn2wYLzwrr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