[PATCH] Add copysign intrinsic

Nadav Rotem nrotem at apple.com
Mon Aug 19 15:38:46 PDT 2013


LGTM! 


On Aug 19, 2013, at 2:53 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> Nadav, et al.,
> 
> Please review the attached patch which adds an llvm.copysign intrinsic. We already have Libfunc recognition for copysign (which is turned into the FCOPYSIGN SDAG node, and I'm not changing that), but I'd like to also add a corresponding intrinsic because I'd like to ability to autovectorize calls to copysign in the loop vectorizer.
> 
> The patch adds some text to the language reference, updates the loop vectorizer, BasicTTI and the SDAG builder (the intrinsic is transformed into an FCOPYSIGN node, just like the function call). I also added FCOPYSIGN to a few lists in LegalizeVector{Ops,Types} so that vector copysigns can be expanded.
> 
> In TargetLoweringBase::initActions, I've made the default action for FCOPYSIGN be Expand for vector types. This seems correct for all in-tree targets, and I think is the right thing to do because, currently, there is no way to generate vector-values FCOPYSIGN nodes (and most targets don't specify an action for vector-typed FCOPYSIGN).
> 
> Thanks again,
> Hal
> 
> -- 
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory<int_copysign_p.patch>




More information about the llvm-commits mailing list