This is an archive of the discontinued LLVM Phabricator instance.

[SLPVectorizer] Recognise non uniform power of 2 constants
ClosedPublic

Authored by RKSimon on Jun 15 2018, 3:49 AM.

Details

Summary

Since D46637 we are better at handling uniform/non-uniform constant Pow2 detection; this patch tweaks the SLP argument handling to support them.

As SLP works with arrays of values I don't think we can easily use the pattern match helpers here.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Jun 15 2018, 3:49 AM
ABataev accepted this revision.Jun 26 2018, 8:58 AM

LG with nits

lib/Transforms/Vectorize/SLPVectorizer.cpp
2283 ↗(On Diff #151485)

if (Op2VP == TargetTransformInfo::OP_PowerOf2 && !CInt->getValue().isPowerOf2())

2285–2289 ↗(On Diff #151485)
if (i == 0) {
  CInt0 = CInt;
  continue;
}
if (CInt0 != CInt)
  Op2VK = TargetTransformInfo::OK_NonUniformConstantValue;
This revision is now accepted and ready to land.Jun 26 2018, 8:58 AM
This revision was automatically updated to reflect the committed changes.