[LoopVectorizer] Add reduction tests for inloop reductions. NFC

Also adds a force-reduction-intrinsics option for testing, for forcing
the generation of reduction intrinsics even when the backend is not
requesting them.
This commit is contained in:
David Green 2020-03-03 09:26:00 +00:00
parent 6304368818
commit ec7e4a9a80
2 changed files with 1365 additions and 1 deletions

View File

@ -46,6 +46,11 @@
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";
@ -1015,7 +1020,8 @@ Value *llvm::createSimpleTargetReduction(
llvm_unreachable("Unhandled opcode");
break;
}
if (TTI->useReductionIntrinsic(Opcode, Src->getType(), Flags))
if (ForceReductionIntrinsic ||
TTI->useReductionIntrinsic(Opcode, Src->getType(), Flags))
return BuildFunc();
return getShuffleReduction(Builder, Src, Opcode, MinMaxKind, RedOps);
}

File diff suppressed because it is too large Load Diff