[llvm][mlir] Promote the experimental reduction intrinsics to be first class intrinsics.

This change renames the intrinsics to not have "experimental" in the name.

The autoupgrader will handle legacy intrinsics.

Relevant ML thread: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140729.html

Differential Revision: https://reviews.llvm.org/D88787
This commit is contained in:
Amara Emerson committed 2020-10-07 10:36:44 -07:00
1 parent 19bc894da1
commit 322d0afd87
182 files changed
+5743 -5681

No files matched your search

@@ -564,33 +564,33 @@ public:
if (eltType.isIntOrIndex()) {
// Integer reductions: add/mul/min/max/and/or/xor.
if (kind == "add")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_add>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_add>(
op, llvmType, operands[0]);
else if (kind == "mul")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_mul>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_mul>(
op, llvmType, operands[0]);
else if (kind == "min" &&
(eltType.isIndex() || eltType.isUnsignedInteger()))
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_umin>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_umin>(
op, llvmType, operands[0]);
else if (kind == "min")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_smin>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_smin>(
op, llvmType, operands[0]);
else if (kind == "max" &&
(eltType.isIndex() || eltType.isUnsignedInteger()))
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_umax>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_umax>(
op, llvmType, operands[0]);
else if (kind == "max")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_smax>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_smax>(
op, llvmType, operands[0]);
else if (kind == "and")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_and>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_and>(
op, llvmType, operands[0]);
else if (kind == "or")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_or>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_or>(
op, llvmType, operands[0]);
else if (kind == "xor")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_xor>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_xor>(
op, llvmType, operands[0]);
else
return failure();
@@ -604,7 +604,7 @@ public:
: rewriter.create<LLVM::ConstantOp>(
op->getLoc(), llvmType,
rewriter.getZeroAttr(eltType));
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_v2_fadd>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_fadd>(
op, llvmType, acc, operands[0],
rewriter.getBoolAttr(reassociateFPReductions));
} else if (kind == "mul") {
@@ -614,14 +614,14 @@ public:
: rewriter.create<LLVM::ConstantOp>(
op->getLoc(), llvmType,
rewriter.getFloatAttr(eltType, 1.0));
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_v2_fmul>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_fmul>(
op, llvmType, acc, operands[0],
rewriter.getBoolAttr(reassociateFPReductions));
} else if (kind == "min")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_fmin>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_fmin>(
op, llvmType, operands[0]);
else if (kind == "max")
rewriter.replaceOpWithNewOp<LLVM::experimental_vector_reduce_fmax>(
rewriter.replaceOpWithNewOp<LLVM::vector_reduce_fmax>(
op, llvmType, operands[0]);
else
return failure();