[PATCH] D39137: Add CallSiteSplitting pass

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 15:50:32 PDT 2017


davidxl added inline comments.


================
Comment at: lib/Transforms/Scalar/CallSiteSplitting.cpp:103
+static bool createCallSitesOnOrPredicatedArgument(
+    CallSite CS, Instruction *&NewCSTakendFromHeader,
+    Instruction *&NewCSTakenFromNextCond,
----------------
Takend --> Taken


================
Comment at: lib/Transforms/Scalar/CallSiteSplitting.cpp:408
+  if (!findPredicatedArgument(CS, CallInst1, CallInst2, PredBB1, PredBB2))
+    return false;
+
----------------
Assert CallIInst1 and CallInst2 are null here before return false.


================
Comment at: lib/Transforms/Scalar/CallSiteSplitting.cpp:410
+
+  if (!splitCallSite(CS, PredBB1, PredBB2, CallInst1, CallInst2)) {
+    if (CallInst1)
----------------
It seems better to not to speculatively clone the call instructions and delete them later when not needed.  The analysis function should instead return 'clone' records indicating how to do the cloning during the transformation phase.


https://reviews.llvm.org/D39137





More information about the llvm-commits mailing list