HomePhabricator

[SelectionDAG] Get rid of recursion in findNonImmUse

Description

[SelectionDAG] Get rid of recursion in findNonImmUse

The recursive implementation of findNonImmUse may overflow stack
on extremely long use chains. This patch replaces it with an equivalent
iterative implementation.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D33775