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/PatternMatch.h"
#include "mlir/Transforms/BufferPlacement.h"
#include "mlir/Transforms/DialectConversion.h"
namespace mlir {
@ -51,7 +52,8 @@ void PopulateMhloToStdPatterns(OwningRewritePatternList *patterns,
// Collection of rewrite patterns for lowering of HLO to LHLO dialect.
void populateHLOToLHLOConversionPattern(
MLIRContext *context, BufferAssignmentPlacer *bufferAssignment,
TypeConverter *converter, OwningRewritePatternList *patterns);
BufferAssignmentTypeConverter *converter,
OwningRewritePatternList *patterns);
// Collection of rewrite patterns for lowering of HLO to Linalg dialect.
void populateHLOToLinalgConversionPattern(MLIRContext *context,
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
// is provided by mlir buffer assignment, so use the pattern from there.
// TODO(DFKI): Move this out of detail.
using HloToLhloReturnOpConverter = detail::BufferAssignmentReturnOpConverter<
mhlo::ReturnOp, lmhlo::TerminatorOp, lmhlo::CopyOp, false>;
using HloToLhloReturnOpConverter =
BufferAssignmentReturnOpConverter<mhlo::ReturnOp, lmhlo::TerminatorOp,
lmhlo::CopyOp>;
class HloToLhloTensorLoadOpConverter
: public BaseOpConversion<mlir::TensorLoadOp> {
@ -438,17 +438,11 @@ struct HloLegalizeToLhlo
OwningRewritePatternList patterns;
populateHLOToLHLOConversionPattern(func.getContext(), &bufferAssignment,
&converter, &patterns);
if (results_escape_function) {
populateWithBufferAssignmentOpConversionPatterns<
mlir::ReturnOp, mlir::ReturnOp, lmhlo::CopyOp,
/*allowMemrefFunctionResults=*/true>(&context, &bufferAssignment,
&converter, &patterns);
} else {
populateWithBufferAssignmentOpConversionPatterns<
mlir::ReturnOp, mlir::ReturnOp, lmhlo::CopyOp,
/*allowMemrefFunctionResults=*/false>(&context, &bufferAssignment,
&converter, &patterns);
}
// FIXME: we likely need to call converter.setResultConversionKind() to
// respect results_escape_function.
populateWithBufferAssignmentOpConversionPatterns<
mlir::ReturnOp, mlir::ReturnOp, lmhlo::CopyOp>(
&context, &bufferAssignment, &converter, &patterns);
return applyPartialConversion(func, target, patterns);
});
if (result.wasInterrupted()) {
@ -467,7 +461,8 @@ struct HloLegalizeToLhlo
void populateHLOToLHLOConversionPattern(
MLIRContext* context, BufferAssignmentPlacer* bufferAssignment,
TypeConverter* converter, OwningRewritePatternList* patterns) {
BufferAssignmentTypeConverter* converter,
OwningRewritePatternList* patterns) {
// clang-format off
patterns->insert<
HloToLhloDynamicBroadcastInDimOpConverter,