shader: hand IR uses over at once on replacement and skip use lists at program teardown

This commit is contained in:
Senaxx authored and nmzik committed 2026-10-27 07:04:38 +01:00
1 parent 1ec69f8e7d
commit a526a8b9c9
4 files changed
+63 -23

No files matched your search

@@ -138,6 +138,8 @@ public:
void AddPhiOperand(Block* predecessor, Value value);
void ReplaceUsesWith(Value replacement, bool preserve = true);
void Invalidate();
// Drops the arguments without updating their use lists, for teardown that destroys both sides.
void DropArgs();
template <typename T>
requires(sizeof(T) <= sizeof(uint64_t) && std::is_trivially_copyable_v<T>)
@@ -157,6 +159,8 @@ public:
private:
friend void EliminateDeadCode(const std::vector<Block*>& blocks);
template <typename Self>
static auto& ArgSlot(Self& self, size_t index);
void AddUse(Inst* used, size_t operand);
void RemoveUse(Inst* used, size_t operand);
void ClearArgs();