Adding three passes to amdgpu compiler

This commit is contained in:
jerryyin 2020-01-17 16:55:51 +00:00
parent 9d1ec06b01
commit 9d3d2d3b3e
2 changed files with 10 additions and 0 deletions

View File

@ -1259,6 +1259,9 @@ cc_library(
":gpu_conv_padding_legalization",
":gpu_conv_rewriter",
":gpu_layout_assignment",
":reduction_degenerate_dim_remover",
":reduction_dimension_grouper",
":reduction_layout_normalizer",
":target_constants",
"//tensorflow/compiler/xla:statusor",
"//tensorflow/compiler/xla/service:algebraic_simplifier",

View File

@ -22,6 +22,9 @@ limitations under the License.
#include "tensorflow/compiler/xla/service/gpu/gpu_conv_rewriter.h"
#include "tensorflow/compiler/xla/service/gpu/gpu_layout_assignment.h"
#include "tensorflow/compiler/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.h"
#include "tensorflow/compiler/xla/service/gpu/reduction_degenerate_dim_remover.h"
#include "tensorflow/compiler/xla/service/gpu/reduction_dimension_grouper.h"
#include "tensorflow/compiler/xla/service/gpu/reduction_layout_normalizer.h"
#include "tensorflow/compiler/xla/service/gpu/target_constants.h"
#include "tensorflow/compiler/xla/service/hlo_constant_folding.h"
#include "tensorflow/compiler/xla/service/hlo_cse.h"
@ -92,6 +95,10 @@ Status AMDGPUCompiler::OptimizeHloPostLayoutAssignment(
/*allow_mixed_precision=*/false,
LayoutAssignment::InstructionCanChangeLayout);
pipeline.AddPass<ReductionDegenerateDimRemover>();
pipeline.AddPass<ReductionLayoutNormalizer>();
pipeline.AddPass<ReductionDimensionGrouper>();
// The LayoutAssignment pass may leave behind kCopy instructions which are
// duplicate or NOPs, so remove them with algebraic simplification and CSE.
AlgebraicSimplifierOptions options;