Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3ee54a6
[DTLTO] [LLVM] Initial DTLTO cache implementation (#156433)
romanova-ekaterina Nov 17, 2025
c2ddaaa
[NFC][analyzer] Add missing documentation for `decodeValueOfObjCType`…
zeyi2 Nov 17, 2025
515924f
[X86] bittest-big-integer.ll - add BLSR style pattern test (#168356)
RKSimon Nov 17, 2025
6b464e4
[clang][SourceManager] Use `getFileLoc` when computing `getPresumedLo…
SergejSalnikov Nov 17, 2025
e3cfb17
Update Clang Maintainers (#168271)
steakhal Nov 17, 2025
ae2fec0
[mlir][bazel] Fix build after #167848. (#168366)
bchetioui Nov 17, 2025
e468ea3
[mlir][amdgpu] Fix documentation and verifiers (#167369)
amd-eochoalo Nov 17, 2025
ef023ca
Reland [VPlan] Expand WidenInt inductions with nuw/nsw (#168354)
artagnon Nov 17, 2025
fd1bdfd
Revert "[clang][SourceManager] Use `getFileLoc` when computing `getPr…
AaronBallman Nov 17, 2025
e70e9ec
[flang][OpenMP] Store Block in OpenMPLoopConstruct, add access functi…
kparzysz Nov 17, 2025
29e7b4f
[flang][NFC] Strip trailing whitespace from tests (5 of N)
tarunprabhu Nov 17, 2025
b6fd3c6
[X86] Enable APX and AVX10.2 on NVL (#168061)
mikolaj-pirog Nov 17, 2025
6eab083
[mlir][emitc] Refactor brackets in expressions (#168267)
aniragil Nov 17, 2025
9fe0a70
[llvm][RISCV] Support splat and vp_splat for zvfbfa codegen (#167920)
4vtomat Nov 17, 2025
53e3f8e
[XRay] Prefix setting XRAY_OPTIONS with env
boomanaiden154 Nov 17, 2025
e95c5c8
[libc++] Refactor basic_string::__recommend (#162631)
philnik777 Nov 17, 2025
c7a9be8
[XRay] Rewrite tests to not use subshells
boomanaiden154 Nov 17, 2025
e9743e2
[clang] Support constrained fp elementwise builtins (#166905)
ficol Nov 17, 2025
47c1aa4
[X86] Add constexpr support for addsub intrinsics (#167512)
ahmednoursphinx Nov 17, 2025
17cbb48
[MLIR] Apply clang-tidy fixes for readability-identifier-naming in Pa…
joker-eph Aug 21, 2025
38811be
[Flang] [OpenMP] Add support for spaces in between the name (#168311)
Thirumalai-Shaktivel Nov 17, 2025
d65be16
[AArch64][GlobalISel] Add combine for build_vector(unmerge, unmerge, …
HolyMolyCowMan Nov 17, 2025
ff7896e
[MLIR] Add verification that symbol operations must not have results …
timnoack Nov 17, 2025
498a01d
[Option] Use llvm::is_contained (NFC) (#168295)
kazutakahirata Nov 17, 2025
99bf41c
[TargetParser] Use range-based for loops (#168296)
kazutakahirata Nov 17, 2025
bf21156
[IPO] Remove a redundant cast (NFC) (#168297)
kazutakahirata Nov 17, 2025
dcf8cd9
[ADT] Consolidate the grow() logic in DenseMapBase (NFC) (#168316)
kazutakahirata Nov 17, 2025
3c54972
[ADT] Remove DenseMap::init (NFC) (#168322)
kazutakahirata Nov 17, 2025
5a5462d
merge main into amd-staging
z1-cciauto Nov 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang/Maintainers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ Clang static analyzer
| Balázs Benics
| benicsbalazs\@gmail.com (email), steakhal (Phabricator), steakhal (GitHub)
| balazs.benics\@sonarsource.com (email), balazs-benics-sonarsource (GitHub)
Compiler options
~~~~~~~~~~~~~~~~
Expand Down
19 changes: 18 additions & 1 deletion clang/docs/analyzer/checkers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ as error. Specifically on x86/x86-64 target if the pointer address space is
dereference is not defined as error. See `X86/X86-64 Language Extensions
<https://clang.llvm.org/docs/LanguageExtensions.html#memory-references-to-specified-segments>`__
for reference.

If the analyzer option ``suppress-dereferences-from-any-address-space`` is set
to true (the default value), then this checker never reports dereference of
pointers with a specified address space. If the option is set to false, then
Expand Down Expand Up @@ -1664,6 +1664,23 @@ Warn on uses of the 'bzero' function.
bzero(ptr, n); // warn
}

.. _security-insecureAPI-decodeValueOfObjCType:

security.insecureAPI.decodeValueOfObjCType (C)
""""""""""""""""""""""""""""""""""""""""""""""
Warn on uses of the Objective-C method ``-decodeValueOfObjCType:at:``.

.. code-block:: objc

void test(NSCoder *decoder) {
unsigned int x;
[decoder decodeValueOfObjCType:"I" at:&x]; // warn
}

This diagnostic is emitted only on Apple platforms where the safer
``-decodeValueOfObjCType:at:size:`` alternative is available
(iOS 11+, macOS 10.13+, tvOS 11+, watchOS 4.0+).

.. _security-insecureAPI-getpw:

security.insecureAPI.getpw (C)
Expand Down
18 changes: 14 additions & 4 deletions clang/include/clang/Basic/BuiltinsX86.td
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<128>] in {
def cmpsd : X86Builtin<"_Vector<2, double>(_Vector<2, double>, _Vector<2, double>, _Constant char)">;
}


let Features = "sse3" in {
let Features = "sse3",
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
foreach Op = ["addsub"] in {
def Op#ps : X86Builtin<"_Vector<4, float>(_Vector<4, float>, _Vector<4, float>)">;
def Op#pd : X86Builtin<"_Vector<2, double>(_Vector<2, double>, _Vector<2, double>)">;
Expand Down Expand Up @@ -121,8 +121,9 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<128>] in {
}

// AVX
let Attributes = [Const, NoThrow, RequiredVectorWidth<256>], Features = "avx" in {
foreach Op = ["addsub", "max", "min"] in {
let Attributes = [Const, NoThrow, RequiredVectorWidth<256>],
Features = "avx" in {
foreach Op = ["max", "min"] in {
def Op#pd256 : X86Builtin<"_Vector<4, double>(_Vector<4, double>, _Vector<4, double>)">;
def Op#ps256 : X86Builtin<"_Vector<8, float>(_Vector<8, float>, _Vector<8, float>)">;
}
Expand Down Expand Up @@ -571,6 +572,15 @@ let Features = "avx",
def movmskps256 : X86Builtin<"int(_Vector<8, float>)">;
}

let Features = "avx",
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
def addsubpd256
: X86Builtin<
"_Vector<4, double>(_Vector<4, double>, _Vector<4, double>)">;
def addsubps256
: X86Builtin<"_Vector<8, float>(_Vector<8, float>, _Vector<8, float>)">;
}

let Features = "avx", Attributes = [NoThrow] in {
def vzeroall : X86Builtin<"void()">;
def vzeroupper : X86Builtin<"void()">;
Expand Down
34 changes: 34 additions & 0 deletions clang/lib/AST/ByteCode/InterpBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2715,6 +2715,35 @@ static bool interp_builtin_horizontal_fp_binop(
return true;
}

static bool interp__builtin_ia32_addsub(InterpState &S, CodePtr OpPC,
const CallExpr *Call) {
// Addsub: alternates between subtraction and addition
// Result[i] = (i % 2 == 0) ? (a[i] - b[i]) : (a[i] + b[i])
const Pointer &RHS = S.Stk.pop<Pointer>();
const Pointer &LHS = S.Stk.pop<Pointer>();
const Pointer &Dst = S.Stk.peek<Pointer>();
FPOptions FPO = Call->getFPFeaturesInEffect(S.Ctx.getLangOpts());
llvm::RoundingMode RM = getRoundingMode(FPO);
const auto *VT = Call->getArg(0)->getType()->castAs<VectorType>();
unsigned NumElems = VT->getNumElements();

using T = PrimConv<PT_Float>::T;
for (unsigned I = 0; I != NumElems; ++I) {
APFloat LElem = LHS.elem<T>(I).getAPFloat();
APFloat RElem = RHS.elem<T>(I).getAPFloat();
if (I % 2 == 0) {
// Even indices: subtract
LElem.subtract(RElem, RM);
} else {
// Odd indices: add
LElem.add(RElem, RM);
}
Dst.elem<T>(I) = static_cast<T>(LElem);
}
Dst.initializeAllElements();
return true;
}

static bool interp__builtin_elementwise_triop_fp(
InterpState &S, CodePtr OpPC, const CallExpr *Call,
llvm::function_ref<APFloat(const APFloat &, const APFloat &,
Expand Down Expand Up @@ -4196,6 +4225,11 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
F.subtract(RHS, RM);
return F;
});
case clang::X86::BI__builtin_ia32_addsubpd:
case clang::X86::BI__builtin_ia32_addsubps:
case clang::X86::BI__builtin_ia32_addsubpd256:
case clang::X86::BI__builtin_ia32_addsubps256:
return interp__builtin_ia32_addsub(S, OpPC, Call);

case clang::X86::BI__builtin_ia32_pmuldq128:
case clang::X86::BI__builtin_ia32_pmuldq256:
Expand Down
29 changes: 29 additions & 0 deletions clang/lib/AST/ExprConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13373,6 +13373,35 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
}
return Success(APValue(ResultElements.data(), ResultElements.size()), E);
}
case clang::X86::BI__builtin_ia32_addsubpd:
case clang::X86::BI__builtin_ia32_addsubps:
case clang::X86::BI__builtin_ia32_addsubpd256:
case clang::X86::BI__builtin_ia32_addsubps256: {
// Addsub: alternates between subtraction and addition
// Result[i] = (i % 2 == 0) ? (a[i] - b[i]) : (a[i] + b[i])
APValue SourceLHS, SourceRHS;
if (!EvaluateAsRValue(Info, E->getArg(0), SourceLHS) ||
!EvaluateAsRValue(Info, E->getArg(1), SourceRHS))
return false;
unsigned NumElems = SourceLHS.getVectorLength();
SmallVector<APValue, 8> ResultElements;
ResultElements.reserve(NumElems);
llvm::RoundingMode RM = getActiveRoundingMode(getEvalInfo(), E);

for (unsigned I = 0; I != NumElems; ++I) {
APFloat LHS = SourceLHS.getVectorElt(I).getFloat();
APFloat RHS = SourceRHS.getVectorElt(I).getFloat();
if (I % 2 == 0) {
// Even indices: subtract
LHS.subtract(RHS, RM);
} else {
// Odd indices: add
LHS.add(RHS, RM);
}
ResultElements.push_back(APValue(LHS));
}
return Success(APValue(ResultElements.data(), ResultElements.size()), E);
}
case Builtin::BI__builtin_elementwise_fshl:
case Builtin::BI__builtin_elementwise_fshr: {
APValue SourceHi, SourceLo, SourceShift;
Expand Down
Loading