[PATCH] D50426: [NFC][MustExecute] Rework API to start making better analysis

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 12 12:47:06 PDT 2018


fedor.sergeev added inline comments.


================
Comment at: include/llvm/Analysis/MustExecute.h:57
 
-/// Computes safety information for a loop checks loop body & header for
-/// the possibility of may throw exception, it takes LoopSafetyInfo and loop as
-/// argument. Updates safety information in LoopSafetyInfo argument.
-/// Note: This is defined to clear and reinitialize an already initialized
-/// LoopSafetyInfo.  Some callers rely on this fact.
-void computeLoopSafetyInfo(LoopSafetyInfo *, Loop *);
+  void reset(Loop *L);
+
----------------
reames wrote:
> Move the previous comment from computeLoopSafeyInfo to here with appropriate editing.  
Just 'reset' seems to be somewhat misleading.
I would still prefer to see this function having 'compute' in its name, since it does nontrivial amount of work.
Besides everything else it does a call to colorEHFunclets which has a comment - "Consider this analysis to be expensive".



================
Comment at: lib/Analysis/MustExecute.cpp:33
+
+/// Returns true if any loop in the current loop contains an instruction that
+/// may throw or otherwise exit abnormally.
----------------
typo: any **block** in the current loop


https://reviews.llvm.org/D50426





More information about the llvm-commits mailing list