Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c1e678b

Browse filesBrowse files
authored
[LAA] Improve code in replaceSymbolicStrideSCEV (NFC) (#139532)
Prefer DenseMap::lookup over DenseMap::find.
1 parent ed81a81 commit c1e678b
Copy full SHA for c1e678b

File tree

Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed

‎llvm/lib/Analysis/LoopAccessAnalysis.cpp

Copy file name to clipboardExpand all lines: llvm/lib/Analysis/LoopAccessAnalysis.cpp
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,11 @@ const SCEV *llvm::replaceSymbolicStrideSCEV(PredicatedScalarEvolution &PSE,
158158

159159
// If there is an entry in the map return the SCEV of the pointer with the
160160
// symbolic stride replaced by one.
161-
DenseMap<Value *, const SCEV *>::const_iterator SI = PtrToStride.find(Ptr);
162-
if (SI == PtrToStride.end())
161+
const SCEV *StrideSCEV = PtrToStride.lookup(Ptr);
162+
if (!StrideSCEV)
163163
// For a non-symbolic stride, just return the original expression.
164164
return OrigSCEV;
165165

166-
const SCEV *StrideSCEV = SI->second;
167166
// Note: This assert is both overly strong and overly weak. The actual
168167
// invariant here is that StrideSCEV should be loop invariant. The only
169168
// such invariant strides we happen to speculate right now are unknowns

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.