[Mlir-commits] [mlir] [mlir][side effect] refactor(*): Include more precise side effects (PR #94213)
Matthias Springer
llvmlistbot at llvm.org
Tue Jun 4 12:11:41 PDT 2024
================
@@ -199,7 +217,17 @@ class EffectInstance {
/// Return the value the effect is applied on, or nullptr if there isn't a
/// known value being affected.
Value getValue() const {
- return value ? llvm::dyn_cast_if_present<Value>(value) : Value();
+ if (!value || llvm::isa_and_present<SymbolRefAttr>(value)) {
+ return Value();
+ }
+ if (Value v = llvm::dyn_cast_if_present<Value>(value)) {
+ return v;
+ }
+ return cast_if_present<OpOperand *>(value)->get();
+ }
+
+ OpOperand *getOpOperand() const {
----------------
matthias-springer wrote:
Comment needed, should also describe when this returns `nullptr`.
https://github.com/llvm/llvm-project/pull/94213
More information about the Mlir-commits
mailing list