Page MenuHomePhabricator

[LV] Ignore the cost of values that will not appear in the vectorized loop

Authored by dorit on Dec 6 2017, 12:43 AM.



VecValuesToIgnore holds values that will not appear in the vectorized loop. We should therefore ignore their cost when VF > 1.
I think this bit was missed by which introduced the VecValuesToIgnore construct, but considered it only in register-usage calculation.

The testcase is taken from - is had redundant cases, and we check that the cost model ignores them.

Diff Detail


Event Timeline

dorit created this revision.Dec 6 2017, 12:43 AM
fhahn added a subscriber: fhahn.Dec 6 2017, 2:10 AM
fhahn added a comment.EditedDec 6 2017, 2:23 AM

The comment next to the VecValuesToIgnore declaration explicitly states that those instructions should be skipped during cost modelling if VF > 1 (/// Values to ignore in the cost model when VF > 1.)

So this looks good to me, although someone else should probably sign-off too.

6869 ↗(On Diff #125674)

No curly braces here. I think this could even be merged with the previous check, as they both skip ignored values.

dorit updated this revision to Diff 125685.Dec 6 2017, 2:37 AM

Thanks Florian. Uploaded the formatting fix.

Ayal accepted this revision.Dec 9 2017, 1:57 PM

LGTM, thanks for taking this out of D38948 and into a separate commit.

6867 ↗(On Diff #125685)

Can add a comment that VecValuesToIgnore should also be skipped for VF == 1 and UF > 1, but expectedCost() provides only VF, where VF == 1 stands for the baseline version (with UF == 1 too).

Can add a comment to also have getSmallestAndWidestTypes() skip over VecValuesToIgnore, as it too only skips over ValuesToIgnore; although it only deals with loads/stores/phi's anyhow.

23 ↗(On Diff #125685)

Add a CHECK that such estimates are found for VF 1?

This revision is now accepted and ready to land.Dec 9 2017, 1:57 PM
This revision was automatically updated to reflect the committed changes.