From b6a111c2d9a8f98a1cfe34651f392dbd6c1c4a58 Mon Sep 17 00:00:00 2001 From: William Chen Date: Tue, 1 Mar 2022 15:13:28 -0800 Subject: [PATCH] Use unordered set for set in reaching.cpp to improve compile time --- Makefile | 4 ++++ .../maple_be/src/cg/aarch64/aarch64_prop.cpp | 3 ++- src/mapleall/maple_be/src/cg/reaching.cpp | 16 ++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 250f27b5c0..2c0c408ec4 100644 --- a/Makefile +++ b/Makefile @@ -158,6 +158,10 @@ ctorture-ci: ctorture: (cd third_party/ctorture; git checkout .; git pull; ./run.sh work.list) +.PHONY: ctorture2 +ctorture2: + (cd third_party/ctorture; git checkout .; git pull; ./run.sh work.list hir2mpl) + THREADS := 50 ifneq ($(findstring test,$(MAKECMDGOALS)),) TESTTARGET := $(MAKECMDGOALS) diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_prop.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_prop.cpp index aefefd1788..584c73a855 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_prop.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_prop.cpp @@ -201,7 +201,8 @@ bool A64ConstProp::ArithmeticConstReplace(DUInsnInfo &useDUInfo, AArch64ImmOpera auto *tempImm = static_cast(constOpnd.Clone(*constPropMp)); /* try aarch64 imm shift mode */ tempImm->SetValue(tempImm->GetValue() >> 12); - if (static_cast(cgFunc)->IsOperandImmValid(newMop, tempImm, kInsnThirdOpnd)) { + if (static_cast(cgFunc)->IsOperandImmValid(newMop, tempImm, kInsnThirdOpnd) && + CGOptions::GetInstance().GetOptimizeLevel() < 0) { ASSERT(false, "NIY"); } /* Addition and subtraction reversal */ diff --git a/src/mapleall/maple_be/src/cg/reaching.cpp b/src/mapleall/maple_be/src/cg/reaching.cpp index e41a87217d..72c6fa87e3 100644 --- a/src/mapleall/maple_be/src/cg/reaching.cpp +++ b/src/mapleall/maple_be/src/cg/reaching.cpp @@ -604,8 +604,8 @@ void ReachingDefinition::InitDataSize() { /* compute bb->in, bb->out for each BB execpt cleanup BB */ void ReachingDefinition::BuildInOutForFuncBody() { - std::set normalBBSetBak(normalBBSet.begin(), normalBBSet.end()); - std::set::iterator setItr; + std::unordered_set normalBBSetBak(normalBBSet.begin(), normalBBSet.end()); + std::unordered_set::iterator setItr; while (!normalBBSetBak.empty()) { setItr = normalBBSetBak.begin(); BB *bb = *setItr; @@ -634,8 +634,8 @@ void ReachingDefinition::UpdateInOut(BB &changedBB) { return; } - std::set bbSet; - std::set::iterator setItr; + std::unordered_set bbSet; + std::unordered_set::iterator setItr; for (auto succ : changedBB.GetSuccs()) { (void)bbSet.insert(succ); @@ -727,8 +727,8 @@ void ReachingDefinition::BuildInOutForCleanUpBB() { if (GenerateInForFirstCleanUpBB()) { GenerateOut(*firstCleanUpBB); } - std::set cleanupBBSetBak(cleanUpBBSet.begin(), cleanUpBBSet.end()); - std::set::iterator setItr; + std::unordered_set cleanupBBSetBak(cleanUpBBSet.begin(), cleanUpBBSet.end()); + std::unordered_set::iterator setItr; while (!cleanupBBSetBak.empty()) { setItr = cleanupBBSetBak.begin(); @@ -753,8 +753,8 @@ void ReachingDefinition::BuildInOutForCleanUpBB(bool isReg, const std::set cleanupBBSetBak(cleanUpBBSet.begin(), cleanUpBBSet.end()); - std::set::iterator setItr; + std::unordered_set cleanupBBSetBak(cleanUpBBSet.begin(), cleanUpBBSet.end()); + std::unordered_set::iterator setItr; while (!cleanupBBSetBak.empty()) { setItr = cleanupBBSetBak.begin(); BB *bb = *setItr; -- Gitee