[LLVMdev] max/min intrinsics

Duncan Sands baldrick at free.fr
Wed Dec 5 09:29:50 PST 2012

Hi Paul,

On 05/12/12 17:26, Redmond, Paul wrote:
> I have been working on a patch to add support for max/min reductions in LoopVectorize. One of the comments that came up in review is that the implementation could be simplified (and less fragile) if max and min intrinsics were recognized rather than looking for compare-select sequences.
> The suggestion was to change compare-selects into max and min intrinsic calls during instcombine.
> The intrinsics to add are:
> declare iN llvm.{smin,smax}.iN(iN %a, iN %b)
> declare iN llvm.{umin,umax}.iN(iN %a, iN %b)
> declare fN llvm.{fmin,fmax}.fN(fN %a, fN %b)
> What does the community think?

it seems reasonable to me.

Ciao, Duncan.

More information about the llvm-dev mailing list