This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

integrated immediate uses - alpha patch


OK, here's the mythical patch for integrated immediate_uses. It
bootstraps and is based off the immuse-rewrite-branch where I have
checked it in..

There is much more followup work to be done, but this is the most
difficult initial part.

The rewrite branch was updated to mainline as of last thursday or
friday,. so there likely isnt a whole lot different right now.

The interface is quite simple, there are two macros:

FOR_EACH_IMM_USE_FAST (use_p, iter, ssa_var)
  {
  }

    and

FOR_EACH_IMM_USE_SAFE (use_p, iter, ssa_var)
  {
  }

The only difference is that the SAFE loop allows you to delete and
modify stmts, its just a bit slower because it links a guard into the
list and moves the guard along as you iterate thorugh the list.  The
presence of the guard requires you to use 

    BREAK_FROM_SAFE_IMM_USE(iter);

instead of 

    break;  

when you wish to exit the loop early, otherwise the guard will remain
linked in. If the loop finishes its natural progression to the end on
its own, it will automatically remove the guard node.  THere are no such
issues with thr FAST loop, just dont try deletiung anything.

And once you do a SET_USE, or update_stmt(), or bsi_remove() or
something like that, forget about using the use_p variable. You've
invalidated it since the use you were pointing to may not even exist any
more.  Its a one shot deal for modifications.


The 3 parameters are:
  use_operand_p use_p 	: A use pointer for each immediate use of ssa_var.
  imm_use_iterator iter	: the iterator structure
  tree ssa_var		: The SSA variable you want the immediate uses of.


Another change is that modify_stmt is being replaced. It exists in a few
places right now, but many places have been replaced with 

  update_stmt()

  which is the equivilent of 

    modify_stmt() ;
    get_stmt_operands();


In order for immediate uses to be accurate, all the stmt must be up to
date, so verify_ssa now checks that there are no modified stmts at the
end of a pass.


Im sure there are a few other tidbits, but thats the gist of it.

This patch is by no means ready for primetime, there are cleanups yet to
be done, the conversion to update_stmt is not finished, redundant
get_stmt_operand() calsl have not bene removed, and its not as
bulletproof as I intend to get it.

but it fundamentally works for now, and others wanted to be able to fool
with the interface, so here is the current snapshot. (there isnt even a
changelog :-)


Overall compilation time is typically a little bit slower, somewhere in
the ballpark of 3% or so. There is pending operand work which should
remove that when I am done. I ran tramp3d to check memory usage.. user
time was up about 3%, but overall run time was down 2% presumably due to
the improved memory situation:

Mainline report:
Total allocations and overheads during the compilation process
Total Overhead:                         224747369
Total Allocated:                       1600543224

immuse patch report:
Total allocations and overheads during the compilation process
Total Overhead:                         159146391
Total Allocated:                       1443969316


so total memory usage is down.

Anyway, this is what there is right now for those that wanted a
snapshot. It bootstraps and shows no regressions on x86-linux. 


Andrew


Attachment: immuse-alpha.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]