[llvm] d5c404d - [RISCV] Enable ordered reduction.
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 7 04:36:58 PST 2023
Author: Mel Chen
Date: 2023-03-07T04:36:50-08:00
New Revision: d5c404d1b9ab934e9b230df4c09eef2425b106e9
URL: https://github.com/llvm/llvm-project/commit/d5c404d1b9ab934e9b230df4c09eef2425b106e9
DIFF: https://github.com/llvm/llvm-project/commit/d5c404d1b9ab934e9b230df4c09eef2425b106e9.diff
LOG: [RISCV] Enable ordered reduction.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D144455
Added:
Modified:
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
llvm/test/Transforms/LoopVectorize/RISCV/ordered-reduction.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
index 4785e8bf30f82..6646bd1d06e4f 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
@@ -75,6 +75,7 @@ class RISCVTTIImpl : public BasicTTIImplBase<RISCVTTIImpl> {
bool shouldExpandReduction(const IntrinsicInst *II) const;
bool supportsScalableVectors() const { return ST->hasVInstructions(); }
+ bool enableOrderedReductions() const { return true; }
bool enableScalableVectorization() const { return ST->hasVInstructions(); }
TailFoldingStyle
getPreferredTailFoldingStyle(bool IVUpdateMayOverflow) const {
diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/ordered-reduction.ll b/llvm/test/Transforms/LoopVectorize/RISCV/ordered-reduction.ll
index 2e6a01e2fb81f..dfe52eaf13bb4 100644
--- a/llvm/test/Transforms/LoopVectorize/RISCV/ordered-reduction.ll
+++ b/llvm/test/Transforms/LoopVectorize/RISCV/ordered-reduction.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -passes=loop-vectorize -hints-allow-reordering=false -S < %s | FileCheck %s --check-prefix=CHECK-NOT-VECTORIZED
+; RUN: opt -passes=loop-vectorize -hints-allow-reordering=false -S < %s | FileCheck %s --check-prefix=CHECK-ORDERED
; RUN: opt -passes=loop-vectorize -S < %s | FileCheck %s --check-prefix=CHECK-UNORDERED
; RUN: opt -passes=loop-vectorize -force-ordered-reductions=false -hints-allow-reordering=false -S < %s | FileCheck %s --check-prefix=CHECK-NOT-VECTORIZED
; RUN: opt -passes=loop-vectorize -force-ordered-reductions=true -hints-allow-reordering=false -S < %s | FileCheck %s --check-prefix=CHECK-ORDERED
More information about the llvm-commits
mailing list