コード例 #1
0
        protected override void Run()
        {
            if (!HasCode)
            {
                return;
            }

            if (!MethodCompiler.IsInSSAForm)
            {
                return;
            }

            if (HasProtectedRegions)
            {
                return;
            }

            var analysis = new SparseConditionalConstantPropagation(BasicBlocks, CreateTraceLog);

            var deadBlocks = analysis.GetDeadBlocked();
            var constants  = analysis.GetIntegerConstants();

            RemoveDeadBlocks(deadBlocks);
            ReplaceVirtualRegistersWithConstants(constants);

            ConstantCount.Set(constants.Count);
            DeadBlockCount.Set(deadBlocks.Count);

            if (CompilerSettings.FullCheckMode)
            {
                CheckAllPhiInstructions();
            }
        }
コード例 #2
0
        protected override void Run()
        {
            var analysis = new SparseConditionalConstantPropagation(BasicBlocks, this);

            var deadBlocks = analysis.GetDeadBlocked();
            var constants  = analysis.GetIntegerConstants();

            RemoveDeadBlocks(deadBlocks);
            ReplaceVirtualRegistersWithConstants(constants);

            ConstantCount.Set(constants.Count);
            DeadBlockCount.Set(deadBlocks.Count);
        }
コード例 #3
0
        protected override void Run()
        {
            var analysis = new SparseConditionalConstantPropagation(BasicBlocks, this);

            var deadBlocks = analysis.GetDeadBlocked();
            var constants  = analysis.GetIntegerConstants();

            ReplaceVirtualRegistersWithConstants(constants);
            RemoveDeadBlocks(deadBlocks);

            UpdateCounter("ConditionalConstantPropagation.ConstantVariableCount", constants.Count);
            UpdateCounter("ConditionalConstantPropagation.ConstantVariableUse", conditionalConstantPropagation);
            UpdateCounter("ConditionalConstantPropagation.DeadBlocks", deadBlocks.Count);
            UpdateCounter("ConditionalConstantPropagation.IRInstructionRemoved", instructionsRemovedCount);
        }
コード例 #4
0
        protected override void Run()
        {
            if (!HasCode)
            {
                return;
            }

            if (HasProtectedRegions)
            {
                return;
            }

            var analysis = new SparseConditionalConstantPropagation(BasicBlocks, CreateTraceLog);

            var deadBlocks = analysis.GetDeadBlocked();
            var constants  = analysis.GetIntegerConstants();

            RemoveDeadBlocks(deadBlocks);
            ReplaceVirtualRegistersWithConstants(constants);

            ConstantCount.Set(constants.Count);
            DeadBlockCount.Set(deadBlocks.Count);
        }