This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add demanded elts support for the inputs to pclmul intrinsic
ClosedPublic

Authored by craig.topper on Jan 21 2017, 1:03 AM.

Details

Summary

This intrinsic uses bit 0 and bit 4 of an immediate argument to determine which bits of its inputs to read. This patch uses this information to simplify the demanded elements of the input vectors.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jan 21 2017, 1:03 AM
RKSimon added inline comments.Jan 21 2017, 2:58 PM
lib/Transforms/InstCombine/InstCombineCalls.cpp
2197 ↗(On Diff #85239)

Add support for detecting all undef with UndefElts?

Optimize to undef if both inputs are undef.

RKSimon edited edge metadata.Jan 23 2017, 8:37 AM

Optimize to undef if both inputs are undef.

Should we be optimizing to undef or zero? I don't have an answer but I just got stung for having written muldq/muludq optimizing to undef as generic multiplies become zero. Does clmul count as a multiply?

Convert to zero if either input is undef.

RKSimon accepted this revision.Jan 25 2017, 1:50 AM

LGTM - thanks.

This revision is now accepted and ready to land.Jan 25 2017, 1:50 AM
This revision was automatically updated to reflect the committed changes.