[ScalarEvolution] Factor out RewriteMap utilities in applyLoopGuards (NFC)
This factors out two utilities used with RewriteMap in applyLoopGuards: - AddRewrite, which puts a rewrite rule in the map and if needed registers the rewrite in the list of rewritten expressions, - GetMaybeRewritten, which checks whether an expression has already been rewritten, and if so, returns the rewrite. Otherwise, returns the given expression. This may be needed when adding new rewrite rules as not to copy-paste this code.
Loading
Please sign in to comment