[PATCH] D33316: [SCEV] Do not fold dominated SCEVUnknown into AddRecExpr start

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 17:04:23 PDT 2017


sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.

lgtm with a minor nit



================
Comment at: lib/Analysis/ScalarEvolution.cpp:2182
+/// Determine if the SCEV depends on a SCEVUnknown of an instruction which is
+/// dominated by the header of loop L.
+static bool hasDominatedSCEVUnknown(const SCEV *S, const Loop *L,
----------------
Instead of `hasDominatedSCEVUnknown`, I'd call this `isAvailableAtLoopEntry`, negate the return value and push the `isLoopInvariant` into this this function.  This seems more more semantic -- we're interested in knowing if a SCEV expression can possibly be computed at `L` 's preheader.  You can then shift the comment about invariants (paraphrased as needed) into this function.



https://reviews.llvm.org/D33316





More information about the llvm-commits mailing list