diff options
author | Sanjay Patel <spatel@rotateright.com> | 2021-02-12 08:07:29 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2021-02-12 08:13:50 -0500 |
commit | 79b1b4a5815127badaf4939773b47e280f57835d (patch) | |
tree | c487d65ff8dcd2d01ab3b4f0a233f5a96774f459 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 4c4876c314577e253a198ca3868b26fd35ec8a6e (diff) | |
download | llvm-79b1b4a5815127badaf4939773b47e280f57835d.zip llvm-79b1b4a5815127badaf4939773b47e280f57835d.tar.gz llvm-79b1b4a5815127badaf4939773b47e280f57835d.tar.bz2 |
[Vectorizers][TTI] remove option to bypass creation of vector reduction intrinsics
The vector reduction intrinsics started life as experimental ops, so backend support
was lacking. As part of promoting them to 1st-class intrinsics, however, codegen
support was added/improved:
D58015
D90247
So I think it is safe to now remove this complication from IR.
Note that we still have an IR-level codegen expansion pass for these as discussed
in D95690. Removing that is another step in simplifying the logic. Also note that
x86 was already unconditionally forming reductions in IR, so there should be no
difference for x86.
I spot checked a couple of the tests here by running them through opt+llc and did
not see any asm diffs.
If we do find functional differences for other targets, it should be possible
to (at least temporarily) restore the shuffle IR with the ExpandReductions IR
pass.
Differential Revision: https://reviews.llvm.org/D96552
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 07dc3ac..4d574e2 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -54,11 +54,6 @@ using namespace llvm; using namespace llvm::PatternMatch; -static cl::opt<bool> ForceReductionIntrinsic( - "force-reduction-intrinsics", cl::Hidden, - cl::desc("Force creating reduction intrinsics for testing."), - cl::init(false)); - #define DEBUG_TYPE "loop-utils" static const char *LLVMLoopDisableNonforced = "llvm.loop.disable_nonforced"; @@ -1025,14 +1020,10 @@ Value *llvm::createSimpleTargetReduction(IRBuilderBase &Builder, const TargetTransformInfo *TTI, Value *Src, RecurKind RdxKind, ArrayRef<Value *> RedOps) { - unsigned Opcode = RecurrenceDescriptor::getOpcode(RdxKind); TargetTransformInfo::ReductionFlags RdxFlags; RdxFlags.IsMaxOp = RdxKind == RecurKind::SMax || RdxKind == RecurKind::UMax || RdxKind == RecurKind::FMax; RdxFlags.IsSigned = RdxKind == RecurKind::SMax || RdxKind == RecurKind::SMin; - if (!ForceReductionIntrinsic && - !TTI->useReductionIntrinsic(Opcode, Src->getType(), RdxFlags)) - return getShuffleReduction(Builder, Src, Opcode, RdxKind, RedOps); auto *SrcVecEltTy = cast<VectorType>(Src->getType())->getElementType(); switch (RdxKind) { |