Fixing nondeterminism in pattern application.
The ReduceRegion* patterns are matching on the same ops as the PointwiseToLinalg* patterns and on certain toolchains (MSVC) the order can be wrong. If the pointwise runs first then it converts the op *within* the reduction before the reduction one runs, leading to nested linalg op weirdness. PiperOrigin-RevId: 373848269
This commit is contained in:
parent
a361253e4f
commit
b06baae910
|
@ -2354,7 +2354,8 @@ void populateHLOToLinalgConversionPattern(MLIRContext* context,
|
||||||
ReduceRegionXLAOpConversion<mhlo::OrOp>,
|
ReduceRegionXLAOpConversion<mhlo::OrOp>,
|
||||||
ReduceRegionXLAOpConversion<mhlo::SelectOp>,
|
ReduceRegionXLAOpConversion<mhlo::SelectOp>,
|
||||||
ReduceRegionXLAOpConversion<mhlo::CompareOp>,
|
ReduceRegionXLAOpConversion<mhlo::CompareOp>,
|
||||||
ReduceRegionReturnOpConversion>(context);
|
ReduceRegionReturnOpConversion>(context,
|
||||||
|
PatternBenefit(1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<OperationPass<FuncOp>> createLegalizeHloToLinalgPass() {
|
std::unique_ptr<OperationPass<FuncOp>> createLegalizeHloToLinalgPass() {
|
||||||
|
|
Loading…
Reference in New Issue