[PowerPC32] Fix the `setcc` inconsistent result type problem
authorXiangling Liao <Xiangling.Liao@ibm.com>
Wed, 11 Mar 2020 20:16:27 +0000 (16:16 -0400)
committerDavid Tenty <daltenty@ibm.com>
Thu, 12 Mar 2020 14:50:37 +0000 (10:50 -0400)
commit3e53bf5781e01784dedb7885867f39d09201ec88
tree59c5da5f2e59803e6f84ff200ce62612b2e5c001
parentc8e1081da628d941abdab121a6949b6d5daf9f68
[PowerPC32] Fix the `setcc` inconsistent result type problem

Summary:
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.

Reviewers: sfertile, cebowleratibm, hubert.reinterpretcast, Xiangling_L

Reviewed By: sfertile

Subscribers: wuzish, nemanjai, hiraditya, kbarton, jsji, shchenz, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75702
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/ppc32-i64-to-float-conv.ll [new file with mode: 0644]