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

    <tr>
        <th>Summary</th>
        <td>
            IPSCCP crash if function return value has different size return value
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          jcranmer-intel
      </td>
    </tr>
</table>

<pre>
    Found via creduce, the following LLVM IR crashes with `opt -S -opaque-pointers -passes=ipsccp`:

```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
define dso_local i32 @b() {
entry:
  %call = call i64 (...) @a()
  ret i32 undef
}

; Function Attrs: nounwind uwtable
define internal i32 @a() {
entry:
  ret i32 undef
}
```

Assertion failure:
```
opt: llvm/lib/Transforms/Scalar/SCCP.cpp:322: void findReturnsToZap(llvm::Function&, llvm::SmallVector<llvm::ReturnInst*, 8>&, llvm::SCCPSolver&): Assertion `all_of(F.users(), [&Solver](User *U) { if (isa<Instruction>(U) && !Solver.isBlockExecutable(cast<Instruction>(U)->getParent())) return true; if (!isa<CallBase>(U)) return true; if (U->getType()->isStructTy()) { return all_of(Solver.getStructLatticeValueFor(U), [](const ValueLatticeElement &LV) { return !isOverdefined(LV); }); } return !isOverdefined(Solver.getLatticeValueFor(U)); }) && "We can only zap functions where all live users have a concrete value"' failed.
```

[I'd add the opaque-pointers label if I could, but this account doesn't have privileges to do so.]
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVUtv2zgQ_jXyhZDgULZkH3SwkxgIkMUGdZICewkocWSzpUktH07cX79DSrKbLpIeCggSRc7jm28erDU_VRvtFSdHwUhjgPsGEnpN3B5Iq6XUr0LtyP3981_k7gsKMLsHS16F25OkmOrOkXRLU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