-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent offset access with block arrays to thwart dynamic ALA
Signed-off-by: Engin Kayraklioglu <[email protected]>
- Loading branch information
1 parent
c22e376
commit e4e661f
Showing
5 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use BlockDist; | ||
|
||
|
||
var Arr = blockDist.createArray(1..10, int); | ||
|
||
const Inner = Arr.domain.expand(-1); | ||
|
||
forall i in Arr.domain { // this should make Arr[i] a static candidate | ||
if i<10 then | ||
Arr[i] = // this must be a local access (9 total) | ||
Arr[i+1]; // this must be a default access (9 total) | ||
} | ||
|
||
writeln(Arr); | ||
|
||
forall i in Inner { // this should make Arr[i] a dynamic candidate | ||
Arr[i] = // this must be a local access (8 total) <- this was buggy | ||
Arr[i+1]; // this must be a default access (8 total) | ||
} | ||
|
||
writeln(Arr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-slogDistArrEltAccess=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
Start analyzing forall (blockWithOffset.chpl:8) | ||
| Found loop domain (blockWithOffset.chpl:4) | ||
| Will attempt static and dynamic optimizations (blockWithOffset.chpl:8) | ||
| | ||
| Start analyzing call (blockWithOffset.chpl:10) | ||
| Can optimize: Access base is the iterator's base (blockWithOffset.chpl:10) | ||
| This call is a static optimization candidate (blockWithOffset.chpl:10) | ||
| | ||
| Start analyzing call (blockWithOffset.chpl:11) | ||
| Call has offset(s), this will require dynamic check (blockWithOffset.chpl:11) | ||
| Can optimize: Access base is the iterator's base (blockWithOffset.chpl:11) | ||
| This call is a static optimization candidate (blockWithOffset.chpl:11) | ||
| | ||
End analyzing forall (blockWithOffset.chpl:8) | ||
|
||
|
||
Start analyzing forall (blockWithOffset.chpl:16) | ||
| Found loop domain (blockWithOffset.chpl:6) | ||
| Will attempt static and dynamic optimizations (blockWithOffset.chpl:16) | ||
| | ||
| Start analyzing call (blockWithOffset.chpl:17) | ||
| Can't determine the domain of access base (blockWithOffset.chpl:4) | ||
| This call is a dynamic optimization candidate (blockWithOffset.chpl:17) | ||
| | ||
| Start analyzing call (blockWithOffset.chpl:18) | ||
| Call has offset(s), this will require dynamic check (blockWithOffset.chpl:18) | ||
| Can't determine the domain of access base (blockWithOffset.chpl:4) | ||
| This call is a dynamic optimization candidate (blockWithOffset.chpl:18) | ||
| | ||
End analyzing forall (blockWithOffset.chpl:16) | ||
|
||
Static check successful. Using localAccess [static only ALA clone] (blockWithOffset.chpl:10) | ||
Static check failed. Reverting optimization [static only ALA clone] (blockWithOffset.chpl:11) | ||
Static check successful. Using localAccess with dynamic check (blockWithOffset.chpl:17) | ||
Static check failed. Reverting optimization [static and dynamic ALA clone] (blockWithOffset.chpl:18) | ||
0 0 0 0 0 0 0 0 0 0 | ||
0 0 0 0 0 0 0 0 0 0 | ||
|
||
Numbers collected by prediff: | ||
localAccess was called 17 times | ||
this was called 17 times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PREDIFF-filter-accessors |