-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[LAA] Keep pointer checks on partial analysis #139719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
babdff1
6dc3239
686b462
d78421a
be7173d
5da2cc9
a77c6f9
32dcdac
2b02a5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -529,8 +529,10 @@ void RuntimePointerChecking::groupChecks( | |
| // equivalence class, the iteration order is deterministic. | ||
| for (auto M : DepCands.members(Access)) { | ||
| auto PointerI = PositionMap.find(M.getPointer()); | ||
| assert(PointerI != PositionMap.end() && | ||
| "pointer in equivalence class not found in PositionMap"); | ||
| // If we can't find the pointer in PositionMap that means we can't | ||
| // generate a memcheck for it. | ||
| if (PointerI == PositionMap.end()) | ||
| continue; | ||
| for (unsigned Pointer : PointerI->second) { | ||
| bool Merged = false; | ||
| // Mark this pointer as seen. | ||
|
|
@@ -682,7 +684,9 @@ class AccessAnalysis { | |
| /// non-intersection. | ||
| /// | ||
| /// Returns true if we need no check or if we do and we can generate them | ||
| /// (i.e. the pointers have computable bounds). | ||
| /// (i.e. the pointers have computable bounds). A return value of false means | ||
| /// we couldn't analyze and generate runtime checks for all pointers in the | ||
| /// loop, but we will have checks for those pointers we could analyze. | ||
| bool canCheckPtrAtRT(RuntimePointerChecking &RtCheck, ScalarEvolution *SE, | ||
| Loop *TheLoop, | ||
| const DenseMap<Value *, const SCEV *> &Strides, | ||
|
|
@@ -1273,7 +1277,6 @@ bool AccessAnalysis::canCheckPtrAtRT( | |
| /*Assume=*/true)) { | ||
| CanDoAliasSetRT = false; | ||
| UncomputablePtr = Access.getPointer(); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -1313,7 +1316,7 @@ bool AccessAnalysis::canCheckPtrAtRT( | |
| } | ||
| } | ||
|
|
||
| if (MayNeedRTCheck && CanDoRT) | ||
| if (MayNeedRTCheck) | ||
artagnon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| RtCheck.generateChecks(DepCands, IsDepCheckNeeded); | ||
|
|
||
| LLVM_DEBUG(dbgs() << "LAA: We need to do " << RtCheck.getNumberOfChecks() | ||
|
|
@@ -1323,11 +1326,7 @@ bool AccessAnalysis::canCheckPtrAtRT( | |
| // are needed. This can happen when all pointers point to the same underlying | ||
| // object for example. | ||
| RtCheck.Need = CanDoRT ? RtCheck.getNumberOfChecks() != 0 : MayNeedRTCheck; | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stray newline strip? |
||
| bool CanDoRTIfNeeded = !RtCheck.Need || CanDoRT; | ||
| if (!CanDoRTIfNeeded) | ||
| RtCheck.reset(); | ||
| return CanDoRTIfNeeded; | ||
| return !RtCheck.Need || CanDoRT; | ||
| } | ||
|
|
||
| void AccessAnalysis::processMemAccesses() { | ||
|
|
@@ -3002,6 +3001,8 @@ void LoopAccessInfo::print(raw_ostream &OS, unsigned Depth) const { | |
|
|
||
| // List the pair of accesses need run-time checks to prove independence. | ||
| PtrRtChecking->print(OS, Depth); | ||
| if (PtrRtChecking->Need && !CanVecMem) | ||
|
||
| OS.indent(Depth) << "Generated run-time checks are incomplete\n"; | ||
| OS << "\n"; | ||
|
|
||
| OS.indent(Depth) | ||
|
|
||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... if \p AllowPartial is set?