[PATCH] D32783: [PartialInlining] Add frequency based cost analysis

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 11:07:28 PDT 2017


eraman added inline comments.


================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:23
 #include "llvm/Analysis/BranchProbabilityInfo.h"
+#include "llvm/Analysis/InlineCost.h"
 #include "llvm/Analysis/LoopInfo.h"
----------------
davidxl wrote:
> eraman wrote:
> > Why do you need this?
> for getCallsiteCost and getInlineCost interface.
I don't see any use of those interfaces in CodeExtractor.cpp. Am I missing something?


================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:754
                                                 header);
+  if (codeReplacerP)
+    *codeReplacerP = codeReplacer;
----------------
davidxl wrote:
> eraman wrote:
> > Why not grab the (only)user  to this function in unswitchFunction and get the basic block from there. It adds some overhead, but IMO is cleaner than this.
> can you clarify on this?
Something like cast<CallInst>(*F->user_begin())->getParent() in unswitchFunction should work right?


https://reviews.llvm.org/D32783





More information about the llvm-commits mailing list