Hi, All

Can gatekeepers help review this patch?

When apply option -OPT:alias=field_sensitive -IPA:preopt=on, compiler will
assert in NystromAliasAnalyzer.
NystromAliasAnalyzer assumes it is in be phase and try to get the IPA
constraint graph summary from IR file.

To enable nystrom alias analyzer works with pre_optimizer in IPA phase need
create
NystromAliasAnalyze from global contraint graph and IPA Node's local
constraint graph.

This patch is:
1. Create NystromAliasAnalyzer for PU in IPA phase.
2. Provide alias query interface for WN nodes or alias tags in different PU.

Key decision is only use one NystromAliasAnalyzer instance in IPA phase.
1. Multiple PU's alias tag in one alias tag space.1
   1. Ease alias query, if same alias tag for WN node in different, they are
aliased.
   2. Ease alias query cache. NystromAliasAnalyzer cache alias query result,
key is
      alias tag pair. If create one NystromAliasAnalyzer for each PU. It's
complex to
      cache qurey of alias tags from different PU.
   3. Save space for alias tag's points_to set .
      In different PU, there is alias tags that their points_to set is
euqivalent.
      For example, actual and formal paramters' points to set is same.
      Only use one copy points to set can save memory.
2. AliasAnalyzer::aliasAnalyzer() is a static method.
   Current code assumes only one alias analyzer instance.

Implementation:
Add globals:
1. Alias_Analyzer_in_IPA
   set true in IPA_Preoptimize when Alias_Nystrom_Analyzer is on.
2. Current_IPANode_File_PU_Idx
   current IPA node's file PU index in IPA_Preoptimize.

In aliasAnalyzer
Add following fields
1. IPAWNAliasTagMap _IPAAliasTageMap;  map WN node to its alias tag.
             Key is UINT64, (IPA Node file_pu_idx << 32) | wn_map_id
2. bool _ipaMode;   indicate if NystromAliasAnalyzer is created in IPA phase
3. UINT32 _curFilePUIdx;   // current processing IPA node's file and PU
index

Update AliasAnalyzer::Create_Alias_Analyzer(ALIAS_CONTEXT &ac, WN *tree)
if Alias_Analyzer_in_IPA, set _ipaMode true and set _curFilePUIdx.

Update interface
void setAliasTag(WN *wn, AliasTag tag)
AliasTag getAliasTag(const WN *wn) const
to
void setAliasTag(WN *wn, AliasTag tag, UINT32 filePUIdx=UINT32_MAX)
AliasTag getAliasTag(const WN *wn, UINT32 filePUIdx=UINT32_MAX) const
In _ipaMode, compose filePUIdx with wn_map_id as key, find or set alias tag
map.

In NystromAliasAnalyzer
Add new constructor NystromAliasAnalyzer::NystromAliasAnalyzer
only set _ipaMode is true.
Not build constraint graph or create alias tag.

Update NystromAliasAnalyzer::genAliasTag(ST *st, INT64 offset, INT64 size,
bool direct)
When getting St_Info for ST.
1. If ipaMode and St is global, search St_Info in IPA global constraint
graph.
2. If ipaMode and St is local st, search St_Info in local constriant graph,
key is
   File PU idx + ST idx
3. Not in ipaMode, search in local constraint graph, key is ST idx.

In ConstraintGraph
Add static ConstraintGraph *currentIPANodeConstraintGraph;
Pass current processing IPA node's constraint graph from IPA_Preoptimize.
Used in AliasAnalyzer::Create_Alias_Analyzer, if in IPA phase, set current
constraint graph with currentIPANodeConstraintGraph.

Add bool _uniqueMapped; set true when current constraint graph is processed
by
IPA_NystromAliasAnalyzer::mapWNToUniqCallSiteCGNodeId.

IPA_NystromAliasAnalyzer::mapWNToUniqCallSiteCGNodeId currently only called
before
write IPA nystrom alias info into IR file.
It is also needed called before create alias tag in IPA_preoptimize.
Use this flag to avoid map twice.

Regards
Shi Hui

Attachment: nystrom_ipa_preopt.patch
Description: Binary data

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to