Page MenuHomePhabricator

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

Authored by spatel on Mon, Sep 9, 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

Repository
rL LLVM

Event Timeline

spatel created this revision.Mon, Sep 9, 10:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Sep 9, 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.Fri, Sep 13, 12:03 PM

Patch updated:
Rebased with test for constant expressions.

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

LGTM - cheers

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