Page MenuHomePhabricator

[OPENMP][LV] Respect Hints.Force meta-data for loops in LoopVectorizer
ClosedPublic

Authored by zinovy.nis on Apr 18 2014, 5:35 AM.

Details

Summary
  1. Force vectorization even if scalar cost is lower than any of vector cost, but Hints.Force is true;
  2. 2 statistics numbers for LV introduced: # of analyzed loops & # of vectorized loops.
  3. minor cosmetic fixes.

Diff Detail

Event Timeline

nadav added a comment.Apr 18 2014, 9:20 AM

The added statistics, added

2 statistics numbers for LV introduced: # of analyzed loops & # of vectorized loops.

I extracted this feature into the separate patch.

zinovy.nis updated this revision to Unknown Object (????).Apr 22 2014, 3:42 AM

Nadav, I reduced my patch. Plz look at it again.

zinovy.nis updated this revision to Unknown Object (????).Apr 22 2014, 5:43 AM

Also force vectorization if a trip count is lower than the threshold.

One more ping.

TylerNowicki edited edge metadata.Apr 28 2014, 11:55 AM

Hi Zinovy,

Sorry for the delay.

LGTM. Just a few small things.

+ Check the loop for a trip count threshold:
+
do not vectorize loops with a tiny trip count.
+ {
+ BasicBlock *Latch = L->getLoopLatch();

Could you remove the extra braces?

+ if (ForceVectorization && VF > 1) {
+ Width = 2;
+ Cost = expectedCost(Width) / (float)Width;
+ }

Could you add a comment to explain that scalar width is not considered because the user wants vectorization.

Thanks for working on this,

Tyler

Thanks, Tyler!
I made the changes you proposed and committed the result.

zinovy.nis accepted this revision.Apr 29 2014, 2:13 AM
zinovy.nis added a reviewer: zinovy.nis.
This revision is now accepted and ready to land.Apr 29 2014, 2:13 AM
zinovy.nis closed this revision.Apr 29 2014, 2:14 AM