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

    <tr>
        <th>Summary</th>
        <td>
            [TargetTransformUtils][VectorUtils] Update `isTriviallyVectorizable` to accept target intrinsics
        </td>
    </tr>

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

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

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

<pre>
    As part of [previous work](https://github.com/llvm/llvm-project/issues/117030), we want to consolidate the usage of the `is[Trivially|VectorIntrinsic]...` functions in `VectorUtils.h`. The remaining work is to let `isTriviallyVectorizable` allow target-specific intrinsics denote if they are trivially vectorizable.

The difficulty in this issue is to justify when we should pass a `nullptr` into the updated function calls, as there are a number of functions (`getVectorIntrinsicIDForCall`, `isNotCrossLaneOpartion`, etc.) that use the function.

AC:
- [ ] Implement `isTargetIntrinsicTriviallyVectorizable` in `TargetTransformInfo.[h|cpp]` and `BasicTTIImpl.h`
- [ ] Update `isTriviallyVectorizable` to accept a `TargetTransformInfo` parameter and invoke `isTargetIntrinsicTriviallyVectorizable`
- [ ] Update all use-cases of `isTriviallyVectorizable` to provide a TTI or a motivated reason to provide `nullptr`
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVE2P4zYM_TXyhRjDVvwxPviQDwQIULSXbO-yTMfaVSRDpBOkv76QPZmdXWwxaHsKAlPk43uPTxGZi0NsRbkT5SFRM48-tMZ1aI1OOt8_2i3BpAKDH0CUuyngzfiZ4O7DN1EehHwdmScSm62QRyGPF8Pj3KXaX4U8Wnt7_rxMwX9FzUIeDdGMJOQxz-tskwnZCLmHO8JdOQb2oL0jb02vGIFHhJnUBSOA-EdUmSFR7s7B3Iyy9iHq_Z-o2YeT42AcGS3KQ5qmospgmJ1m4x2BcfHlWviFjaV0FFWWwnlECHhVxhl3WbYCQxGERV5nvQ9aH5u_VGcxNlfW-juwChfkF5pQm8FoME8UBD06zwhmAf4AFRD42QxuH7qlItuKbBux9GYYjJ4tPyJkHg3Bwtcbqq8zsRkecB_RRcpo9LPtYVJEoCJeN1s7cYj4jGO_8jdFKvt3NkAraymSrigWBFywKXDztcMQmf5OnJCvosouyD-RfDocfdgra0WVxVYLV7973gdP9Jty-Ee0jfHu7TuyToVsgEfFMNOq7HPMGwHbffRRtn2JVgNRHuB0nSxe0T21WMh-x_CP0qxqr9XnoBwNPlxPbvCpKHejqPd6mqJ7o4quj7U7FfudT3HgYo0fYHxZGPzED-xBaY0Tr0r8YnqsmlRQV2QMy2Tjbv4b_qvlfgVMWRs5fdGKkJZT_QzpFPzN9FH08_kEPoCCq2dzW4wSUJF3H8t-cFbSt5u-2TQqwTavN8WmaYq8Sca2bwatMcu7fqjqstCbQdedLHo5FEOphy4xrcxkkcu8zvJNVTZpnmda66HAumrKpn4VRRaP0aYxM1IfLsni_jaXWV41iVUdWlriSkqH9_U2hJQxvUK7BE03X0gUmTXE9L0NG7ZLzv0ky5IF0Qrl7kM4_AfN1xz4cP7JHGz7P8Jx3fjWyr8DAAD__04S6Zg">