This is an archive of the discontinued LLVM Phabricator instance.

[SLP] limit vectorization of Constant subclasses (PR33958)
ClosedPublic

Authored by spatel on Sep 9 2019, 10:43 AM.

Details

Summary

This is a fix for:
https://bugs.llvm.org/show_bug.cgi?id=33958

It seems universally true that we would not want to transform this kind of sequence on any target, but if that's not correct, then we could view this as a target-specific cost model problem. We could also white-list ConstantInt, ConstantFP, etc. rather than blacklist Global and ConstantExpr.

Diff Detail

Event Timeline

spatel created this revision.Sep 9 2019, 10:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2019, 10:43 AM

In some cases it might be possible to form a vector constant pool entry. We don't do that currently, though.

In some cases it might be possible to form a vector constant pool entry. We don't do that currently, though.

Yes, I didn't see the backend capability to do better, so I figured we might as well use the big hammer unless it's shown that we can profitably carve out exceptions to the rule.
If you think it's worth trying harder, I can take a look...although I'm not sure exactly where/how we'd do something with this pattern.

Maybe not worth trying harder. There are other reasons we might not want to introduce constant pools that require relocations.

Can we easily get a constexpr test?

Can we easily get a constexpr test?

Yes - rL371879

spatel updated this revision to Diff 220150.Sep 13 2019, 12:03 PM

Patch updated:
Rebased with test for constant expressions.

RKSimon accepted this revision.Sep 14 2019, 4:23 AM

LGTM - cheers

This revision is now accepted and ready to land.Sep 14 2019, 4:23 AM
This revision was automatically updated to reflect the committed changes.