This is an archive of the discontinued LLVM Phabricator instance.

[x86] minimal fix for horizontal binop matching for 256-bit vectors (PR40243)
AbandonedPublic

Authored by spatel on Jan 9 2019, 6:52 AM.

Details

Summary

After thinking about it more, the extra code in D56450 doesn't add much value if we can't remove the existing matcher. So this is a minimal alternative to that patch.

The existing code is safe/correct for 128-bit ops, but we need to adjust the outputs to account for undefs no matter what.

I still need to convince myself that the last section where we match 256-bit ops is always safe, but this does fix all of the known patterns from PR40243:
https://bugs.llvm.org/show_bug.cgi?id=40243

Diff Detail

Event Timeline

spatel created this revision.Jan 9 2019, 6:52 AM
spatel abandoned this revision.Jan 10 2019, 7:40 AM

Abandoning - the original patch was already reviewed, so I went ahead and committed that + a similar fix as this patch implements.
That fixes all of the h-op miscompile problems that I am aware of.
I did eventually convince myself that the last section is safe based on the output of existing regression tests.