From 569128fc0fdd714466c416dffe9effba7b7d7d03 Mon Sep 17 00:00:00 2001 From: chakrabot Date: Wed, 9 Aug 2017 03:02:46 -0700 Subject: [PATCH] [Merge Microsoft/Chakracore@177a7beaae] [1.6>1.7] [MERGE #3496 @MikeHolman] remove invalid special case in regalloc Merge pull request #3496 from MikeHolman:regalloc We had special case in regalloc if we are storing to a tmp reg and the next instr has the same dst, we don't need to insert a store. Unfortunately, this is invalid in case the sym is also a source of the next instr. Benchmark perf is flat. OS: 11480955 --- deps/chakrashim/core/lib/Backend/LinearScan.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/deps/chakrashim/core/lib/Backend/LinearScan.cpp b/deps/chakrashim/core/lib/Backend/LinearScan.cpp index 15708cccdd5..9736b4b3b27 100644 --- a/deps/chakrashim/core/lib/Backend/LinearScan.cpp +++ b/deps/chakrashim/core/lib/Backend/LinearScan.cpp @@ -886,7 +886,6 @@ LinearScan::SetDstReg(IR::Instr *instr) return; } - if (reg == RegNOREG) { IR::Opnd *src = instr->GetSrc1(); @@ -908,13 +907,7 @@ LinearScan::SetDstReg(IR::Instr *instr) if (!lifetime->isDeadStore && !lifetime->isSecondChanceAllocated) { // Insert a store since the lifetime is spilled - IR::Opnd *nextDst = instr->m_next->GetDst(); - - // Don't need the store however if the next instruction has the same dst - if (nextDst == nullptr || !nextDst->IsEqual(regOpnd)) - { - this->InsertStore(instr, regOpnd->m_sym, reg); - } + this->InsertStore(instr, regOpnd->m_sym, reg); } } else