# Changeset View

Changeset View

# Standalone View

Standalone View

# polly/trunk/include/polly/ScopBuilder.h

Show First 20 Lines • Show All 369 Lines • ▼ Show 20 Line(s) | 32 | class ScopBuilder { | |||
---|---|---|---|---|---|

370 | /// | 370 | /// | ||

371 | /// In the example below Bound[1] is required to be invariant: | 371 | /// In the example below Bound[1] is required to be invariant: | ||

372 | /// | 372 | /// | ||

373 | /// for (int i = 1; i < Bound[0]; i++) | 373 | /// for (int i = 1; i < Bound[0]; i++) | ||

374 | /// for (int j = 1; j < Bound[1]; j++) | 374 | /// for (int j = 1; j < Bound[1]; j++) | ||

375 | /// ... | 375 | /// ... | ||

376 | void verifyInvariantLoads(); | 376 | void verifyInvariantLoads(); | ||

377 | 377 | | |||

378 | /// Hoist invariant memory loads and check for required ones. | ||||

379 | /// | ||||

380 | /// We first identify "common" invariant loads, thus loads that are invariant | ||||

381 | /// and can be hoisted. Then we check if all required invariant loads have | ||||

382 | /// been identified as (common) invariant. A load is a required invariant load | ||||

383 | /// if it was assumed to be invariant during SCoP detection, e.g., to assume | ||||

384 | /// loop bounds to be affine or runtime alias checks to be placeable. In case | ||||

385 | /// a required invariant load was not identified as (common) invariant we will | ||||

386 | /// drop this SCoP. An example for both "common" as well as required invariant | ||||

387 | /// loads is given below: | ||||

388 | /// | ||||

389 | /// for (int i = 1; i < *LB[0]; i++) | ||||

390 | /// for (int j = 1; j < *LB[1]; j++) | ||||

391 | /// A[i][j] += A[0][0] + (*V); | ||||

392 | /// | ||||

393 | /// Common inv. loads: V, A[0][0], LB[0], LB[1] | ||||

394 | /// Required inv. loads: LB[0], LB[1], (V, if it may alias with A or LB) | ||||

395 | void hoistInvariantLoads(); | ||||

396 | | ||||

378 | /// Collect loads which might form a reduction chain with @p StoreMA. | 397 | /// Collect loads which might form a reduction chain with @p StoreMA. | ||

379 | /// | 398 | /// | ||

380 | /// Check if the stored value for @p StoreMA is a binary operator with one or | 399 | /// Check if the stored value for @p StoreMA is a binary operator with one or | ||

381 | /// two loads as operands. If the binary operand is commutative & associative, | 400 | /// two loads as operands. If the binary operand is commutative & associative, | ||

382 | /// used only once (by @p StoreMA) and its load operands are also used only | 401 | /// used only once (by @p StoreMA) and its load operands are also used only | ||

383 | /// once, we have found a possible reduction chain. It starts at an operand | 402 | /// once, we have found a possible reduction chain. It starts at an operand | ||

384 | /// load and includes the binary operator and @p StoreMA. | 403 | /// load and includes the binary operator and @p StoreMA. | ||

385 | /// | 404 | /// | ||

▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |