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

    <tr>
        <th>Summary</th>
        <td>
            Crash in Linalg::YieldOp::getSuccessorRegions
        </td>
    </tr>

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

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

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

<pre>
    It's implemented as:

```
    void getSuccessorRegions(::llvm::ArrayRef<::mlir::Attribute> operands, ::llvm::SmallVectorImpl<::mlir::RegionSuccessor> & regions) {
 ::mlir::Operation *op = (*static_cast<ConcreteOp *>(this));
 ::llvm::cast<::mlir::RegionBranchOpInterface>(op->getParentOp())
 .getSuccessorRegions(op->getParentRegion(), regions);
    }
    static ::llvm::LogicalResult verifyTrait(::mlir::Operation *op) {
 static_assert(ConcreteOp::template hasTrait<OpTrait::IsTerminator>(),
 "expected operation to be a terminator");
 static_assert(ConcreteOp::template hasTrait<OpTrait::ZeroResults>(),
 "expected operation to have zero results");
 static_assert(ConcreteOp::template hasTrait<OpTrait::ZeroSuccessors>(),
 "expected operation to have zero successors");
    return success(); 
    }
```

Linalg::YieldOp has the interface RegionBranchTerminatorOpInterface, but linalg::GenericOp does not define `RegionBranchOpInterface`, causing it to crash

cc @ftynse @arpitj1 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyslFGL4zYQxz-N_DJscKQ4th_8kM1uysJByt5RaF-KLE9sHbJkpHGu209fZHuTdJuD0h4Iolj6__WbGWlkCLq1iBXLHln2lMiROuerb6F3AUNSu-ateiHG8wC6Hwz2aAkbkIGJHUunsU2Xke4AAM5ON9AifR6VwhCcf8VWOxsYL6JG7Iw59_Ns5718e8UTE_v5Q2-0X5aIvK5HQiaewQ3opW0C43v46PG5l8b8goqcf-kHc8dqPv-CEw0Z34J_xyqB5Y8R_qPwGI8l7SwwvnMDMPEEMQq-CyRJq9-VDMTEfu-s8kh4HOJGJp4ZL6jT0ToOcWN-5V6092EfvbSqOw4vltCfpMLZ1A0PTDy3SD9Lj5aOw0QzHZLuYHU_6R9E88K7cH-ThgUUAFj-tMzmQP8B_8m1WknzimE0BGf0-vT2xUtNlyJ_N4s3-V6yKENAH5XXPM5Kwn4wkhA6GWZ3sT8OyyxueAlf0PfaSprKeglqyjfn-MeAKt5Wd0EgBzWCBLrqOL_G_r-JfkPv5qyEfw3UyTPCn-gd-EX5w5Eu1-K_UIWr-BYMADzS6O37hsVXPMLfrtFtf2Dp7pO20rQz2q8aTXMcIjpQh6DfrzvcPoNrjW8fBN9DPRKYG7uf0KLX6jhA4zCAdQQNnrRFYNv0ew9rm0YrJcegbQuaYuzKy9DNuEoB26QnerMB40z6QdPXNSRNJZpSlDLBap1nGS-LTb5NuiotiiZDVRebzSYTciuaNN_mp6Ip61KVvEh0xVOepcU64zzbiO0qlzzP1ps6S-sGy0awTYq91GYV39vK-TbRIYxYrTNRlNvEyBpNmPo15xa_wbQaS5M9Jb6Kood6bAPbpEYHClcb0mSw2sfgQFu4U4n5z50-kozeVB3RMPV9fmD80GrqxnqlXM_4YWoN88_D4N1XVMT4YSILjB8W9HPF_woAAP__Ks0HJA">