Skip to content

Commit

Permalink
merge main into amd-stg-open
Browse files Browse the repository at this point in the history
Change-Id: I957e113360905fca5ad1eda19440d482b70bdd3a
  • Loading branch information
ronlieb committed Oct 25, 2023
2 parents 35c7ec5 + 35d771f commit fce0960
Show file tree
Hide file tree
Showing 215 changed files with 2,786 additions and 2,008 deletions.
2 changes: 1 addition & 1 deletion bolt/lib/Passes/HFSortPlus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class HFSortPlus {
Into->Score = score(Into);

// Remove chain From From the list of active chains
llvm::erase_value(HotChains, From);
llvm::erase(HotChains, From);
}

private:
Expand Down
2 changes: 1 addition & 1 deletion bolt/lib/Passes/IndirectCallPromotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ IndirectCallPromotion::findCallTargetSymbols(std::vector<Callsite> &Targets,

NewTargets.push_back(Target);
std::vector<uint64_t>({JTIndex}).swap(NewTargets.back().JTIndices);
llvm::erase_value(Target.JTIndices, JTIndex);
llvm::erase(Target.JTIndices, JTIndex);

// Keep fixCFG counts sane if more indices use this same target later
assert(IndicesPerTarget[Target.To.Sym] > 0 && "wrong map");
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/FindTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ class ExplicitReferenceCollector
void reportReference(ReferenceLoc &&Ref, DynTypedNode N) {
// Strip null targets that can arise from invalid code.
// (This avoids having to check for null everywhere we insert)
llvm::erase_value(Ref.Targets, nullptr);
llvm::erase(Ref.Targets, nullptr);
// Our promise is to return only references from the source code. If we lack
// location information, skip these nodes.
// Normally this should not happen in practice, unless there are bugs in the
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/SystemIncludeExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ extractSystemIncludesAndTarget(const DriverArgs &InputArgs,
auto Path = llvm::StringRef(*BuiltinHeaders).trim();
if (!Path.empty() && llvm::sys::path::is_absolute(Path)) {
auto Size = Info->SystemIncludes.size();
llvm::erase_value(Info->SystemIncludes, Path);
llvm::erase(Info->SystemIncludes, Path);
vlog("System includes extractor: builtin headers {0} {1}", Path,
(Info->SystemIncludes.size() != Size)
? "excluded"
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Analysis/Analyses/Dominators.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ struct ChildrenGetterTy<clang::CFGBlock, IsPostDom> {

auto Children = children<OrderedNodeTy>(N);
ChildrenTy Ret{Children.begin(), Children.end()};
llvm::erase_value(Ret, nullptr);
llvm::erase(Ret, nullptr);
return Ret;
}
};
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/JsonSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ inline std::string JsonFormat(StringRef RawSR, bool AddQuotes) {
}

// Remove new-lines.
llvm::erase_value(Str, '\n');
llvm::erase(Str, '\n');

if (!AddQuotes)
return Str;
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Sema/ScopeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ class LambdaScopeInfo final :
return NonODRUsedCapturingExprs.count(CapturingVarExpr);
}
void removePotentialCapture(Expr *E) {
llvm::erase_value(PotentiallyCapturingExprs, E);
llvm::erase(PotentiallyCapturingExprs, E);
}
void clearPotentialCaptures() {
PotentiallyCapturingExprs.clear();
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ void ASTContext::deduplicateMergedDefinitonsFor(NamedDecl *ND) {
for (Module *&M : Merged)
if (!Found.insert(M).second)
M = nullptr;
llvm::erase_value(Merged, nullptr);
llvm::erase(Merged, nullptr);
}

ArrayRef<Module *>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ computeBlockInputState(const CFGBlock &Block, AnalysisContext &AC) {
auto &StmtToBlock = AC.CFCtx.getStmtToBlock();
auto StmtBlock = StmtToBlock.find(Block.getTerminatorStmt());
assert(StmtBlock != StmtToBlock.end());
llvm::erase_value(Preds, StmtBlock->getSecond());
llvm::erase(Preds, StmtBlock->getSecond());
}
}

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18303,7 +18303,7 @@ void Sema::CheckUnusedVolatileAssignment(Expr *E) {
if (auto *BO = dyn_cast<BinaryOperator>(E->IgnoreParenImpCasts())) {
if (BO->getOpcode() == BO_Assign) {
auto &LHSs = ExprEvalContexts.back().VolatileAssignmentLHSs;
llvm::erase_value(LHSs, BO->getLHS());
llvm::erase(LHSs, BO->getLHS());
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions compiler-rt/lib/builtins/divxc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@

// Returns: the quotient of (a + ib) / (c + id)

COMPILER_RT_ABI Lcomplex __divxc3(long double __a, long double __b,
long double __c, long double __d) {
COMPILER_RT_ABI Lcomplex __divxc3(xf_float __a, xf_float __b, xf_float __c,
xf_float __d) {
int __ilogbw = 0;
long double __logbw = crt_logbl(crt_fmaxl(crt_fabsl(__c), crt_fabsl(__d)));
xf_float __logbw = crt_logbl(crt_fmaxl(crt_fabsl(__c), crt_fabsl(__d)));
if (crt_isfinite(__logbw)) {
__ilogbw = (int)__logbw;
__c = crt_scalbnl(__c, -__ilogbw);
__d = crt_scalbnl(__d, -__ilogbw);
}
long double __denom = __c * __c + __d * __d;
xf_float __denom = __c * __c + __d * __d;
Lcomplex z;
COMPLEX_REAL(z) = crt_scalbnl((__a * __c + __b * __d) / __denom, -__ilogbw);
COMPLEX_IMAGINARY(z) =
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/extendxftf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define DST_QUAD
#include "fp_extend_impl.inc"

COMPILER_RT_ABI tf_float __extendxftf2(long double a) {
COMPILER_RT_ABI tf_float __extendxftf2(xf_float a) {
return __extendXfYf2__(a);
}

Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/fixunsxfdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#pragma warning(disable : 4700)
#endif

COMPILER_RT_ABI du_int __fixunsxfdi(long double a) {
long_double_bits fb;
COMPILER_RT_ABI du_int __fixunsxfdi(xf_float a) {
xf_bits fb;
fb.f = a;
int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
if (e < 0 || (fb.u.high.s.low & 0x00008000))
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/fixunsxfsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#pragma warning(disable : 4700)
#endif

COMPILER_RT_ABI su_int __fixunsxfsi(long double a) {
long_double_bits fb;
COMPILER_RT_ABI su_int __fixunsxfsi(xf_float a) {
xf_bits fb;
fb.f = a;
int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
if (e < 0 || (fb.u.high.s.low & 0x00008000))
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/fixunsxfti.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm

COMPILER_RT_ABI tu_int __fixunsxfti(long double a) {
long_double_bits fb;
COMPILER_RT_ABI tu_int __fixunsxfti(xf_float a) {
xf_bits fb;
fb.f = a;
int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
if (e < 0 || (fb.u.high.s.low & 0x00008000))
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/fixxfdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
#pragma warning(disable : 4700)
#endif

COMPILER_RT_ABI di_int __fixxfdi(long double a) {
COMPILER_RT_ABI di_int __fixxfdi(xf_float a) {
const di_int di_max = (di_int)((~(du_int)0) / 2);
const di_int di_min = -di_max - 1;
long_double_bits fb;
xf_bits fb;
fb.f = a;
int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
if (e < 0)
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/fixxfti.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm

COMPILER_RT_ABI ti_int __fixxfti(long double a) {
COMPILER_RT_ABI ti_int __fixxfti(xf_float a) {
const ti_int ti_max = (ti_int)((~(tu_int)0) / 2);
const ti_int ti_min = -ti_max - 1;
long_double_bits fb;
xf_bits fb;
fb.f = a;
int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
if (e < 0)
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/floatdixf.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm

COMPILER_RT_ABI long double __floatdixf(di_int a) {
COMPILER_RT_ABI xf_float __floatdixf(di_int a) {
if (a == 0)
return 0.0;
const unsigned N = sizeof(di_int) * CHAR_BIT;
const di_int s = a >> (N - 1);
a = (a ^ s) - s;
int clz = __builtin_clzll(a);
int e = (N - 1) - clz; // exponent
long_double_bits fb;
xf_bits fb;
fb.u.high.s.low = ((su_int)s & 0x00008000) | // sign
(e + 16383); // exponent
fb.u.low.all = a << clz; // mantissa
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/floattixf.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm

COMPILER_RT_ABI long double __floattixf(ti_int a) {
COMPILER_RT_ABI xf_float __floattixf(ti_int a) {
if (a == 0)
return 0.0;
const unsigned N = sizeof(ti_int) * CHAR_BIT;
Expand Down Expand Up @@ -63,7 +63,7 @@ COMPILER_RT_ABI long double __floattixf(ti_int a) {
a <<= (LDBL_MANT_DIG - sd);
// a is now rounded to LDBL_MANT_DIG bits
}
long_double_bits fb;
xf_bits fb;
fb.u.high.s.low = ((su_int)s & 0x8000) | // sign
(e + 16383); // exponent
fb.u.low.all = (du_int)a; // mantissa
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/floatundixf.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm
COMPILER_RT_ABI long double __floatundixf(du_int a) {
COMPILER_RT_ABI xf_float __floatundixf(du_int a) {
if (a == 0)
return 0.0;
const unsigned N = sizeof(du_int) * CHAR_BIT;
int clz = __builtin_clzll(a);
int e = (N - 1) - clz; // exponent
long_double_bits fb;
xf_bits fb;
fb.u.high.s.low = (e + 16383); // exponent
fb.u.low.all = a << clz; // mantissa
return fb.f;
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/floatuntixf.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm

COMPILER_RT_ABI long double __floatuntixf(tu_int a) {
COMPILER_RT_ABI xf_float __floatuntixf(tu_int a) {
if (a == 0)
return 0.0;
const unsigned N = sizeof(tu_int) * CHAR_BIT;
Expand Down Expand Up @@ -61,7 +61,7 @@ COMPILER_RT_ABI long double __floatuntixf(tu_int a) {
a <<= (LDBL_MANT_DIG - sd);
// a is now rounded to LDBL_MANT_DIG bits
}
long_double_bits fb;
xf_bits fb;
fb.u.high.s.low = (e + 16383); // exponent
fb.u.low.all = (du_int)a; // mantissa
return fb.f;
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/fp_extend.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static inline int src_rep_t_clz_impl(src_rep_t a) {
#define src_rep_t_clz src_rep_t_clz_impl

#elif defined SRC_80
typedef long double src_t;
typedef xf_float src_t;
typedef __uint128_t src_rep_t;
#define SRC_REP_C (__uint128_t)
// sign bit, exponent and significand occupy the lower 80 bits.
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/fp_trunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static const int dstSigFracBits = 52;
static const int dstExpBits = 11;

#elif defined DST_80
typedef long double dst_t;
typedef xf_float dst_t;
typedef __uint128_t dst_rep_t;
#define DST_REP_C (__uint128_t)
static const int dstBits = 80;
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/i386/floatdixf.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "../assembly.h"

// long double __floatdixf(di_int a);
// xf_float __floatdixf(di_int a);

#ifdef __i386__

Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/i386/floatundixf.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "../assembly.h"

// long double __floatundixf(du_int a);16
// xf_float __floatundixf(du_int a);16

#ifdef __i386__

Expand Down
13 changes: 8 additions & 5 deletions compiler-rt/lib/builtins/int_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ typedef struct {
#define HAS_80_BIT_LONG_DOUBLE 0
#endif

#if HAS_80_BIT_LONG_DOUBLE
typedef long double xf_float;
typedef union {
uqwords u;
xf_float f;
} xf_bits;
#endif

#ifdef __powerpc64__
// From https://gcc.gnu.org/wiki/Ieee128PowerPC:
// PowerPC64 uses the following suffixes:
Expand Down Expand Up @@ -213,11 +221,6 @@ typedef union {
#endif

#if CRT_HAS_FLOATING_POINT
typedef union {
uqwords u;
long double f;
} long_double_bits;

#if __STDC_VERSION__ >= 199901L
typedef float _Complex Fcomplex;
typedef double _Complex Dcomplex;
Expand Down
12 changes: 6 additions & 6 deletions compiler-rt/lib/builtins/mulxc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

// Returns: the product of a + ib and c + id

COMPILER_RT_ABI Lcomplex __mulxc3(long double __a, long double __b,
long double __c, long double __d) {
long double __ac = __a * __c;
long double __bd = __b * __d;
long double __ad = __a * __d;
long double __bc = __b * __c;
COMPILER_RT_ABI Lcomplex __mulxc3(xf_float __a, xf_float __b, xf_float __c,
xf_float __d) {
xf_float __ac = __a * __c;
xf_float __bd = __b * __d;
xf_float __ad = __a * __d;
xf_float __bc = __b * __c;
Lcomplex z;
COMPLEX_REAL(z) = __ac - __bd;
COMPLEX_IMAGINARY(z) = __ad + __bc;
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/powixf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

// Returns: a ^ b

COMPILER_RT_ABI long double __powixf2(long double a, int b) {
COMPILER_RT_ABI xf_float __powixf2(xf_float a, int b) {
const int recip = b < 0;
long double r = 1;
xf_float r = 1;
while (1) {
if (b & 1)
r *= a;
Expand Down
4 changes: 1 addition & 3 deletions compiler-rt/lib/builtins/trunctfxf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#define DST_80
#include "fp_trunc_impl.inc"

COMPILER_RT_ABI long double __trunctfxf2(tf_float a) {
return __truncXfYf2__(a);
}
COMPILER_RT_ABI xf_float __trunctfxf2(tf_float a) { return __truncXfYf2__(a); }

#endif
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/x86_64/floatdixf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// long double __floatdixf(di_int a);
// xf_float __floatdixf(di_int a);

#ifdef __x86_64__

#include "../int_lib.h"

long double __floatdixf(int64_t a) { return (long double)a; }
xf_float __floatdixf(int64_t a) { return (xf_float)a; }

#endif // __i386__
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/x86_64/floatundixf.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "../assembly.h"

// long double __floatundixf(du_int a);
// xf_float __floatundixf(du_int a);

#ifdef __x86_64__

Expand Down
Loading

0 comments on commit fce0960

Please sign in to comment.