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

    <tr>
        <th>Summary</th>
        <td>
            UpgradeIntrinsicCall asserts on intrinsic use with wrong declared type
        </td>
    </tr>

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

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

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

<pre>
    This example crashes in the autoupgrader

```
; RUN: llvm-as -disable-output %s

define { fp128, i32 } @misdeclared_intrinsic_crash(fp128 %a)  {
  %result = call { fp128, i32 } @llvm.frexp.fp128.i32(fp128 %a)
  ret { fp128, i32 } %result
}

declare { double, i32 } @llvm.frexp.fp128.i32(double)

```

```
/Users/matt/src/llvm-project/build_rel_with_debinfo/bin/llvm-as -disable-output /Users/matt/src/llvm-project/llvm/test/Bitcode/parser-crash.ll # RUN: at line 1
+ /Users/matt/src/llvm-project/build_rel_with_debinfo/bin/llvm-as -disable-output /Users/matt/src/llvm-project/llvm/test/Bitcode/parser-crash.ll
Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"), function init, file Instructions.cpp, line 761.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /Users/matt/src/llvm-project/build_rel_with_debinfo/bin/llvm-as -disable-output /Users/matt/src/llvm-project/llvm/test/Bitcode/parser-crash.ll
 #0 0x0000000102e48348 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/matt/src/llvm-project/build_rel_with_debinfo/bin/llvm-as+0x10021c348)
 ```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUVU1v4zYQ_TX0ZRCBoixLPugg2zGwQLEIusnZGIkjmV2KEvixif99QdpuimAXCIoeWkMHkzN8w3nzZojOqdEQNazcs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