Skip to content

FOOBAR #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions empty
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
empty
8 changes: 4 additions & 4 deletions mlir/include/mlir/IR/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ class Value {

/// If this value is the result of an operation, return the operation that
/// defines it.
Operation *getDefiningOp() const;
Operation *getDefiningOp();

/// If this value is the result of an operation of type OpTy, return the
/// operation that defines it.
template <typename OpTy>
OpTy getDefiningOp() const {
OpTy getDefiningOp() {
return llvm::dyn_cast_or_null<OpTy>(getDefiningOp());
}

Expand All @@ -158,12 +158,12 @@ class Value {
//===--------------------------------------------------------------------===//

/// Drop all uses of this object from their respective owners.
void dropAllUses() const { return impl->dropAllUses(); }
void dropAllUses() { return impl->dropAllUses(); }

/// Replace all uses of 'this' value with the new value, updating anything in
/// the IR that uses 'this' to use the other value instead. When this returns
/// there are zero uses of 'this'.
void replaceAllUsesWith(Value newValue) const {
void replaceAllUsesWith(Value newValue) {
impl->replaceAllUsesWith(newValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static LogicalResult legalizeBlockArguments(Block &block, Operation *op,
const TypeConverter &converter) {
auto builder = OpBuilder::atBlockBegin(&block);
for (unsigned i = 0; i < block.getNumArguments(); ++i) {
const auto arg = block.getArgument(i);
BlockArgument arg = block.getArgument(i);
if (converter.isLegal(arg.getType()))
continue;
Type ty = arg.getType();
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/IR/Value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using namespace mlir::detail;

/// If this value is the result of an Operation, return the operation that
/// defines it.
Operation *Value::getDefiningOp() const {
Operation *Value::getDefiningOp() {
if (auto result = llvm::dyn_cast<OpResult>(*this))
return result.getOwner();
return nullptr;
Expand Down