mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
711b3d653c
Summary: This patch remove waymarking and replaces it with storing a pointer to the User in the Use. here are the results on the measurements for the CTMark tests of the test suite. ``` Metric: instructions_count Program baseline patched diff test-suite :: CTMark/ClamAV/clamscan.test 72557942065 71733653521 -1.1% test-suite :: CTMark/sqlite3/sqlite3.test 76281422939 75484840636 -1.0% test-suite :: CTMark/consumer-typeset/consumer-typeset.test 51364676366 50862185614 -1.0% test-suite :: CTMark/SPASS/SPASS.test 60476106505 59908437767 -0.9% test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test 112578442329 111725050856 -0.8% test-suite :: CTMark/mafft/pairlocalalign.test 50846133013 50473644539 -0.7% test-suite :: CTMark/kimwitu++/kc.test 54692641250 54349070299 -0.6% test-suite :: CTMark/7zip/7zip-benchmark.test 182216614747 181216091230 -0.5% test-suite :: CTMark/Bullet/bullet.test 123459210616 122905866767 -0.4% Geomean difference -0.8% Metric: peak_memory_use Program baseline patched diff test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test 326864 338524 3.6% test-suite :: CTMark/sqlite3/sqlite3.test 216412 221240 2.2% test-suite :: CTMark/7zip/7zip-benchmark.test 11808284 12022604 1.8% test-suite :: CTMark/Bullet/bullet.test 6831752 6945988 1.7% test-suite :: CTMark/SPASS/SPASS.test 2682552 2721820 1.5% test-suite :: CTMark/ClamAV/clamscan.test 5037256 5107936 1.4% test-suite :: CTMark/consumer-typeset/consumer-typeset.test 2752728 2790768 1.4% test-suite :: CTMark/mafft/pairlocalalign.test 1517676 1537244 1.3% test-suite :: CTMark/kimwitu++/kc.test 1090748 1103448 1.2% Geomean difference 1.8% Metric: compile_time Program baseline patched diff test-suite :: CTMark/consumer-typeset/consumer-typeset.test 14.71 14.38 -2.2% test-suite :: CTMark/sqlite3/sqlite3.test 23.18 22.73 -2.0% test-suite :: CTMark/7zip/7zip-benchmark.test 57.96 56.99 -1.7% test-suite :: CTMark/ClamAV/clamscan.test 20.75 20.49 -1.2% test-suite :: CTMark/kimwitu++/kc.test 18.35 18.15 -1.1% test-suite :: CTMark/SPASS/SPASS.test 18.72 18.57 -0.8% test-suite :: CTMark/mafft/pairlocalalign.test 14.09 14.00 -0.6% test-suite :: CTMark/Bullet/bullet.test 37.38 37.19 -0.5% test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test 33.81 33.76 -0.2% Geomean difference -1.1% ``` i believe that it is worth trading +1.8% peak memory use for -1.1% compile time. also this patch removes waymarking which simplifies the Use and User classes. Reviewers: nikic, lattner Reviewed By: lattner Subscribers: russell.gallop, foad, ggreif, rriddle, ekatz, fhahn, lebedev.ri, mgorny, hiraditya, george.burgess.iv, asbirlea, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77144
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
//===-- Use.cpp - Implement the Use class ---------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/IR/Use.h"
|
|
#include "llvm/IR/User.h"
|
|
#include "llvm/IR/Value.h"
|
|
#include <new>
|
|
|
|
namespace llvm {
|
|
|
|
void Use::swap(Use &RHS) {
|
|
if (Val == RHS.Val)
|
|
return;
|
|
|
|
if (Val)
|
|
removeFromList();
|
|
|
|
Value *OldVal = Val;
|
|
if (RHS.Val) {
|
|
RHS.removeFromList();
|
|
Val = RHS.Val;
|
|
Val->addUse(*this);
|
|
} else {
|
|
Val = nullptr;
|
|
}
|
|
|
|
if (OldVal) {
|
|
RHS.Val = OldVal;
|
|
RHS.Val->addUse(RHS);
|
|
} else {
|
|
RHS.Val = nullptr;
|
|
}
|
|
}
|
|
|
|
unsigned Use::getOperandNo() const {
|
|
return this - getUser()->op_begin();
|
|
}
|
|
|
|
void Use::zap(Use *Start, const Use *Stop, bool del) {
|
|
while (Start != Stop)
|
|
(--Stop)->~Use();
|
|
if (del)
|
|
::operator delete(Start);
|
|
}
|
|
|
|
} // End llvm namespace
|