aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-06-10 15:07:50 +0200
committerMagnus Lång <[email protected]>2016-09-02 15:59:16 +0200
commitde2c03130f404a4849078b22371a9dae07abeed8 (patch)
treee35e0ece512862da00279c7b470f121b1031c591 /lib
parente7ee6da98b31531029252f6aa7bbd07ccaaca37b (diff)
downloadotp-de2c03130f404a4849078b22371a9dae07abeed8.tar.gz
otp-de2c03130f404a4849078b22371a9dae07abeed8.tar.bz2
otp-de2c03130f404a4849078b22371a9dae07abeed8.zip
hipe_x86: Simplify ra_postconditions is_mem_opnd
This is due to the improvements in hipe_temp_map, removing the need for duplicated logic in the backends.
Diffstat (limited to 'lib')
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl15
-rw-r--r--lib/hipe/x86/hipe_x86_ra_postconditions.erl28
2 files changed, 13 insertions, 30 deletions
diff --git a/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl b/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
index bbf9170bc3..a8b22595d1 100644
--- a/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
@@ -119,17 +119,12 @@ is_mem_opnd(Opnd, TempMap) ->
#x86_temp{type=double} ->
Reg = hipe_x86:temp_reg(Opnd),
case hipe_x86:temp_is_allocatable(Opnd) of
- true ->
- case tuple_size(TempMap) > Reg of
+ true ->
+ case hipe_temp_map:is_spilled(Reg, TempMap) of
true ->
- case
- hipe_temp_map:is_spilled(Reg, TempMap) of
- true ->
- ?count_temp(Reg),
- true;
- false -> false
- end;
- _ -> false
+ ?count_temp(Reg),
+ true;
+ false -> false
end;
false -> true
end;
diff --git a/lib/hipe/x86/hipe_x86_ra_postconditions.erl b/lib/hipe/x86/hipe_x86_ra_postconditions.erl
index c245fb86b6..e99746a214 100644
--- a/lib/hipe/x86/hipe_x86_ra_postconditions.erl
+++ b/lib/hipe/x86/hipe_x86_ra_postconditions.erl
@@ -389,19 +389,12 @@ is_mem_opnd(Opnd, TempMap) ->
Reg = hipe_x86:temp_reg(Opnd),
case hipe_x86:temp_is_allocatable(Opnd) of
true ->
- case tuple_size(TempMap) > Reg of
+ case
+ hipe_temp_map:is_spilled(Reg, TempMap) of
true ->
- case
- hipe_temp_map:is_spilled(Reg, TempMap) of
- true ->
- ?count_temp(Reg),
- true;
- false -> false
- end;
- _ ->
- %% impossible, but was true in ls post and false in normal post
- exit({?MODULE,is_mem_opnd,Reg}),
- false
+ ?count_temp(Reg),
+ true;
+ false -> false
end;
false -> true
end;
@@ -416,15 +409,10 @@ is_spilled(Temp, TempMap) ->
case hipe_x86:temp_is_allocatable(Temp) of
true ->
Reg = hipe_x86:temp_reg(Temp),
- case tuple_size(TempMap) > Reg of
+ case hipe_temp_map:is_spilled(Reg, TempMap) of
true ->
- case hipe_temp_map:is_spilled(Reg, TempMap) of
- true ->
- ?count_temp(Reg),
- true;
- false ->
- false
- end;
+ ?count_temp(Reg),
+ true;
false ->
false
end;