Replace child expressions in-place.

        :param IRExpr expr:         The expression to look for.
        :param IRExpr replacement:  The expression to replace with.
        :return:                    None

def replace_expression(self, expr, replacement):
        """
        Replace child expressions in-place.

        :param IRExpr expr:         The expression to look for.
        :param IRExpr replacement:  The expression to replace with.
        :return:                    None
        """

        for k in self.__slots__:
            v = getattr(self, k)
            if v is expr:
                setattr(self, k, replacement)
            elif type(v) is list:
                # Replace the instance in the list
                for i, expr_ in enumerate(v):
                    if expr_ is expr:
                        v[i] = replacement
            elif type(v) is tuple:
                # Rebuild the tuple
                _lst = [ ]
                replaced = False
                for i, expr_ in enumerate(v):
                    if expr_ is expr:
                        _lst.append(replacement)
                        replaced = True
                    else:
                        _lst.append(expr_)
                if replaced:
                    setattr(self, k, tuple(_lst))
            elif isinstance(v, IRExpr):
                v.replace_expression(expr, replacement)