Skip to content

Commit

Permalink
cast tf::CastOp to mlir::Value in shape_inference.cc after 0d6ebb4f0dd7
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 288686938
Change-Id: Ia98accae83557377b3cce9dc902d2012cf6f6311
  • Loading branch information
tensorflower-gardener committed Jan 8, 2020
1 parent c4ea52e commit d8d6252
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ limitations under the License.
#include "mlir/IR/Operation.h" // TF:llvm-project
#include "mlir/IR/StandardTypes.h" // TF:llvm-project
#include "mlir/IR/SymbolTable.h" // TF:llvm-project
#include "mlir/IR/Value.h" // TF:llvm-project
#include "mlir/Pass/Pass.h" // TF:llvm-project
#include "mlir/Pass/PassRegistry.h" // TF:llvm-project
#include "mlir/Support/LLVM.h" // TF:llvm-project
Expand Down Expand Up @@ -118,7 +119,7 @@ void AddCastBackForUnsupportedNonTFUses(Operation* op, Value result,
cast_op =
builder.create<TF::CastOp>(op->getLoc(), old_type, result,
/*truncate=*/builder.getBoolAttr(false));
return cast_op;
return mlir::Value(cast_op);
};
for (OpOperand& use : llvm::make_early_inc_range(result->getUses())) {
if (use.getOwner()->getDialect() != tf_dialect &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ mlir::AffineForOp TileLoop(mlir::AffineForOp loop, int64_t size,
SetBoundForSimpleLoop(loop, length.ceilDiv(size), builder);
}

for (mlir::IROperand& use :
for (auto& use :
llvm::make_early_inc_range(loop.getInductionVar().getUses())) {
mlir::Operation* owner = use.getOwner();
BoundAffineMap affine_map = GetBoundAffineMapFrom(owner);
Expand Down Expand Up @@ -329,8 +329,7 @@ mlir::Operation* HoistAndFix(llvm::iplist<mlir::Operation>::iterator begin_op,
for (auto ancestor : ancestors) {
indvars.push_back(ancestor.getInductionVar());
}
for (mlir::IROperand& use :
llvm::make_early_inc_range(alloc.getResult().getUses())) {
for (auto& use : llvm::make_early_inc_range(alloc.getResult().getUses())) {
mlir::Operation* owner = use.getOwner();
BoundAffineMap affine_map = GetBoundAffineMapFrom(owner);
affine_map.operands.insert(affine_map.operands.begin(), indvars.begin(),
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
)

# Check out LLVM and MLIR from llvm-project.
LLVM_COMMIT = "b30d87a90ba983d76f8a6cd334ac38244bbf9ded"
LLVM_SHA256 = "a0de95a4fda0193f0257509ffbca1d6bd27d3c619749cf8d0e2b79c111e8b49c"
LLVM_COMMIT = "11552433ebfc7243c0b66367bdffaba52e74b354"
LLVM_SHA256 = "bbdba20f1b44661b55062b449b5df6491c7272ab980827ff68fc8621fa180a3e"
LLVM_URLS = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
"https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
Expand Down
6 changes: 3 additions & 3 deletions third_party/mlir/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ gentbl(
)

gentbl(
name = "SPIRVAvailabilityAvailGen",
name = "SPIRVAvailabilityIncGen",
tbl_outs = [
(
"-gen-avail-interface-decls",
Expand All @@ -1068,7 +1068,6 @@ gentbl(
td_file = "include/mlir/Dialect/SPIRV/SPIRVOps.td",
td_srcs = [
":SPIRVOpsTdFiles",
":StdOpsTdFiles",
],
)

Expand Down Expand Up @@ -1105,6 +1104,7 @@ gentbl(
td_file = "include/mlir/Dialect/SPIRV/SPIRVBase.td",
td_srcs = [
":SPIRVOpsTdFiles",
":SPIRVAvailabilityIncGen",
],
)

Expand Down Expand Up @@ -1144,7 +1144,7 @@ cc_library(
":CommonFolders",
":IR",
":Parser",
":SPIRVAvailabilityAvailGen",
":SPIRVAvailabilityIncGen",
":SPIRVCanonicalizationIncGen",
":SPIRVOpUtilsIncGen",
":SPIRVOpsIncGen",
Expand Down

0 comments on commit d8d6252

Please sign in to comment.