From 6bab227860a6873204141e5ec9b14ed08d77fc62 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 18 Sep 2023 21:53:32 -0700 Subject: Do not optimize tuple locals in StackIR local2stack (#5958) This Stack IR optimization is not compatible with a much more powerful optimization we plan to do for tuples in the binary writer. --- src/passes/StackIR.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/passes/StackIR.cpp') diff --git a/src/passes/StackIR.cpp b/src/passes/StackIR.cpp index 438ed8b55..bc91d0703 100644 --- a/src/passes/StackIR.cpp +++ b/src/passes/StackIR.cpp @@ -194,7 +194,11 @@ private: // This is something we should handle, look into it. if (inst->type.isConcrete()) { bool optimized = false; - if (auto* get = inst->origin->dynCast()) { + // Do not optimize multivalue locals, since those will be better + // optimized when they are visited in the binary writer and this + // optimization would intefere with that one. + if (auto* get = inst->origin->dynCast(); + get && inst->type.isSingle()) { // This is a potential optimization opportunity! See if we // can reach the set. if (values.size() > 0) { -- cgit v1.2.3