This is an archive of the discontinued LLVM Phabricator instance.

[PPC] Avoid incorrect fp-i128-fp lowering.
ClosedPublic

Authored by timshen on Jan 22 2018, 5:05 PM.

Details

Summary

Fix an issue that's similar to what D41411 fixed:

float(__int128(float_var)) shouldn't be optimized to xscvdpsxds +
xscvsxdsp, as they mean (float)(int64_t)float_var.

Diff Detail

Repository
rL LLVM

Event Timeline

timshen created this revision.Jan 22 2018, 5:05 PM
jtony added inline comments.Jan 23 2018, 11:55 AM
llvm/test/CodeGen/PowerPC/fp-int128-fp-combine.ll
1 ↗(On Diff #130988)

Can we explicitly put CHECK-NOT for the `xscvdpsxds +
xscvsxdsp` instructions we were generating before in this test case to avoid regression?
Other than that, the patch LGTM.

timshen added inline comments.Jan 23 2018, 12:37 PM
llvm/test/CodeGen/PowerPC/fp-int128-fp-combine.ll
1 ↗(On Diff #130988)

IIRC update_llc_test_checks.py will remove old CHECKs and re-insert its own CHECKs.

I think with the current line-by-line CHECK-NEXTs, it effectively prevents xscvdpsxds and xscvsxdsp from creeping in.

echristo accepted this revision.Jan 23 2018, 12:40 PM
echristo added inline comments.
llvm/test/CodeGen/PowerPC/fp-int128-fp-combine.ll
1 ↗(On Diff #130988)

It does. And you've got a comment as well so that if it breaks when updating people know what to look for.

With that said, I'm good with this as well. Let's let jtony also ack though since he did the main review.

This revision is now accepted and ready to land.Jan 23 2018, 12:40 PM
jtony accepted this revision.Jan 23 2018, 1:00 PM
jtony added inline comments.
llvm/test/CodeGen/PowerPC/fp-int128-fp-combine.ll
1 ↗(On Diff #130988)

Sound good to me.

This revision was automatically updated to reflect the committed changes.