From 18f104f8472f8abc6b850017aeb40753e3a8f7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=96stlund?= Date: Tue, 20 Jun 2023 18:26:45 +0200 Subject: [PATCH] Improve vectorization of bindings for the newbackend (#10875) - Turn on vectorization of bindings when `--newBackend` is used. - Fix vectorization of some cases by using the indexed prefix in flattenCrefSplitSubscripts instead of the non-indexed one. --- OMCompiler/Compiler/NFFrontEnd/NFFlatten.mo | 2 +- OMCompiler/Compiler/NFFrontEnd/NFInst.mo | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OMCompiler/Compiler/NFFrontEnd/NFFlatten.mo b/OMCompiler/Compiler/NFFrontEnd/NFFlatten.mo index 2b29fb12dab..b62b3643f8c 100644 --- a/OMCompiler/Compiler/NFFrontEnd/NFFlatten.mo +++ b/OMCompiler/Compiler/NFFrontEnd/NFFlatten.mo @@ -1427,7 +1427,7 @@ protected algorithm sub_map := UnorderedMap.new(InstNode.hash, InstNode.refEqual); - for cr in ComponentRef.toListReverse(Prefix.prefix(prefix)) loop + for cr in ComponentRef.toListReverse(Prefix.indexedPrefix(prefix)) loop if ComponentRef.hasSubscripts(cr) then UnorderedMap.addUnique(ComponentRef.node(cr), ComponentRef.getSubscripts(cr), sub_map); end if; diff --git a/OMCompiler/Compiler/NFFrontEnd/NFInst.mo b/OMCompiler/Compiler/NFFrontEnd/NFInst.mo index cf0c9d3470a..2d9fc96f055 100644 --- a/OMCompiler/Compiler/NFFrontEnd/NFInst.mo +++ b/OMCompiler/Compiler/NFFrontEnd/NFInst.mo @@ -297,6 +297,7 @@ function resetGlobalFlags algorithm if Flags.getConfigBool(Flags.NEW_BACKEND) then FlagsUtil.set(Flags.NF_SCALARIZE, false); + FlagsUtil.set(Flags.VECTORIZE_BINDINGS, true); end if; // gather here all the flags to disable expansion