[DSE] Don't dereference a dyn_cast<> result - use cast<> instead. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 8 Nov 2020 13:07:45 +0000 (13:07 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 8 Nov 2020 13:07:45 +0000 (13:07 +0000)
commitb11eaf561714969cc119bd7cdaf72bd8c5f56158
treeedc45ab3c8f4c26dce1f220bf3c85eb28d3dc332
parent8930032f53322405ca2d06cac78b9503542e5b62
[DSE] Don't dereference a dyn_cast<> result - use cast<> instead. NFCI.

We were relying on the dyn_cast<> succeeding - better use cast<> and have it assert that its the correct type than dereference a null result.
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp