[LoopVectorize] Propagate fast-math flags for VPInstruction
authorRosie Sumpter <rosie.sumpter@arm.com>
Wed, 3 Nov 2021 12:40:14 +0000 (12:40 +0000)
committerRosie Sumpter <rosie.sumpter@arm.com>
Wed, 24 Nov 2021 08:50:04 +0000 (08:50 +0000)
commit991074012a6c9a294c5c64cf51502934a8e9bb36
tree52b7bd49f0be3feeefa2b69bb188c4edbf4c6bce
parentc2441b6b89bfe52a16f6c5ed5a0a49c9a02daf2a
[LoopVectorize] Propagate fast-math flags for VPInstruction

In-loop vector reductions which use the llvm.fmuladd intrinsic involve
the creation of two recipes; a VPReductionRecipe for the fadd and a
VPInstruction for the fmul. If the call to llvm.fmuladd has fast-math flags
these should be propagated through to the fmul instruction, so an
interface setFastMathFlags has been added to the VPInstruction class to
enable this.

Differential Revision: https://reviews.llvm.org/D113125
llvm/include/llvm/IR/Operator.h
llvm/lib/IR/AsmWriter.cpp
llvm/lib/IR/Operator.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll
llvm/test/Transforms/LoopVectorize/vplan-printing.ll