@@ -1773,40 +1773,39 @@ void Scop::removeStmts(function_ref<bool(ScopStmt &)> ShouldDelete,
1773
1773
}
1774
1774
1775
1775
void Scop::removeStmtNotInDomainMap () {
1776
- auto ShouldDelete = [this ](ScopStmt &Stmt) -> bool {
1776
+ removeStmts ( [this ](ScopStmt &Stmt) -> bool {
1777
1777
isl::set Domain = DomainMap.lookup (Stmt.getEntryBlock ());
1778
1778
if (!Domain)
1779
1779
return true ;
1780
1780
return Domain.is_empty ();
1781
- };
1782
- removeStmts (ShouldDelete, false );
1781
+ });
1783
1782
}
1784
1783
1785
1784
void Scop::simplifySCoP (bool AfterHoisting) {
1786
- auto ShouldDelete = [AfterHoisting](ScopStmt &Stmt) -> bool {
1787
- // Never delete statements that contain calls to debug functions.
1788
- if ( hasDebugCall (&Stmt))
1789
- return false ;
1790
-
1791
- bool RemoveStmt = Stmt. isEmpty ();
1792
-
1793
- // Remove read only statements only after invariant load hoisting.
1794
- if (!RemoveStmt && AfterHoisting) {
1795
- bool OnlyRead = true ;
1796
- for (MemoryAccess *MA : Stmt) {
1797
- if (MA-> isRead ())
1798
- continue ;
1799
-
1800
- OnlyRead = false ;
1801
- break ;
1802
- }
1803
-
1804
- RemoveStmt = OnlyRead;
1805
- }
1806
- return RemoveStmt;
1807
- } ;
1808
-
1809
- removeStmts (ShouldDelete, AfterHoisting);
1785
+ removeStmts (
1786
+ [AfterHoisting](ScopStmt &Stmt) -> bool {
1787
+ // Never delete statements that contain calls to debug functions.
1788
+ if ( hasDebugCall (&Stmt))
1789
+ return false ;
1790
+
1791
+ bool RemoveStmt = Stmt. isEmpty ();
1792
+
1793
+ // Remove read only statements only after invariant load hoisting.
1794
+ if (!RemoveStmt && AfterHoisting) {
1795
+ bool OnlyRead = true ;
1796
+ for (MemoryAccess *MA : Stmt) {
1797
+ if (MA-> isRead ())
1798
+ continue ;
1799
+
1800
+ OnlyRead = false ;
1801
+ break ;
1802
+ }
1803
+
1804
+ RemoveStmt = OnlyRead;
1805
+ }
1806
+ return RemoveStmt ;
1807
+ },
1808
+ AfterHoisting);
1810
1809
}
1811
1810
1812
1811
InvariantEquivClassTy *Scop::lookupInvariantEquivClass (Value *Val) {
0 commit comments