~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/hipe/rtl/hipe_rtl_ssa_const_prop.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (1.1.13 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: james.westby@ubuntu.com-20090215164252-dxpjjuq108nz4noa
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
-define(CFG,  hipe_rtl_cfg).
75
75
-include("../ssa/hipe_ssa_const_prop.inc").
76
76
 
77
 
-type(bool_lattice() :: 'true' | 'false' | 'top' | 'bottom').
78
 
-type(conditional()  :: 'eq' | 'ne' | 'ge' | 'geu' | 'gt' | 'gtu' | 'le'
79
 
                      | 'leu' | 'lt' | 'ltu' | 'overflow' | 'not_overflow').
 
77
-type bool_lattice() :: 'true' | 'false' | 'top' | 'bottom'.
 
78
-type conditional()  :: 'eq' | 'ne' | 'ge' | 'geu' | 'gt' | 'gtu' | 'le'
 
79
                      | 'leu' | 'lt' | 'ltu' | 'overflow' | 'not_overflow'.
80
80
 
81
81
%%-----------------------------------------------------------------------------
82
82
%% Procedure : visit_expression/2
85
85
%%             instruction.
86
86
%% Arguments : Instructions - the instruction
87
87
%%             Environment  - have a guess.
88
 
%% Returns   : { FlowWorkList, SSAWorkList, Environment} 
 
88
%% Returns   : {FlowWorkList, SSAWorkList, Environment}
89
89
%%-----------------------------------------------------------------------------
90
90
visit_expression(Instruction, Environment) ->
91
91
  case Instruction of
382
382
maybe_top_or_bottom([bottom | _], _) -> bottom;
383
383
maybe_top_or_bottom([_ | Rest],  TB) -> maybe_top_or_bottom(Rest, TB).
384
384
 
385
 
-spec(partial_eval_branch/5 :: (conditional(), bool_lattice(), bool_lattice(),
386
 
                                bool_lattice() | 0, bool_lattice() | 0) ->
387
 
         bool_lattice()).
 
385
-spec partial_eval_branch(conditional(), bool_lattice(), bool_lattice(),
 
386
                          bool_lattice() | 0, bool_lattice() | 0) ->
 
387
         bool_lattice().
388
388
partial_eval_branch(Cond, N0, Z0, V0, C0) ->
389
389
  {N, Z, V, C} =
390
390
    if Cond =:= 'eq';