[PATCH] D35570: [ORE] Port TailRecursionElimination to the new API

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 13:18:18 PDT 2017


davide added inline comments.


================
Comment at: lib/Transforms/Scalar/TailRecursionElimination.cpp:70
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/IR/Function.h"
----------------
anemet wrote:
> Remove this?
Which one in particular? The build fails without `OptimizationDiagnosticInfo.h` included.


================
Comment at: lib/Transforms/Scalar/TailRecursionElimination.cpp:305
+      // using namespace ore;
+      ORE->emit(OptimizationRemark(DEBUG_TYPE, "tailcallelim", CI)
+               << "marked as tail call candidate");
----------------
anemet wrote:
> It's up to you but you may want to differentiate the remarks by name (i.e. not use the same "tailcalelim" name).  It's easier to do stats, etc.
What do you mean exactly? Change the second parameter to be an unique identifier *within* the same file? 
e.g. "tailcallelim" vs "tailcallreadnone"?
Fine, but please note that in this case it's less interesting as we're always applying the same transformation (i.e. set TailCall()).
In other passes, e.g. Value Numbering it may have more sense as we perform different kind of xforms (e.g. instruction removal, moving etc..)


https://reviews.llvm.org/D35570





More information about the llvm-commits mailing list