Page MenuHomePhabricator

[PowerPC] Fix parest build failure in SPEC2017.
ClosedPublic

Authored by jtony on Dec 19 2017, 12:27 PM.

Details

Summary

The build failure was caused by an assertion in pre-legalization DAGCombine:

llc: /home/jtony/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7232: void llvm::SelectionDAG::ReplaceAllUsesWith(llvm::SDNode*, llvm::SDNode*): Assertion `(!From->hasAnyUseOfValue(i) || From->getValueType(i) == To->getValueType(i)) && "Cannot use this version of ReplaceAllUsesWith!"' failed.

When it crashes, it is trying to do the following:

Combining: t6: ppcf128 = uint_to_fp t5
        ... into: t20: f32 = PPCISD::FCFIDUS t19

which is clearly wrong since ppcf128 are definitely different type with f32 and we cannot change the node value type when do DAGCombine. The fix is don't handle ppc_fp128 or i1 conversions in PPCTargetLowering::combineFPToIntToFP and leave it to downstream to legalize it and expand it to small legal types.

Tested with 3-stage bootstrap and LNT and SPEC2017, they are functionally clean.

Diff Detail

Repository
rL LLVM

Event Timeline

jtony created this revision.Dec 19 2017, 12:27 PM
jtony edited the summary of this revision. (Show Details)
jtony edited the summary of this revision. (Show Details)Dec 19 2017, 12:36 PM
hfinkel accepted this revision.Dec 20 2017, 8:17 PM

LGTM

This revision is now accepted and ready to land.Dec 20 2017, 8:17 PM
This revision was automatically updated to reflect the committed changes.