Updates LLVM usage to match
[1426ac048295](https://github.com/llvm/llvm-project/commit/1426ac048295)

PiperOrigin-RevId: 329839640
This commit is contained in:
A. Unique TensorFlower 2020-09-02 20:02:34 -07:00 committed by TensorFlow MLIR Team
parent aedcea6acf
commit 801262688c
3 changed files with 14 additions and 17 deletions

View File

@ -1,2 +1,2 @@
3445ec9ba718035b27c0140dc1e892be843236f5 1426ac0482951d4cb98f84ab9fc89c745f95602e

View File

@ -20,6 +20,7 @@ limitations under the License.
#include "mlir/IR/MLIRContext.h" #include "mlir/IR/MLIRContext.h"
#include "mlir/IR/PatternMatch.h" #include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/BufferPlacement.h"
#include "mlir/Transforms/DialectConversion.h" #include "mlir/Transforms/DialectConversion.h"
namespace mlir { namespace mlir {
@ -51,7 +52,8 @@ void PopulateMhloToStdPatterns(OwningRewritePatternList *patterns,
// Collection of rewrite patterns for lowering of HLO to LHLO dialect. // Collection of rewrite patterns for lowering of HLO to LHLO dialect.
void populateHLOToLHLOConversionPattern( void populateHLOToLHLOConversionPattern(
MLIRContext *context, BufferAssignmentPlacer *bufferAssignment, MLIRContext *context, BufferAssignmentPlacer *bufferAssignment,
TypeConverter *converter, OwningRewritePatternList *patterns); BufferAssignmentTypeConverter *converter,
OwningRewritePatternList *patterns);
// Collection of rewrite patterns for lowering of HLO to Linalg dialect. // Collection of rewrite patterns for lowering of HLO to Linalg dialect.
void populateHLOToLinalgConversionPattern(MLIRContext *context, void populateHLOToLinalgConversionPattern(MLIRContext *context,
OwningRewritePatternList *patterns); OwningRewritePatternList *patterns);

View File

@ -292,9 +292,9 @@ struct HloToLhloReduceOpConverter : public BaseOpConversion<mhlo::ReduceOp> {
// Legalize mhlo.return to a lmhlo.copy and lmhlo.terminator. This functionality // Legalize mhlo.return to a lmhlo.copy and lmhlo.terminator. This functionality
// is provided by mlir buffer assignment, so use the pattern from there. // is provided by mlir buffer assignment, so use the pattern from there.
// TODO(DFKI): Move this out of detail. using HloToLhloReturnOpConverter =
using HloToLhloReturnOpConverter = detail::BufferAssignmentReturnOpConverter< BufferAssignmentReturnOpConverter<mhlo::ReturnOp, lmhlo::TerminatorOp,
mhlo::ReturnOp, lmhlo::TerminatorOp, lmhlo::CopyOp, false>; lmhlo::CopyOp>;
class HloToLhloTensorLoadOpConverter class HloToLhloTensorLoadOpConverter
: public BaseOpConversion<mlir::TensorLoadOp> { : public BaseOpConversion<mlir::TensorLoadOp> {
@ -438,17 +438,11 @@ struct HloLegalizeToLhlo
OwningRewritePatternList patterns; OwningRewritePatternList patterns;
populateHLOToLHLOConversionPattern(func.getContext(), &bufferAssignment, populateHLOToLHLOConversionPattern(func.getContext(), &bufferAssignment,
&converter, &patterns); &converter, &patterns);
if (results_escape_function) { // FIXME: we likely need to call converter.setResultConversionKind() to
populateWithBufferAssignmentOpConversionPatterns< // respect results_escape_function.
mlir::ReturnOp, mlir::ReturnOp, lmhlo::CopyOp, populateWithBufferAssignmentOpConversionPatterns<
/*allowMemrefFunctionResults=*/true>(&context, &bufferAssignment, mlir::ReturnOp, mlir::ReturnOp, lmhlo::CopyOp>(
&converter, &patterns); &context, &bufferAssignment, &converter, &patterns);
} else {
populateWithBufferAssignmentOpConversionPatterns<
mlir::ReturnOp, mlir::ReturnOp, lmhlo::CopyOp,
/*allowMemrefFunctionResults=*/false>(&context, &bufferAssignment,
&converter, &patterns);
}
return applyPartialConversion(func, target, patterns); return applyPartialConversion(func, target, patterns);
}); });
if (result.wasInterrupted()) { if (result.wasInterrupted()) {
@ -467,7 +461,8 @@ struct HloLegalizeToLhlo
void populateHLOToLHLOConversionPattern( void populateHLOToLHLOConversionPattern(
MLIRContext* context, BufferAssignmentPlacer* bufferAssignment, MLIRContext* context, BufferAssignmentPlacer* bufferAssignment,
TypeConverter* converter, OwningRewritePatternList* patterns) { BufferAssignmentTypeConverter* converter,
OwningRewritePatternList* patterns) {
// clang-format off // clang-format off
patterns->insert< patterns->insert<
HloToLhloDynamicBroadcastInDimOpConverter, HloToLhloDynamicBroadcastInDimOpConverter,