[JumpThreading] Change asserts for WantInteger into actual checks
After e734e828, it is possible to end up in a situation where an `indirectbr` is fed by a cast, which is in turn fed by an operation which only produces integers. `indirectbr` expects a block address, however these operations can't produce that. There were several asserts in `computeValueKnownInPredecessorsImpl` which check that we're not looking for a block address if we're walking through something which can never produce one. Since it's now possible to hit these asserts, this changes them into actual checks which return false if `Preference` is not `WantInteger`. This adds a testcase which verifies that we don't crash anymore in these situations. Differential Revision: https://reviews.llvm.org/D99814
Loading
Please sign in to comment