This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Teach the vector-types operand scalarizer about SETCC
ClosedPublic

Authored by eladcohen on Aug 13 2017, 6:55 AM.

Details

Summary

When v1i1 is legal (e.g. AVX512) the legalizer can reach
a case where a v1i1 SETCC with an illgeal vector type operand
wasn't scalarized (since v1i1 is legal) but its operands does
have to be scalarized. This used to assert because SETCC was
missing from the vector operand scalarizer.

This patch attemps to teach the legalizer to handle these cases
by scalazring the operands, converting the node into a scalar
SETCC node.

Fixes pr34177.

Diff Detail

Repository
rL LLVM

Event Timeline

eladcohen created this revision.Aug 13 2017, 6:55 AM
RKSimon added inline comments.Aug 13 2017, 2:16 PM
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
572 ↗(On Diff #110872)

Assert that the Cond type is v1i1?

test/CodeGen/X86/pr34177.ll
4 ↗(On Diff #110872)

Is it me or are the two targets' codegen the same? In which case, drop the check-prefix arguments?

eladcohen updated this revision to Diff 111069.Aug 14 2017, 2:03 PM
eladcohen marked 2 inline comments as done.

Fixed Simon's comments.

RKSimon accepted this revision.Aug 16 2017, 1:34 PM

LGTM

This revision is now accepted and ready to land.Aug 16 2017, 1:34 PM
This revision was automatically updated to reflect the committed changes.

Thanks for the review! committed in r311071