From e81a9aa5f92697cae90562c3e28d65db1d83d93d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 5 Sep 2024 09:40:00 -0400 Subject: [PATCH] ConstProp: stop pooling inline constants despite conventional wisdom, the robin map is slower than emitting extra nodes. without multiblock, shaves around 2% off node. with multiblock, a bit less than 1% but still a win. Signed-off-by: Alyssa Rosenzweig --- FEXCore/Source/Interface/IR/Passes/ConstProp.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp b/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp index 3640f66d5b..8448cf00b1 100644 --- a/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp +++ b/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp @@ -16,7 +16,6 @@ desc: ConstProp, ZExt elim, const pooling, fcmp reduction, const inlining #include #include #include -#include #include #include @@ -79,15 +78,8 @@ class ConstProp final : public FEXCore::IR::Pass { fextl::unordered_map ConstPool; - // Pool inline constant generation. These are typically very small and pool efficiently. - fextl::robin_map InlineConstantGen; Ref CreateInlineConstant(IREmitter* IREmit, uint64_t Constant) { - const auto it = InlineConstantGen.find(Constant); - if (it != InlineConstantGen.end()) { - return it->second; - } - auto Result = InlineConstantGen.insert_or_assign(Constant, IREmit->_InlineConstant(Constant)); - return Result.first->second; + return IREmit->_InlineConstant(Constant); } bool SupportsTSOImm9 {}; const FEXCore::CPUIDEmu* CPUID; @@ -577,8 +569,6 @@ void ConstProp::ConstantPropagation(IREmitter* IREmit, const IRListView& Current } void ConstProp::ConstantInlining(IREmitter* IREmit, const IRListView& CurrentIR) { - InlineConstantGen.clear(); - for (auto [CodeNode, IROp] : CurrentIR.GetAllCode()) { switch (IROp->Op) { case OP_LSHR: