This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Enhance SDTCisSameNumEltsAs to work with scalar types and use it on extend/trunc/round operations
ClosedPublic

Authored by craig.topper on Mar 12 2017, 4:59 PM.

Details

Summary

Currently we don't enforce that ISD::ANY_EXTEND, ZERO_EXTEND, SIGN_EXTEND, TRUNC, FP_ROUND, FP_EXTEND have the same number of elements(including scalar) between their input and output. Though we have them documented as such. Up until a few months ago x86 created nodes that violated this rule. That's all been fixed now, and we should enforce the rule going forward.

In order to do this we need to allow SDTCisSameNumEltsAs to support scalar types and not enforce being a vector. If one type is scalar we will force the other type to also be scalar.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 12 2017, 4:59 PM
RKSimon accepted this revision.Mar 13 2017, 7:25 AM

LGTM

This revision is now accepted and ready to land.Mar 13 2017, 7:25 AM
This revision was automatically updated to reflect the committed changes.