[PATCH] D48026: [ScopHelper] Provide support for recognising collective invariant loads

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 04:18:15 PDT 2018


philip.pfaffe added inline comments.


================
Comment at: lib/Support/ScopHelper.cpp:465
+
+      while (LoopCopy && R.contains(LoopCopy)) {
+        if (!SE.isLoopInvariant(PtrSCEV, LoopCopy)) {
----------------
This can be greatly simplified by calling `Loop::isLoopInvariant` for `Val` on the top-level-loop of the region, which you get from `Region::outermostLoopInRegion`. That makes this a one-liner.


https://reviews.llvm.org/D48026





More information about the llvm-commits mailing list