Skip to content

Commit

Permalink
Integrate LLVM at llvm/llvm-project@3a82a1c3f6bd
Browse files Browse the repository at this point in the history
Updates LLVM usage to match
[3a82a1c3f6bd](llvm/llvm-project@3a82a1c3f6bd)

PiperOrigin-RevId: 599497025
  • Loading branch information
HEIR Team authored and copybara-github committed Jan 18, 2024
1 parent 5908572 commit ea8e2f3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bazel/import_llvm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load(

def import_llvm(name):
"""Imports LLVM."""
LLVM_COMMIT = "f3d534c4251bb08ee210a49fcf721cefff7ded11"
LLVM_COMMIT = "3a82a1c3f6bdc9259cc4641f66fc76d1e171e382"

new_git_repository(
name = name,
Expand Down
3 changes: 2 additions & 1 deletion include/Target/TfheRustBool/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ cc_library(
],
deps = [
"@heir//lib/Analysis/SelectVariableNames",
"@heir//lib/Dialect/TfheRust/IR:Dialect",
"@heir//lib/Dialect/TfheRustBool/IR:Dialect",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
],
)
2 changes: 1 addition & 1 deletion lib/Conversion/CGGIToTfheRust/CGGIToTfheRust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ struct AddServerKeyArg : public OpConversionPattern<func::FuncOp> {
}
auto newFuncType =
FunctionType::get(getContext(), newTypes, originalType.getResults());
rewriter.updateRootInPlace(op, [&] {
rewriter.modifyOpInPlace(op, [&] {
op.setType(newFuncType);

// In addition to updating the type signature, we need to update the
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/CombToCGGI/CombToCGGI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class SecretGenericOpTypeConversion
// secret inputs.
// For some reason, if this doesn't occur, the type conversion framework is
// unable to update the uses of converted truth table results.
rewriter.startRootUpdate(op);
rewriter.startOpModification(op);
const SecretTypeConverter *secretConverter =
static_cast<const SecretTypeConverter *>(typeConverter);
opEntryBlock.walk<WalkOrder::PreOrder>([&](Operation *op) {
Expand All @@ -137,7 +137,7 @@ class SecretGenericOpTypeConversion
}
});

rewriter.finalizeRootUpdate(op);
rewriter.finalizeOpModification(op);

// Inline the secret.generic internal region, moving all of the operations
// to the parent region.
Expand Down
6 changes: 3 additions & 3 deletions lib/Dialect/Secret/IR/SecretPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ LogicalResult RemoveUnusedGenericArgs::matchAndRewrite(
BlockArgument arg = body->getArguments()[i];
if (arg.use_empty()) {
hasUnusedOps = true;
rewriter.updateRootInPlace(op, [&]() {
rewriter.modifyOpInPlace(op, [&]() {
body->eraseArgument(i);
op.getOperation()->eraseOperand(i);
});
Expand Down Expand Up @@ -129,7 +129,7 @@ LogicalResult RemoveNonSecretGenericArgs::matchAndRewrite(
BlockArgument correspondingArg = body->getArgument(i);

rewriter.replaceAllUsesWith(correspondingArg, op->getOperand(i));
rewriter.updateRootInPlace(op, [&]() {
rewriter.modifyOpInPlace(op, [&]() {
body->eraseArgument(i);
op.getOperation()->eraseOperand(i);
});
Expand Down Expand Up @@ -179,7 +179,7 @@ LogicalResult CaptureAmbientScope::matchAndRewrite(
}

Value value = *foundValue;
rewriter.updateRootInPlace(genericOp, [&]() {
rewriter.modifyOpInPlace(genericOp, [&]() {
BlockArgument newArg =
genericOp.getBody()->addArgument(value.getType(), genericOp.getLoc());
rewriter.replaceUsesWithIf(value, newArg, [&](mlir::OpOperand &operand) {
Expand Down
6 changes: 3 additions & 3 deletions lib/Dialect/Secret/Transforms/DistributeGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct SplitGeneric : public OpRewritePattern<GenericOp> {
// Terminators of the region are not part of the secret, since they just
// handle control flow.

rewriter.startRootUpdate(genericOp);
rewriter.startOpModification(genericOp);

LLVM_DEBUG(genericOp.emitRemark()
<< "Generic op at start of distributeThroughRegionHoldingOp");
Expand Down Expand Up @@ -239,7 +239,7 @@ struct SplitGeneric : public OpRewritePattern<GenericOp> {
LLVM_DEBUG(genericOp->getParentOp()->emitRemark()
<< "after updating cloned loop yield op");

rewriter.finalizeRootUpdate(genericOp);
rewriter.finalizeOpModification(genericOp);

// To replace the original secret.generic, we need to find a suitable
// replacement for any of its result values. There are two cases:
Expand Down Expand Up @@ -456,7 +456,7 @@ struct SplitGeneric : public OpRewritePattern<GenericOp> {
// and replace all uses of the opToDistribute's results with the created
// block arguments.
SmallVector<Value> oldGenericNewBlockArgs;
rewriter.updateRootInPlace(genericOp, [&]() {
rewriter.modifyOpInPlace(genericOp, [&]() {
genericOp.getInputsMutable().append(newGeneric.getResults());
for (auto ty : firstOp.getResultTypes()) {
BlockArgument arg =
Expand Down

0 comments on commit ea8e2f3

Please sign in to comment.