[IVDescriptors] Add assert to isInductionPhi to check for invalid Phis
authorVedant Paranjape <vedant.paranjape@amd.com>
Mon, 24 Apr 2023 06:20:12 +0000 (06:20 +0000)
committerVedant Paranjape <vedant.paranjape@amd.com>
Fri, 28 Apr 2023 04:41:47 +0000 (04:41 +0000)
commitcf9b3e55a21368cc10b4db7a83b188ee86430f87
tree6eabe6f6908b2e6d5a084577330e44289a7757c3
parent03ad9d1be31202d6c83b507eb991d57ba62c2ca3
[IVDescriptors] Add assert to isInductionPhi to check for invalid Phis

Phis that are present inside loop headers can only be Induction Phis
legally. This patch adds an assertion to isInductionPhi which checks for
the said legality and it also updates the docs of the said function to
reflect the given legality.

Differential Revision: https://reviews.llvm.org/D149041
llvm/include/llvm/Analysis/IVDescriptors.h
llvm/lib/Analysis/IVDescriptors.cpp