intel / intel/mlir-extensions

Is there any problem with the "remove-temporaries" pass

Open
#1,115 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MLIR
Stars
156
Forks
45
Avg merge
4h 14m
Merged PRs (30d)
22

Description

```
/// Check whether `op` can have a write effect on value `val`
static bool opHasWriteEffect(::mlir::Value val, ::mlir::Operation *op) {
// Check whether the operation `op` has write effect on the memory.
if (!llvm::is_contained(val.getUsers(), op))
return false;
if (auto memEffect = ::mlir::dyn_cast<::mlir::MemoryEffectOpInterface>(op)) {
::mlir::SmallVector<::mlir::MemoryEffects::EffectInstance, 1> effects;
memEffect.getEffects(effects);
return llvm::any_of(
effects, [](::mlir::MemoryEffects::EffectInstance effect) {
return ::mlir::isa<::mlir::MemoryEffects::Write>(effect.getEffect());
});
}
// Op does not implement the interface, assume effect is present
return true;
}
```
This function not only finds the op written to val, but also the op written from val to other memory. However, according to the meaning of the comment, it should only find the op written to val. Is this an error in the comment or in the code implementation?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.