[llvm] r191122 - LoopVectorizer: Only allow vectorization of intrinsics. We can't know for sure that the functions 'abs' or 'round' are the functions from libm.
Hal Finkel
hfinkel at anl.gov
Sat Sep 21 16:19:39 PDT 2013
----- Original Message -----
>
> On Sep 21, 2013, at 5:41 PM, Hal Finkel <hfinkel at anl.gov> wrote:
>
> > Arnold,
> >
> > Thanks for looking at this quickly.
> >
> > +static Intrinsic::ID checkBinaryFloatSignature(const CallInst &I,
> > + Intrinsic::ID
> > ValidIntrinsicID) {
> > + if (I.getNumArgOperands() != 2 ||
> > + !I.getArgOperand(0)->getType()->isFloatingPointTy() ||
> > + !I.getArgOperand(1)->getType()->isFloatingPointTy() ||
> > + I.getType() != I.getArgOperand(0)->getType() ||
> > + !I.onlyReadsMemory())
> > + return Intrinsic::not_intrinsic;
> > +
> > + return ValidIntrinsicID;
> > +}
> >
> > To be pedantic, we should check that the two arguments also have
> > the same type (to prevent grabbing copysign(float, double)).
>
> Right.
>
> Now with
>
> +static Intrinsic::ID checkBinaryFloatSignature(const CallInst &I,
> + Intrinsic::ID
> ValidIntrinsicID)
> + if (I.getNumArgOperands() != 2 ||
> + !I.getArgOperand(0)->getType()->isFloatingPointTy() ||
> + !I.getArgOperand(1)->getType()->isFloatingPointTy() ||
> + I.getType() != I.getArgOperand(0)->getType() ||
> + I.getType() != I.getArgOperand(1)->getType() ||
> + !I.onlyReadsMemory())
>
You might be waiting for Nadav to approve, but LGTM, thanks!
-Hal
>
--
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory
More information about the llvm-commits
mailing list