[PATCH] Improve Cost model for SLPVectorizer when we have a vector division by power of 2

Karthik Bhat kv.bhat at samsung.com
Wed Aug 20 10:18:05 PDT 2014


Hi Hal,Sanjay,
Thanks for the inputs. The reason i added support for only uniform constant power of 2 is because currently x86 backend successfully emits PSRAW/PSRAD (but if i'm not wrong this requires all the shifts to be same. i.e. division by same power of 2).

Non uniform values that are all power of 2 though are currently not that profitable as backend doesn't emit/or have instructions that can do this profitably.

Hal i had a doubt, by feature bit do we mean having something like a member variable say isPowerof2 and setting this before calling getArithmeticInstrCost? 
Please correct me if my understanding is wrong.

Thanks for all the help and taking your time to review the patch. 
I will update the patch shortly based on your i/p's and raise updated patch.

Thanks
Karthik Bhat

http://reviews.llvm.org/D4971






More information about the llvm-commits mailing list