This is an archive of the discontinued LLVM Phabricator instance.

DAG: Fix creating select with wrong condition type
ClosedPublic

Authored by arsenm on Aug 10 2017, 4:25 PM.

Details

Summary

This code added in r297930 assumed that it could create
a select with a condition type that is just an integer
bitcast of the selected type. For AMDGPU any vselect is
going to be scalarized (although the vector types are legal),
and all select conditions must be i1 (the same as getSetCCResultType).

This logic doesn't really make sense to me, but there's
never really been a consistent policy in what the select
condition mask type is supposed to be. Try to extend
the logic for skipping the transform for condition types
that aren't setccs. It doesn't seem quite right to me though,
but checking conditions that seem more sensible (like whether the
vselect is going to be expanded) doesn't work since this
seems to depend on that also.

Diff Detail

Event Timeline

arsenm created this revision.Aug 10 2017, 4:25 PM
RKSimon added a reviewer: zvi.Oct 7 2017, 2:12 AM
zvi edited edge metadata.Oct 17 2017, 8:38 AM

The changes in WidenVSELECTAndMask and the X86 test LGTM.

arsenm accepted this revision.Oct 25 2017, 12:14 AM

r316554

This revision is now accepted and ready to land.Oct 25 2017, 12:14 AM
arsenm closed this revision.Oct 25 2017, 12:14 AM