[PowerPC] Better fix for PR16556.
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 9 Jul 2013 18:50:20 +0000 (18:50 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 9 Jul 2013 18:50:20 +0000 (18:50 +0000)
commit7c2d8f7b5ea1d0abaed1176f87ea2509e65e82be
tree115281e3513a0a5ac93015ecd61dd04629136d23
parent36f6df78add32371df38266f02c2197a608f83ae
[PowerPC] Better fix for PR16556.

A more complete example of the bug in PR16556 was recently provided,
showing that the previous fix was not sufficient.  The previous fix is
reverted herein.

The real problem is that ReplaceNodeResults() uses LowerFP_TO_INT as
custom lowering for FP_TO_SINT during type legalization, without
checking whether the input type is handled by that routine.
LowerFP_TO_INT requires the input to be f32 or f64, so we fail when
the input is ppcf128.

I'm leaving the test case from the initial fix (r185821) in place, and
adding the new test as another crash-only check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185959 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/pr16556-2.ll [new file with mode: 0644]