This is to avoid unnecessary traversals of the IR. Differential Revision: https://reviews.llvm.org/D143408