Skip to content

Commit

Permalink
Migrate away from llvm::StringRef::equals
Browse files Browse the repository at this point in the history
Note that llvm::StringRef::equals has been deprecated upstream.

PiperOrigin-RevId: 636616762
  • Loading branch information
tensorflower-gardener committed May 23, 2024
1 parent 551643f commit fa9ed30
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions third_party/xla/xla/python/refine_polymorphic_shapes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct CheckShapeAssertionsPass
void runOnOperation() final {
mlir::func::FuncOp func_op = getOperation();
func_op.walk([this](mlir::stablehlo::CustomCallOp op) {
if (!op.getCallTargetName().equals(shapeAssertionName)) return;
if (op.getCallTargetName() != shapeAssertionName) return;
if (!enable_shape_assertions) {
op.erase();
return;
Expand Down Expand Up @@ -147,7 +147,7 @@ struct CheckShapeAssertionsPass
}
if (!op.getBackendConfig().empty())
return op.emitError() << "expects an empty backend_config";
if (!op.getCallTargetName().equals(shapeAssertionName))
if (op.getCallTargetName() != shapeAssertionName)
return op.emitError() << "expects @shape_assertion";
if (!op.getHasSideEffect())
return op.emitError() << "expects has_side_effect=true";
Expand Down Expand Up @@ -334,8 +334,7 @@ absl::Status ValidateStaticShapes(mlir::ModuleOp module) {
}

auto customCall = mlir::dyn_cast<mlir::stablehlo::CustomCallOp>(op);
if (customCall &&
customCall.getCallTargetName().equals(shapeAssertionName)) {
if (customCall && customCall.getCallTargetName() == shapeAssertionName) {
moduleHasShapeAssertions = true;
op->emitOpError() << "has residual shape assertions";
}
Expand Down

0 comments on commit fa9ed30

Please sign in to comment.