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

    <tr>
        <th>Summary</th>
        <td>
            llvm-project/llvm/lib/IR/Constants.cpp:1687: const llvm::APInt &llvm::Constant::getUniqueInteger() const: Assertion `C && isa<ConstantInt>(C) && "Not a vector of numbers!"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:RISC-V,
            vectorization
      </td>
    </tr>

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

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

<pre>
    The loop vectorizer hits an assertion when building with optimizations and RVV.  This is an unreduced test case.

```
// %clang_cc1 -triple riscv64-unknown-linux-musl -emit-obj -target-feature +v -O1 -vectorize-loops %s
// REQUIRES: asserts

void mode_to_string(unsigned mode, char *buf)
{
  char c, d;
  int i, bit;

  buf[10]=0;
  for (i=0; i<9; i++) {
    bit = mode & (1<<i);
    c = i%3;
    if (!c && (mode & (1<<((d=i/3)+9)))) {
      c = "tss"[d];
      if (!bit) c &= ~0x20;
    } else c = bit ? "xwr"[c] : '-';
    buf[9-i] = c;
  }
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtVMmSmzAQ_Rq4dOECYbYDB29T5UsWZzLXKSFkUIIlRxKeyXx9WgI7dipVQkAvr99TS2pU-7t-7jkMSp3hwplVWnxwDb2wBqgEagzXVigJbz2X0IxiaIXs4E3YHtTZipP4oM7vols4vLwsAJ57YUD4_FFq3o6Mt2C5scCo4Ysg3gbxap7zeB7TL3nCAQHJ2EBl98pYApHV4jxw0MKwS76MRvlTqjcZDUKO79FpNANE_CRspJofGEx1x2105NSOmiPS-gLRZ0S5iYucVuNqmIeih93X7_vD7luQrmbZ5p7pRYkWTqrlr1a9GuQku4CUozSik3zyBGQDrKcasVfNeAxINQMU6-kDJjdzgW2Q3qxCWhDO2Ah7M1-dDilbJ3GQbYN0G9-lHZUrVYrZjBDpppo-yNqPCu5qg4MHDPZkMTN32Qkm4RCObXoXy3wkmrP0wS6OLisgCXMIM8h_AH1QiSq3iPGUOniyrvxrHo_crhUDQqwxOKPo1mt-CLqVd0uFGBMLl1fs4ncSP4QHxRb4YPgMPcl324u8v-mpBMMS4FoekCLC5yF_WvoqElPQFjv3143g1_Zu_9nMIa-TPF-SJEmzNGzrtK3SioZW2IHXw3A5RWetfuCGxJVxv-4lGpz3B5w2eJosldYs2PmM1JK8LBxD5uzg49MVjtWXPe4blP_XdE2d_vAgfJfi18gxjndc-4WrJhwHuLodbuS8ubZTGIrtuyLtHdgOMze-Y9eOk0_KAp1vDFBHkOOp4Rr7lrh1JQUcqRh4uwhHPdS9tWfjOPmT1uHdMTYLpk538h8XRRgzcgR7yoqqrMK-LtMsbxqWlcUyL3LGqoRlRUtz0ix5cSTLcKANdrrGdmH9hrKfXOLeWx323zbRi6fkBJLrLeDvLL8DtqGoSUxIXJE8ybMsSxcxzbM4T3NWLctyWZTBMuYnlLNwLBdKd6GeutiMnUHnIAw26-bEy8PdCdyTQXw62l7pGvWeJddt6MXVXtkfa6KNLg">