[PATCH] [LoopInterchange] Add support to interchange loops with reductions.
Renato Golin
renato.golin at linaro.org
Wed Apr 15 02:58:09 PDT 2015
Hi Karthik,
Copying the vectorizer's reduction detection here is not the way forward. Please, refactor the detection part into a generic function.
My initial guess would be to create a vectorizer common library in lib/Transforms/Utils and move the reduction detection in there, like the other loop utilities, and get the vectorizer and your pass to use that.
cheers,
--renato
================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:104
@@ -103,3 +104,2 @@
}
-
DEBUG(dbgs() << "Found " << MemInstr.size()
----------------
avoid white space/empty line changes with code changes.
================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:373
@@ +372,3 @@
+// TODO: Major parts of isReductionPHI is similar to that used by Loop
+// Vectorizer. Try to refactor this code.
+static bool isReductionPHI(PHINode *Phi, Loop *TheLoop) {
----------------
I don't think we should add this code here, not even with a TODO to refactor this, because this TODO will never be done.
http://reviews.llvm.org/D8314
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list