From ec3723e9e10a79289424958ae2028771ac46bb46 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 | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp b/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp index 3640f66d5b..24d34aa5a4 100644 --- a/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp +++ b/FEXCore/Source/Interface/IR/Passes/ConstProp.cpp @@ -79,15 +79,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 +570,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: