[PATCH] [LAA] Fix estimation of number of memchecks
Adam Nemet
anemet at apple.com
Wed Jun 3 17:37:14 PDT 2015
With this change I don't think there is a reason to cache NumComparisons anymore. What do you think?
Specifically I mean:
================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:390-392
@@ -385,5 +389,5 @@
/// \brief Number of memchecks required to prove independence of otherwise
/// may-alias pointers.
unsigned getNumRuntimePointerChecks() const { return NumComparisons; }
----------------
I think that this guy should now forward to getNumberOfChecks() and probably take a partition (by default nullptr) parameter.
================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:467-469
@@ -462,5 +466,5 @@
/// \brief Number of memchecks required to prove independence of otherwise
/// may-alias pointers
unsigned NumComparisons;
----------------
To avoid confusion we should probably remove this.
================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:228-234
@@ -221,8 +227,9 @@
/// \brief Check whether we can check the pointers at runtime for
- /// non-intersection.
+ /// non-intersection. Returns true when we have 0 pointers
+ /// (a check on 0 pointers for non-intersection will always return true).
bool canCheckPtrAtRT(LoopAccessInfo::RuntimePointerCheck &RtCheck,
unsigned &NumComparisons, ScalarEvolution *SE,
Loop *TheLoop, const ValueToValueMap &Strides,
bool ShouldCheckStride = false);
----------------
I don't think there is a reason for this function to return NumComparisons now. It should probably return NeedRTCheck instead (used in the caller).
http://reviews.llvm.org/D10217
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list