[PATCH] Improve Cost model for SLPVectorizer when we have a vector division by power of 2
Hal Finkel
hfinkel at anl.gov
Wed Aug 20 12:42:26 PDT 2014
----- Original Message -----
> From: "Karthik Bhat" <kv.bhat at samsung.com>
> To: "kv bhat" <kv.bhat at samsung.com>, nrotem at apple.com, aschwaighofer at apple.com, hfinkel at anl.gov
> Cc: spatel at rotateright.com, llvm-commits at cs.uiuc.edu
> Sent: Wednesday, August 20, 2014 12:18:05 PM
> Subject: Re: [PATCH] Improve Cost model for SLPVectorizer when we have a vector division by power of 2
>
> 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.
No; maybe we want to add something like:
enum OperandValueProperties {
OP_None = 0,
OP_PowerOf2 = 1
}
(this is really a bit field).
and then make getArithmeticInstrCost take (OperandValueKind Opd1Info, unsigned Prop1, OperandValueKind Opd2Info, OperandValueProperties Prop2)
instead of just Opd1Info and Opd2Info.
Then in the routines, you check for (Prop1 & OP_PowerOf2), etc.
-Hal
>
> 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
>
>
>
--
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory
More information about the llvm-commits
mailing list