Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GleasonK authored Mar 7, 2024
1 parent 6909631 commit d978408
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ workspace(name = "stablehlo")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

LLVM_COMMIT = "e630a451b457e4d8d071a2b4f102b342bbea2d02"
LLVM_COMMIT = "be15a6b3b68bed7b9d982f25b2e10a273302002a"

LLVM_SHA256 = "184e7622a47609d960295e5e363466e9e60e6d9dbc20d554b3e1118ffd9f1bfb"
LLVM_SHA256 = "1e6cc2eb634438a59fb5e1b87e7bb35883fb680dc2934f431150db22fb3a6c09"

http_archive(
name = "llvm-raw",
Expand Down
2 changes: 1 addition & 1 deletion build_tools/llvm_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e630a451b457e4d8d071a2b4f102b342bbea2d02
be15a6b3b68bed7b9d982f25b2e10a273302002a
2 changes: 1 addition & 1 deletion stablehlo/reference/InterpreterOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ LogicalResult RunParallelOp::verify() {
SmallVector<InterpreterValue> evalRunParallelOp(
ArrayRef<InterpreterValue> inputs, std::queue<StringAttr> &infeed,
SmallVector<SmallVector<StringAttr>> programs, SymbolTable &symbolTable) {
llvm::ThreadPool threadPool;
llvm::DefaultThreadPool threadPool;
SmallVector<std::shared_future<SmallVector<InterpreterValue>>> futures;

uint32_t numReplicas = programs.size();
Expand Down
9 changes: 5 additions & 4 deletions stablehlo/transforms/StablehloLegalizeToVhlo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,12 @@ class StablehloToVhloOpConverter : public OpConversionPattern<StablehloOpTy> {
// additional argument for the generic builder.
StablehloToVhloOp<StablehloOpTy> vhloOp;
if constexpr (std::is_same<StablehloOpTy, stablehlo::CaseOp>::value) {
vhloOp = rewriter.replaceOpWithNewOp<vhlo::CaseOpV1>(
stablehloOp, vhloTypes, vhloOperands, vhloAttrs,
vhloOp = rewriter.create<vhlo::CaseOpV1>(
stablehloOp.getLoc(), vhloTypes, vhloOperands, vhloAttrs,
stablehloOp.getBranches().size());
} else {
vhloOp = rewriter.replaceOpWithNewOp<StablehloToVhloOp<StablehloOpTy>>(
stablehloOp, vhloTypes, vhloOperands, vhloAttrs);
vhloOp = rewriter.create<StablehloToVhloOp<StablehloOpTy>>(
stablehloOp.getLoc(), vhloTypes, vhloOperands, vhloAttrs);
}

for (auto [stablehloRegion, vhloRegion] :
Expand All @@ -855,6 +855,7 @@ class StablehloToVhloOpConverter : public OpConversionPattern<StablehloOpTy> {
/*entryConversion=*/nullptr)))
return failure();
}
rewriter.replaceOp(stablehloOp, vhloOp);
return success();
}
};
Expand Down
10 changes: 6 additions & 4 deletions stablehlo/transforms/VhloLegalizeToStablehlo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,12 +856,12 @@ class VhloToStablehloOpConverter : public OpConversionPattern<VhloOpTy> {
// additional argument for the generic builder.
VhloToStablehloOp<VhloOpTy> stablehloOp;
if constexpr (std::is_same<VhloOpTy, vhlo::CaseOpV1>::value) {
stablehloOp = rewriter.replaceOpWithNewOp<stablehlo::CaseOp>(
vhloOp, stablehloTypes, stablehloOperands, stablehloAttrs,
stablehloOp = rewriter.create<stablehlo::CaseOp>(
vhloOp.getLoc(), stablehloTypes, stablehloOperands, stablehloAttrs,
vhloOp.getBranches().size());
} else {
stablehloOp = rewriter.replaceOpWithNewOp<VhloToStablehloOp<VhloOpTy>>(
vhloOp, stablehloTypes, stablehloOperands, stablehloAttrs);
stablehloOp = rewriter.create<VhloToStablehloOp<VhloOpTy>>(
vhloOp.getLoc(), stablehloTypes, stablehloOperands, stablehloAttrs);
}

for (auto [vhloRegion, stablehloRegion] :
Expand All @@ -873,6 +873,8 @@ class VhloToStablehloOpConverter : public OpConversionPattern<VhloOpTy> {
/*entryConversion=*/nullptr)))
return failure();
}

rewriter.replaceOp(vhloOp, stablehloOp);
return success();
}
};
Expand Down

0 comments on commit d978408

Please sign in to comment.