diff options
author | Amara Emerson <amara@apple.com> | 2020-10-08 00:17:02 -0700 |
---|---|---|
committer | Amara Emerson <amara@apple.com> | 2020-10-16 10:17:53 -0700 |
commit | 6042c25b0a7a9d812ace6ffe164628af9a1e1259 (patch) | |
tree | c871715397110b30da1f584e9931b0ad945af876 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | 2408fc2a1e85c0e9e9c6e8b1dd00d2507dda38f4 (diff) | |
download | llvm-6042c25b0a7a9d812ace6ffe164628af9a1e1259.zip llvm-6042c25b0a7a9d812ace6ffe164628af9a1e1259.tar.gz llvm-6042c25b0a7a9d812ace6ffe164628af9a1e1259.tar.bz2 |
[GlobalISel] Add translation support for vector reduction intrinsics.
In order to prevent the ExpandReductions pass from expanding some intrinsics
before they get to codegen, I had to add a -disable-expand-reductions flag
for testing purposes.
Differential Revision: https://reviews.llvm.org/D89028
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index ef070ee..3a1a82f 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -218,6 +218,11 @@ static cl::opt<bool> EnableMachineFunctionSplitter( cl::desc("Split out cold blocks from machine functions based on profile " "information.")); +/// Disable the expand reductions pass for testing. +static cl::opt<bool> DisableExpandReductions( + "disable-expand-reductions", cl::init(false), cl::Hidden, + cl::desc("Disable the expand reduction intrinsics pass from running")); + /// Allow standard passes to be disabled by command line options. This supports /// simple binary flags that either suppress the pass or do nothing. /// i.e. -disable-mypass=false has no effect. @@ -708,7 +713,9 @@ void TargetPassConfig::addIRPasses() { addPass(createScalarizeMaskedMemIntrinPass()); // Expand reduction intrinsics into shuffle sequences if the target wants to. - addPass(createExpandReductionsPass()); + // Allow disabling it for testing purposes. + if (!DisableExpandReductions) + addPass(createExpandReductionsPass()); } /// Turn exception handling constructs into something the code generators can |