This is an archive of the discontinued LLVM Phabricator instance.

PR20778: [SelectionDAG] Teach the vector scalarizer about FP conversions.
ClosedPublic

Authored by ab on Oct 15 2014, 3:44 PM.

Details

Summary

[SelectionDAG] Teach the vector scalarizer about FP conversions.

This adds support for legalization of instructions of the form:

[fp_conv] <1 x i1> %op to <1 x double>

where fp_conv is one of fpto[us]i, [us]itofp. This used to assert
because they were simply missing from the vector operand scalarizer.

A similar problem arose in r190830, with trunc instead.

Also, fix typos in comment and assert message (separate commit).

Diff Detail

Repository
rL LLVM

Event Timeline

ab updated this revision to Diff 14968.Oct 15 2014, 3:44 PM
ab retitled this revision from to PR20778: [SelectionDAG] Teach the vector scalarizer about FP conversions..
ab updated this object.
ab edited the test plan for this revision. (Show Details)
ab set the repository for this revision to rL LLVM.
ab added a subscriber: Unknown Object (MLST).
arsenm added a subscriber: arsenm.Oct 15 2014, 3:51 PM

The test isn't really accomplishing anything by using FileCheck. It should either add check lines for the conversions, or not use FileCheck

ab added a comment.Oct 15 2014, 4:27 PM

Right. The output doesn't really matter, so removing FileCheck altogether. Thanks!

-Ahmed

ab updated this revision to Diff 14970.Oct 15 2014, 4:31 PM

Don't use FileCheck: we aren't testing the codegen of the operations, but the fact that they're scalarized correctly.

FWIW you should probably add some lines for the instruction patterns you expect to see and check for that. "Don't crash" is a pretty minimal test.

ab updated this revision to Diff 14972.Oct 15 2014, 5:41 PM

Add back relevant instruction checks.

qcolombet accepted this revision.Oct 23 2014, 3:04 PM
qcolombet added a reviewer: qcolombet.
qcolombet added a subscriber: qcolombet.

Hi Ahmed,

LGTM.

Thanks,
-Quentin

This revision is now accepted and ready to land.Oct 23 2014, 3:04 PM

As a note we could make the code generated worse in any number of ways and still pass this test. Might be worth a test with the preferred code?

ab closed this revision.Oct 23 2014, 3:59 PM
ab updated this revision to Diff 15358.

Closed by commit rL220533 (authored by @ab).