Movatterモバイル変換


[0]ホーム

URL:


Previous:, Up:Analysis and Representation of Loops   [Contents][Index]


15.8 Data Dependency Analysis

The code for the data dependence analysis can be found intree-data-ref.cc and its interface and data structures aredescribed intree-data-ref.h. The function that computes thedata dependences for all the array and pointer references for a givenloop iscompute_data_dependences_for_loop. This function iscurrently used by the linear loop transform and the vectorizationpasses. Before calling this function, one has to allocate two vectors:a first vector will contain the set of data references that arecontained in the analyzed loop body, and the second vector will containthe dependence relations between the data references. Thus if thevector of data references is of sizen, the vector containing thedependence relations will containn*n elements. However if theanalyzed loop contains side effects, such as calls that potentially caninterfere with the data references in the current analyzed loop, theanalysis stops while scanning the loop body for data references, andinserts a singlechrec_dont_know in the dependence relationarray.

The data references are discovered in a particular order during thescanning of the loop body: the loop body is analyzed in execution order,and the data references of each statement are pushed at the end of thedata reference array. Two data references syntactically occur in theprogram in the same order as in the array of data references. Thissyntactic order is important in some classical data dependence tests,and mapping this order to the elements of this array avoids costlyqueries to the loop body representation.

Three types of data references are currently handled: ARRAY_REF,INDIRECT_REF and COMPONENT_REF. The data structure for the data referenceisdata_reference, wheredata_reference_p is a name of apointer to the data reference structure. The structure contains thefollowing elements:

The structure describing the relation between two data references isdata_dependence_relation and the shorter name for a pointer tosuch a structure isddr_p. This structure contains:

Several functions for pretty printing the information extracted by thedata dependence analysis are available:dump_ddrs prints with amaximum verbosity the details of a data dependence relations array,dump_dist_dir_vectors prints only the classical distance anddirection vectors for a data dependence relations array, anddump_data_references prints the details of the data referencescontained in a data reference array.


Previous:Number of iterations analysis, Up:Analysis and Representation of Loops   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp