diff --git a/src/frontend/ir/value.cpp b/src/frontend/ir/value.cpp index 1ba7fe5b..0c7f780a 100644 --- a/src/frontend/ir/value.cpp +++ b/src/frontend/ir/value.cpp @@ -110,6 +110,13 @@ Inst* Value::GetInst() const { return inner.inst; } +Inst* Value::GetInstRecursive() const { + ASSERT(type == Type::Opaque); + if (IsIdentity()) + return inner.inst->GetArg(0).GetInstRecursive(); + return inner.inst; +} + bool Value::GetU1() const { if (IsIdentity()) return inner.inst->GetArg(0).GetU1(); diff --git a/src/frontend/ir/value.h b/src/frontend/ir/value.h index 3b1d8b08..906428e4 100644 --- a/src/frontend/ir/value.h +++ b/src/frontend/ir/value.h @@ -55,6 +55,7 @@ public: Type GetType() const; Inst* GetInst() const; + Inst* GetInstRecursive() const; A32::Reg GetA32RegRef() const; A32::ExtReg GetA32ExtRegRef() const; A64::Reg GetA64RegRef() const;