Mandatorily remove non-DefConst constants in HHIR
Summary:
In HHIR, a SSATmp can be a constant (hasConstVal() true), but it's
source is not a DefConst. An example would be a function call which is
known to return a constant.
We try to const-prop all of these non-DefConst constants. That is, any
instruction which takes one of these constants is changed instead to
take the DefConst equivalent. This is important, as a SSATmp constant
might not have any Vrefs defined (in the function call example, we
don't write to %rax if the return value is known). This can lead to
assertions being triggered.
The simplifier can perform this const-prop. However, it was failing to
retype dst SSATmp types, meaning it would miss some cases. Add a call
to retypeDests to fix this.
Also, in some situations we may not call the simplifier. In this case,
we still need to do this "mandatory propagation", so do so.
Reviewed By: oulgen
Differential Revision:
D30905689
fbshipit-source-id:
c1f35639950fb0bb926ad9b3b5d49e2ac3df177f