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

PiperOrigin-RevId: 374855085
This commit is contained in:
A. Unique TensorFlower 2021-05-20 06:08:26 -07:00 committed by TensorFlow MLIR Team
parent c62fd89663
commit 57aeb5ab16
9 changed files with 27 additions and 16 deletions

View File

@ -15,9 +15,9 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
LLVM_COMMIT = "6381664580080f015bc0c2ec647853f697cf744a"
LLVM_COMMIT = "0316f3e64972c919d8bfa2d15b9a4be858530f85"
LLVM_SHA256 = "f16c1757a31dbf9370da3de766e20b238212b5a0e08b897eeda893899ebf70bf"
LLVM_SHA256 = "ddf0daa23870922c468343c08670e8007358b463cf4ed2c737a94086cc433527"
LLVM_BAZEL_TAG = "llvm-project-{commit}".format(commit = LLVM_COMMIT)

View File

@ -1,2 +1,2 @@
6381664580080f015bc0c2ec647853f697cf744a
0316f3e64972c919d8bfa2d15b9a4be858530f85

View File

@ -438,7 +438,7 @@ class HLOClient_UnaryElementwiseOp<string mnemonic, list<OpTrait> traits,
SmallVectorImpl<ShapedTypeComponents>& inferedReturnShapes) {
return failure();
}
LogicalResult reifyReturnTypeShapes(OpBuilder& builder,
LogicalResult reifyReturnTypeShapes(OpBuilder& builder, ValueRange operands,
SmallVectorImpl<Value>& reifiedReturnShapes) {
return ::mlir::mhlo::deriveShapeFromFirstOperand(&builder, getOperation(),
&reifiedReturnShapes);

View File

@ -139,7 +139,8 @@ class HLO_UnaryElementwiseOp<string mnemonic, list<OpTrait> traits,
return failure();
}
LogicalResult reifyReturnTypeShapes(
OpBuilder& builder, SmallVectorImpl<Value>& reifiedReturnShapes) {
OpBuilder& builder, ValueRange operands,
SmallVectorImpl<Value>& reifiedReturnShapes) {
return ::mlir::mhlo::deriveShapeFromFirstOperand(&builder, getOperation(),
&reifiedReturnShapes);
}
@ -452,7 +453,8 @@ class HLO_BinaryElementwiseOp<string mnemonic, list<OpTrait> traits> :
return failure();
}
LogicalResult reifyReturnTypeShapes(
OpBuilder& builder, SmallVectorImpl<Value>& reifiedReturnShapes) {
OpBuilder& builder, ValueRange operands,
SmallVectorImpl<Value>& reifiedReturnShapes) {
return ::mlir::mhlo::deriveShapeFromFirstOperand(&builder, getOperation(),
&reifiedReturnShapes);
}

View File

@ -204,7 +204,8 @@ LogicalResult BroadcastComplexOp::inferReturnTypeComponents(
inferedReturnShapes);
}
LogicalResult BroadcastComplexOp::reifyReturnTypeShapes(
OpBuilder& builder, SmallVectorImpl<Value>& reifiedReturnShapes) {
OpBuilder& builder, ValueRange,
SmallVectorImpl<Value>& reifiedReturnShapes) {
return ReifyBroadcastBinaryOpReturnTypeShapes(builder, getOperation(),
reifiedReturnShapes);
}
@ -235,7 +236,8 @@ LogicalResult BroadcastCompareOp::inferReturnTypeComponents(
}
LogicalResult BroadcastCompareOp::reifyReturnTypeShapes(
OpBuilder& builder, SmallVectorImpl<Value>& reifiedReturnShapes) {
OpBuilder& builder, ValueRange,
SmallVectorImpl<Value>& reifiedReturnShapes) {
return ReifyBroadcastBinaryOpReturnTypeShapes(builder, getOperation(),
reifiedReturnShapes);
}
@ -293,7 +295,8 @@ LogicalResult IsPosInfOp::inferReturnTypes(
inferedReturnShapes); \
} \
LogicalResult Op::reifyReturnTypeShapes( \
OpBuilder& builder, SmallVectorImpl<Value>& reifiedReturnShapes) { \
OpBuilder& builder, ValueRange, \
SmallVectorImpl<Value>& reifiedReturnShapes) { \
return ReifyBroadcastBinaryOpReturnTypeShapes(builder, getOperation(), \
reifiedReturnShapes); \
}

View File

@ -1002,7 +1002,7 @@ LogicalResult DynamicBroadcastInDimOp::inferReturnTypeComponents(
}
LogicalResult DynamicBroadcastInDimOp::reifyReturnTypeShapes(
OpBuilder&, SmallVectorImpl<Value>& reifiedReturnShapes) {
OpBuilder&, ValueRange, SmallVectorImpl<Value>& reifiedReturnShapes) {
reifiedReturnShapes.push_back(output_dimensions());
return success();
}
@ -2100,7 +2100,8 @@ LogicalResult SelectOp::inferReturnTypeComponents(
}
LogicalResult SelectOp::reifyReturnTypeShapes(
OpBuilder& builder, SmallVectorImpl<Value>& reifiedReturnShapes) {
OpBuilder& builder, ValueRange operands,
SmallVectorImpl<Value>& reifiedReturnShapes) {
return deriveShapeFromFirstOperand(&builder, getOperation(),
&reifiedReturnShapes);
}
@ -3183,7 +3184,8 @@ LogicalResult CompareOp::inferReturnTypeComponents(
}
LogicalResult CompareOp::reifyReturnTypeShapes(
OpBuilder& builder, SmallVectorImpl<Value>& reifiedReturnShapes) {
OpBuilder& builder, ValueRange operands,
SmallVectorImpl<Value>& reifiedReturnShapes) {
return deriveShapeFromFirstOperand(&builder, getOperation(),
&reifiedReturnShapes);
}

View File

@ -107,7 +107,8 @@ LogicalResult ConvertResults(Operation* op, SmallVectorImpl<Value>& results,
if (!shape_type_op) return failure();
SmallVector<Value, 1> results_shape;
auto status = shape_type_op.reifyReturnTypeShapes(rewriter, results_shape);
auto status = shape_type_op.reifyReturnTypeShapes(
rewriter, shape_type_op->getOperands(), results_shape);
if (failed(status)) return failure();
results.push_back(
InsertDynamicAllocAndDealloc(op->getLoc(), result.value(),
@ -390,7 +391,8 @@ struct HloToLhloDotGeneralOpConverter
} else {
SmallVector<Value, 1> results_shape;
auto shape_type_op = dyn_cast<InferShapedTypeOpInterface>(op);
if (failed(shape_type_op.reifyReturnTypeShapes(rewriter, results_shape)))
if (failed(shape_type_op.reifyReturnTypeShapes(
rewriter, shape_type_op->getOperands(), results_shape)))
return failure();
bufferArgs[2] = InsertDynamicAllocAndDealloc(

View File

@ -55,7 +55,8 @@ struct ShapeReificationPattern : public OpRewritePattern<shape::ShapeOfOp> {
if (!shape_origin) return failure();
llvm::SmallVector<Value, 1> reifications;
if (failed(shape_origin.reifyReturnTypeShapes(rewriter, reifications)))
if (failed(shape_origin.reifyReturnTypeShapes(
rewriter, shape_origin->getOperands(), reifications)))
return failure();
assert(reifications.size() == 1);
Value reified_shape = reifications.front();

View File

@ -74,7 +74,8 @@ struct ReifyReturnTypeShapesPattern : public RewritePattern {
op->getOperand(0).getDefiningOp());
if (!defining_op) return failure();
SmallVector<Value, 4> return_shapes;
if (failed(defining_op.reifyReturnTypeShapes(rewriter, return_shapes))) {
if (failed(defining_op.reifyReturnTypeShapes(
rewriter, defining_op->getOperands(), return_shapes))) {
return failure();
}
rewriter.replaceOp(op, return_shapes);