[PATCH] D17141: [ARM] Adding IEEE-754 SIMD detection to loop vectorizer

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 05:37:29 PST 2016


rengolin added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4333
@@ -4302,3 +4332,3 @@
         RecurrenceDescriptor RedDes;
         if (RecurrenceDescriptor::isReductionPHI(Phi, TheLoop, RedDes)) {
           if (RedDes.hasUnsafeAlgebra())
----------------
ashutosh.nema wrote:
> During ReductionPHI identification it checks floating point min max is only handled 
> when ‘no-nans-fp-math’ is ON. Probably this behaviour condition needs to be modified.
> 
> RecurrenceDescriptor::InstDesc
> RecurrenceDescriptor::isRecurrenceInstr(Instruction *I, RecurrenceKind Kind,
>                                         InstDesc &Prev, bool HasFunNoNaNAttr) {
>   case Instruction::FCmp:
>   case Instruction::ICmp:
>   case Instruction::Select:
>     if (Kind != RK_IntegerMinMax &&
>         (!HasFunNoNaNAttr || Kind != RK_FloatMinMax))
>       return InstDesc(false, I);
>     return isMinMaxSelectCmpPattern(I, Prev);
> 
That would only stop reduction vectorization. The problem I'm trying to fix is not a *vectorization* issue, but an ISA one.

NEON can't be used for safe-maths operations under *any* circumstance, so I need to make sure that no loops with FP ops gets ever vectorized without -ffast-math. That includes reductions and inductions.

As you see in my tests I check for both behaviours to be correct.


Repository:
  rL LLVM

http://reviews.llvm.org/D17141





More information about the llvm-commits mailing list