On 32-bit PPC target[AIX and BE], when we convert an i64 to f32, a setcc operand expansion is needed. The expansion will set the result type of expanded setcc operation based on if the subtarget use CRBits or not. If the subtarget does use the CRBits, like AIX and BE, then it will set the result type to i1, leading to an inconsistency with original setcc result type[i32].
And the reason why it crashed underneath is because we don't set result type of setcc consistent in those two places.
This patch fixes this problem by setting original setcc opnode result type also with getSetCCResultType interface.
You are on the right track but I think getSetCCResultType is the interface we want to use to get the proper result type. FWIW it will be the same behavior but somewhat self documenting.