[clang] [llvm] [RISCV] Add Qualcomm uC Xqcibm (Bit Manipulation) extension (PR #129504)

2025-03-05 Thread via cfe-commits
@@ -385,6 +389,20 @@ RISCVMCCodeEmitter::getMachineOpValue(const MCInst &MI, const MCOperand &MO, return 0; } +uint64_t +RISCVMCCodeEmitter::getImmOpValueMinus1(const MCInst &MI, unsigned OpNo, +SmallVectorImpl &Fixups, +

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcibm (Bit Manipulation) extension (PR #129504)

2025-03-05 Thread via cfe-commits
@@ -333,6 +397,59 @@ let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in { } // hasSideEffects = 0, mayLoad = 0, mayStore = 0 } // Predicates = [HasVendorXqcia, IsRV32] +let Predicates = [HasVendorXqcibm, IsRV32] in { +let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in { +

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcibm (Bit Manipulation) extension (PR #129504)

2025-03-05 Thread via cfe-commits
@@ -90,6 +119,30 @@ class QCIRVInstRR funct5, DAGOperand InTyRs1, string opcodestr> : RVInstR<{0b00, funct5}, 0b011, OPC_CUSTOM_0, (outs GPRNoX0:$rd), (ins InTyRs1:$rs1, GPRNoX0:$rs2), opcodestr, "$rd, $rs1, $rs2">; +class QCIBitManipRII funct3, bits<2> func

[clang] [llvm] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Yingwei Zheng via cfe-commits
@@ -139,7 +139,7 @@ class Lint : public InstVisitor { Lint(Module *Mod, const DataLayout *DL, AliasAnalysis *AA, AssumptionCache *AC, DominatorTree *DT, TargetLibraryInfo *TLI) - : Mod(Mod), TT(Triple::normalize(Mod->getTargetTriple())), DL(DL), AA(AA), + :

[clang] [llvm] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Yingwei Zheng via cfe-commits
@@ -91,7 +91,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { } // Set up the module to build for our target. - M->setTargetTriple(TM->getTargetTriple().normalize()); + M->setTargetTriple(Triple(TM->getTargetTriple().normalize()));

[clang] [llvm] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Yingwei Zheng via cfe-commits
@@ -124,7 +124,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { // Set up target dependant options // - M->setTargetTriple(TM->getTargetTriple().normalize()); + M->setTargetTriple(Triple(TM->getTargetTriple().normalize()));

[clang] [llvm] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Yingwei Zheng via cfe-commits
@@ -114,7 +114,8 @@ std::unique_ptr llvm::parseInputFile(StringRef Filename, TargetTriple.setTriple(TheTriple.getTriple()); } - Result->setTargetTriple(TargetTriple.getTriple()); // override the triple + // override the triple + Result->setTargetTriple(Triple(TargetT

[clang] [llvm] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Yingwei Zheng via cfe-commits
@@ -515,12 +515,13 @@ static void splitCodeGen(const Config &C, TargetMachine *TM, static Expected initAndLookupTarget(const Config &C, Module &Mod) { if (!C.OverrideTriple.empty()) -Mod.setTargetTriple(C.OverrideTriple

[libclc] [libclc] Reduce bithacking for INF/NAN values (PR #129738)

2025-03-05 Thread Matt Arsenault via cfe-commits
@@ -46,9 +46,7 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_hypot(__CLC_GENTYPE x, __CLC_GENTYPE retval = __clc_sqrt(__clc_mad(fx, fx, fy * fy)) * fx_exp; retval = (ux > PINFBITPATT_SP32 || uy == 0) ? __CLC_AS_GENTYPE(ux) : retval; - retval = (ux == PINFBITPATT_SP32 ||

[clang] [llvm] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Yingwei Zheng via cfe-commits
@@ -200,7 +200,7 @@ LTOModule::makeLTOModule(MemoryBufferRef Buffer, const TargetOptions &options, return EC; std::unique_ptr &M = *MOrErr; - std::string TripleStr = M->getTargetTriple(); + std::string TripleStr = M->getTargetTriple().str(); dtcxzyw w

[clang] [Sema] Instantiate destructors for initialized members (PR #128866)

2025-03-05 Thread Aaron Ballman via cfe-commits
@@ -5283,6 +5283,102 @@ Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor, return false; } +static void MarkFieldDestructorReferenced(Sema &S, SourceLocation Location, + FieldDecl *Field) { + if (Field->isInvalidDecl())

[clang] [Sema] Instantiate destructors for initialized members (PR #128866)

2025-03-05 Thread Aaron Ballman via cfe-commits
@@ -5450,10 +5546,25 @@ bool Sema::SetCtorInitializers(CXXConstructorDecl *Constructor, bool AnyErrors, NumInitializers * sizeof(CXXCtorInitializer*)); Constructor->setCtorInitializers(baseOrMemberInitializers); +SourceLocation Location = Constructor->getLo

[clang] [Sema] Instantiate destructors for initialized members (PR #128866)

2025-03-05 Thread Aaron Ballman via cfe-commits
@@ -5283,6 +5283,102 @@ Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor, return false; } +static void MarkFieldDestructorReferenced(Sema &S, SourceLocation Location, + FieldDecl *Field) { + if (Field->isInvalidDecl())

[clang] [Sema] Instantiate destructors for initialized members (PR #128866)

2025-03-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Only nits from me, but I think this LG otherwise. https://github.com/llvm/llvm-project/pull/128866 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [llvm] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Yingwei Zheng via cfe-commits
@@ -153,7 +153,7 @@ struct VerifierSupport { bool TreatBrokenDebugInfoAsError = true; explicit VerifierSupport(raw_ostream *OS, const Module &M) - : OS(OS), M(M), MST(&M), TT(Triple::normalize(M.getTargetTriple())), + : OS(OS), M(M), MST(&M), TT(M.getTargetTriple

[clang] [Sema] Instantiate destructors for initialized anonymous union fields (PR #128866)

2025-03-05 Thread Maurice Heumann via cfe-commits
https://github.com/momo5502 updated https://github.com/llvm/llvm-project/pull/128866 >From bb4091d2f9b7062aa83e5bee2ba525478a7dbd0a Mon Sep 17 00:00:00 2001 From: Maurice Heumann Date: Wed, 26 Feb 2025 14:31:47 +0100 Subject: [PATCH 1/5] Instantiate destructors from initialized anonymous union

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus updated https://github.com/llvm/llvm-project/pull/129732 >From 624d1e924aa130eea2a8ddaefaeb587aab642f2f Mon Sep 17 00:00:00 2001 From: Ricardo Jesus Date: Tue, 4 Mar 2025 02:36:06 -0800 Subject: [PATCH 1/8] Precommit tests --- .../AArch64/sve-fixed-length-offsets.l

[clang] [clang][SPIR-V] Use the SPIR-V backend by default (PR #129545)

2025-03-05 Thread Arvind Sudarsanam via cfe-commits
https://github.com/asudarsa approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/129545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Instantiate destructors for initialized members (PR #128866)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -5283,6 +5283,102 @@ Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor, return false; } +static void MarkFieldDestructorReferenced(Sema &S, SourceLocation Location, + FieldDecl *Field) { + if (Field->isInvalidDecl())

[clang] [Sema] Instantiate destructors for initialized members (PR #128866)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -5283,6 +5283,102 @@ Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor, return false; } +static void MarkFieldDestructorReferenced(Sema &S, SourceLocation Location, + FieldDecl *Field) { + if (Field->isInvalidDecl())

[clang] [Sema] Instantiate destructors for initialized members (PR #128866)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -5283,6 +5283,102 @@ Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor, return false; } +static void MarkFieldDestructorReferenced(Sema &S, SourceLocation Location, + FieldDecl *Field) { + if (Field->isInvalidDecl())

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-03-05 Thread Erich Keane via cfe-commits
erichkeane wrote: > Ping. I'll merge tomorrow if there are no further objections. SGTM. I haven't been paying SUPER close attention, but have been keeping an eye on this at least a little, and have no objections. https://github.com/llvm/llvm-project/pull/126088 ___

[clang] [Clang][diagnostics] Improve the diagnostics for chained comparisons (PR #129285)

2025-03-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! I think we can make the diagnostic message a bit more clear while we're at it, WDYT? https://github.com/llvm/llvm-project/pull/129285 ___ cfe-commits mailing list cfe-commits@li

[clang] [llvm] [Clang][LLVM] Implement single-single vectors MOP4{A/S} (PR #127797)

2025-03-05 Thread Virginia Cangelosi via cfe-commits
@@ -376,6 +376,24 @@ let SMETargetGuard = "sme2" in { // Outer product and accumulate/subtract // +multiclass MOP4 checks> { + def NAME # "_1x1" : Inst<"svmop4" # name # "_1x1_" # n # "[_{d}_{d}]", "vidd", t, MergeNone, i # wide # "_1x1", [IsInOutZA, IsStreaming], checks>; +

[clang] [clang][bytecode] Ignore function calls with depth > 0... (PR #129887)

2025-03-05 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin` running on `doug-worker-4` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/15762 Here is th

[clang] [HLSL] error on out of bounds vector accesses (PR #128952)

2025-03-05 Thread Chris B via cfe-commits
@@ -14017,6 +14017,24 @@ void Sema::CheckCastAlign(Expr *Op, QualType T, SourceRange TRange) { << TRange << Op->getSourceRange(); } +void Sema::CheckVectorAccess(const Expr *BaseExpr, const Expr *IndexExpr) { + const VectorType *VTy = BaseExpr->getType()->getAs(); + if

[clang] Reapply "[analyzer] Handle [[assume(cond)]] as __builtin_assume(cond)" (PR #129234)

2025-03-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/129234 >From 67d6420eb64949b9639385a8a2f647db0d05d078 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sat, 1 Feb 2025 10:03:27 +0100 Subject: [PATCH 1/5] Reapply "[analyzer] Handle [[assume(cond)]] as __builtin_as

[clang] [Clang] Add support for missing OpenCL extensions (PR #129777)

2025-03-05 Thread Sven van Haastregt via cfe-commits
svenvh wrote: > @svenvh, I'm trying to unify the extensions enablement in the user interface. > We can enable or disable some of the extensions with the `-Xclang > -cl-ext=+extension` command line options. For example, a user can pass > `-Xclang -cl-ext=+cl_khr_subgroups` successfully, but the

[libclc] [libclc] Reduce bithacking for INF/NAN values (PR #129738)

2025-03-05 Thread Matt Arsenault via cfe-commits
@@ -46,9 +46,7 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_hypot(__CLC_GENTYPE x, __CLC_GENTYPE retval = __clc_sqrt(__clc_mad(fx, fx, fy * fy)) * fx_exp; retval = (ux > PINFBITPATT_SP32 || uy == 0) ? __CLC_AS_GENTYPE(ux) : retval; - retval = (ux == PINFBITPATT_SP32 ||

[clang] Reapply "[analyzer] Handle [[assume(cond)]] as __builtin_assume(cond)" (PR #129234)

2025-03-05 Thread Balazs Benics via cfe-commits
@@ -180,3 +183,58 @@ int test_reference_that_might_be_after_the_end(int idx) { return ref; } +// From: https://github.com/llvm/llvm-project/issues/100762 +extern int arrOf10[10]; +void using_builtin(int x) { + __builtin_assume(x > 101); // CallExpr + arrOf10[x] = 404; // e

[clang] Reapply "[analyzer] Handle [[assume(cond)]] as __builtin_assume(cond)" (PR #129234)

2025-03-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/129234 >From 67d6420eb64949b9639385a8a2f647db0d05d078 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sat, 1 Feb 2025 10:03:27 +0100 Subject: [PATCH 1/6] Reapply "[analyzer] Handle [[assume(cond)]] as __builtin_as

[clang] Reapply "[analyzer] Handle [[assume(cond)]] as __builtin_assume(cond)" (PR #129234)

2025-03-05 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun approved this pull request. LG, thanks! https://github.com/llvm/llvm-project/pull/129234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[analyzer] Handle [[assume(cond)]] as __builtin_assume(cond)" (PR #129234)

2025-03-05 Thread Balazs Benics via cfe-commits
steakhal wrote: Thanks for the swift reviews! https://github.com/llvm/llvm-project/pull/129234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] use parameter location for abbreviated function templates (PR #129139)

2025-03-05 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/129139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Dependency Scanning] Teach `DependencyScanningTool::getModuleDependencies` to Process a List of Module Names (PR #129915)

2025-03-05 Thread Qiongsi Wu via cfe-commits
qiongsiwu wrote: I think this change should be here (in contrast to `swift:next`). But there is no clear use case for the multiple module name case in `clang` at the moment. I am all ears for suggestions. Maybe I can/should teach `clang-scan-deps` to use a list of module names? https://githu

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-03-05 Thread Ryan Mast via cfe-commits
nightlark wrote: @LecrisUT all of the situations listed work fine -- the top level bullet points are the "hypothetical issues" that someone trying to use it have encountered, and the sub-bullet points are ways to check that the potential issue was addressed and is not an issue. https://githu

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-03-05 Thread via cfe-commits
bd1976bris wrote: Reviewers have suggested that smaller PRs be created to facilitate detailed reviews while keeping this one around to provide an overall picture and facilitate discussion of high-level design (see [this ongoing discussion](https://github.com/llvm/llvm-project/pull/126654#discu

[clang] [clang] Use TargetInfo to decide Mangling for C (PR #129920)

2025-03-05 Thread via cfe-commits
https://github.com/Prabhuk created https://github.com/llvm/llvm-project/pull/129920 Instead of hardcoding the decision on what mangling scheme to use based on targets, use TargetInfo to make the decision. >From 50204fcef930b215c9494b92b8c54a19d3821d5b Mon Sep 17 00:00:00 2001 From: prabhukr D

[clang] [Clang] Make '-Wglobal-constructors` work on the GNU attributes (PR #129917)

2025-03-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Joseph Huber (jhuber6) Changes Summary: The `-Wglobal-constructors` option is useful for restricting the usage of global constructors / destructors. However, it currently ignores the attributes that introduce global constructors, meaning th

[clang] [Dependency Scanning] Teach `DependencyScanningTool::getModuleDependencies` to Process a List of Module Names (PR #129915)

2025-03-05 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu edited https://github.com/llvm/llvm-project/pull/129915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Make '-Wglobal-constructors` work on the GNU attributes (PR #129917)

2025-03-05 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/129917 Summary: The `-Wglobal-constructors` option is useful for restricting the usage of global constructors / destructors. However, it currently ignores the attributes that introduce global constructors, meaning that

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Design Overview (PR #126654)

2025-03-05 Thread via cfe-commits
https://github.com/bd1976bris edited https://github.com/llvm/llvm-project/pull/126654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-03-05 Thread Cristian Le via cfe-commits
LecrisUT wrote: Ok, can you preface the sentences with a "check if" so it doesn't create confusions :sweat_smile: https://github.com/llvm/llvm-project/pull/125806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [Clang] Fix 'gpuintrin.h' match when included with no arch set (PR #129927)

2025-03-05 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/129927 Summary: These require `+ptx` features to be set even though they're guarded by the `__nvvm_reflect`. Rather than figure out how to hack around that with the `target` attribute I'm just going to disable it for 'g

[clang] [Clang] Fix 'gpuintrin.h' match when included with no arch set (PR #129927)

2025-03-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-x86 Author: Joseph Huber (jhuber6) Changes Summary: These require `+ptx` features to be set even though they're guarded by the `__nvvm_reflect`. Rather than figure out how to hack around that with the `target` attribute

[clang] [llvm] [win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (PR #129142)

2025-03-05 Thread Daniel Paoliello via cfe-commits
dpaoliello wrote: Thanks for the info! For the different terminators, I'd prefer to keep to my current "assume 1-byte" trick: the implementation is simple, and it will reduce the amount of unwind data we need to emit. But for the "too many unwind codes" and "too far from the end" scenarios, i

[clang] c-index-test: fix buffer overflow (PR #129922)

2025-03-05 Thread Jinsong Ji via cfe-commits
https://github.com/jsji updated https://github.com/llvm/llvm-project/pull/129922 >From 7d8157357b4b9ba1462e0b4d0fafa7650d7f6b40 Mon Sep 17 00:00:00 2001 From: Jinsong Ji Date: Wed, 5 Mar 2025 11:49:19 -0800 Subject: [PATCH 1/2] c-index-test: fix buffer overflow --- clang/tools/c-index-test/c-i

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-03-05 Thread Cristian Le via cfe-commits
LecrisUT wrote: > Also I barely know anything about how to package this stuff correctly, and > what the consequences would be if we get it wrong. Also regarding @Endilll. Nothing can go wrong really. This is still not connected to the CD and you would need permission from [`clang` pypi projec

[clang] Fixed vec_pack_to_short_fp32 in Clang altivec.h (PR #129923)

2025-03-05 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Fixed vec_pack_to_short_fp32 in Clang altivec.h (PR #129923)

2025-03-05 Thread John Platts via cfe-commits
https://github.com/johnplatts created https://github.com/llvm/llvm-project/pull/129923 Fixes bug in vec_pack_to_short_fp32 in clang/lib/Headers/altivec.h. Resolves issue #60822 Reviewer: @lei137 >From 0bfa20f7a2deaf61e04f7418f4571a9d6de4 Mon Sep 17 00:00:00 2001 From: John Platts Date: W

[clang] Fixed vec_pack_to_short_fp32 in Clang altivec.h (PR #129923)

2025-03-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: John Platts (johnplatts) Changes Fixes bug in vec_pack_to_short_fp32 in clang/lib/Headers/altivec.h. Resolves issue #60822 Reviewer: @lei137 --- Full diff: https://github.com/llvm/llvm-project/pull/129923.diff 1 Files Affected: - (mod

[clang] Fixed vec_pack_to_short_fp32 in Clang altivec.h (PR #129923)

2025-03-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: John Platts (johnplatts) Changes Fixes bug in vec_pack_to_short_fp32 in clang/lib/Headers/altivec.h. Resolves issue #60822 Reviewer: @lei137 --- Full diff: https://github.com/llvm/llvm-project/pull/129923.diff 1 Files Affected:

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127336 >From 272385df25b791b50472b92e12157477d021a26f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 15 Feb 2025 18:19:44 +0200 Subject: [PATCH 1/8] [Clang] add -Wshift-bool warning to handle shifting of boo

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/127336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add test for crash repro and clean up const accessor handling (PR #129930)

2025-03-05 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/129930 Add test for https://github.com/llvm/llvm-project/issues/125589 The crash is actually incidentally fixed by https://github.com/llvm/llvm-project/pull/128437 since it added a branch for the reference case and woul

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-05 Thread Oleksandr T. via cfe-commits
@@ -11247,6 +11247,12 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, if (S.getLangOpts().OpenCL) return; + if (Opc == BO_Shr && + LHS.get()->IgnoreParenImpCasts()->getType()->isBooleanType()) { +S.Diag(Loc, diag::warn_shift_bo

[clang] [CIR] Upstream emitAndUpdateRetAlloca (PR #129933)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -195,7 +195,16 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType, mlir::Location fnBodyBegin = getLoc(fd->getBody()->getBeginLoc()); builder.CIRBaseBuilderTy::createStore(fnBodyBegin, paramVal, addrVal); } + assert(builder.getInsertionBlo

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2025-03-05 Thread Ulrich Weigand via cfe-commits
uweigand wrote: To clarify about soft-float - we do support `-msoft-float` as a compiler option, but there is no actual soft-float library provided anywhere; never has been. The compiler option is still useful in particular for the case of the Linux kernel: kernel code does not actually have

[clang] [CIR] Upstream emitAndUpdateRetAlloca (PR #129933)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -213,6 +222,11 @@ mlir::LogicalResult CIRGenFunction::emitFunctionBody(const clang::Stmt *body) { cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl gd, cir::FuncOp fn, cir::FuncType funcType) { const auto funcDecl = cast(g

[clang] [CIR] Upstream emitAndUpdateRetAlloca (PR #129933)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -195,7 +195,16 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType, mlir::Location fnBodyBegin = getLoc(fd->getBody()->getBeginLoc()); builder.CIRBaseBuilderTy::createStore(fnBodyBegin, paramVal, addrVal); } + assert(builder.getInsertionBlo

[clang] [CIR] Upstream emitAndUpdateRetAlloca (PR #129933)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -49,6 +49,8 @@ class CIRGenFunction : public CIRGenTypeCache { public: clang::QualType fnRetTy; erichkeane wrote: Actually I question the need for `fnRetTy` too, particularly since `fnRetQualTy` and `fnRetTy` are not being set together... https://githu

[clang] Reduce memory usage in AST parent map generation by partially reverting quadratic slowdown mitigation (PR #129934)

2025-03-05 Thread via cfe-commits
https://github.com/higher-performance created https://github.com/llvm/llvm-project/pull/129934 This is a regression in #87824. With this change, the use of parent maps (`hasParent()`, `hasAncestor()`, etc.) in Clang AST matchers is no longer _guaranteed_ to avoid quadratic slowdown, but in pr

[clang] Reduce memory usage in AST parent map generation by partially reverting quadratic slowdown mitigation (PR #129934)

2025-03-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (higher-performance) Changes This is a regression in #87824. With this change, the use of parent maps (`hasParent()`, `hasAncestor()`, etc.) in Clang AST matchers is no longer _guaranteed_ to avoid quadratic slowdown, but in practic

[clang-tools-extra] [clang-tidy] 'modernize-use-starts-ends-with': fixed false positives on `find` and `rfind` (PR #129564)

2025-03-05 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/129564 >From c3f21bb654d2980955f2c37a5dc7a02a1ced7891 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 3 Mar 2025 21:00:32 +0300 Subject: [PATCH 1/4] [clang-tidy] fixed false positives on find and rfind ---

[clang-tools-extra] [clang-tidy] 'modernize-use-starts-ends-with': fixed false positives on `find` and `rfind` (PR #129564)

2025-03-05 Thread Baranov Victor via cfe-commits
@@ -261,6 +273,9 @@ void test(std::string s, std::string_view sv, sub_string ss, sub_sub_string sss, #define STRING s if (0 == STRING.find("ala")) { /* do something */} + + s.find("aaa", 0, 3) == 0; + s.rfind("aaa", std::string::npos, 3) == 0; vbvictor

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-03-05 Thread Baranov Victor via cfe-commits
vbvictor wrote: Since all approved are made, can we land this PR? @HerrCai0907 https://github.com/llvm/llvm-project/pull/121291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-03-05 Thread Loïc Jaquemet via cfe-commits
trolldbois wrote: > > Also I barely know anything about how to package this stuff correctly, and > > what the consequences would be if we get it wrong. > > Also regarding @Endilll. Nothing can go wrong really. This is still not > connected to the CD and you would need permission from [`clang`

[clang] Reduce memory usage in AST parent map generation by partially reverting quadratic slowdown mitigation (PR #129934)

2025-03-05 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/129934 >From e99bb267a950f75ea4fc23454762a7422c776bca Mon Sep 17 00:00:00 2001 From: higher-performance Date: Wed, 5 Mar 2025 15:49:06 -0500 Subject: [PATCH] Reduce memory usage in AST parent map generation

[clang] Reduce memory usage in AST parent map generation by partially reverting quadratic slowdown mitigation (PR #129934)

2025-03-05 Thread via cfe-commits
https://github.com/higher-performance edited https://github.com/llvm/llvm-project/pull/129934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread via cfe-commits
@@ -70,16 +93,37 @@ class ParentMapContext::ParentMap { push_back(Value); } bool contains(const DynTypedNode &Value) { - return Seen.contains(Value); + assert(Value.getMemoizationData()); + bool found = FragileLazySeenCache.contains(&Value); +

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2025-03-05 Thread Trevor Gross via cfe-commits
tgross35 wrote: If there isn't any reason to be consistent with the other LLVM targets then agreed, using the direct libcalls seems better. The new library support could likely land separately, right? As long as the lowering is correct, considering this PR is already pretty expansive. > To br

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread via cfe-commits
higher-performance wrote: Oh shoot, it looks like my change may be buggy. One of the tests is breaking... I will take a look. https://github.com/llvm/llvm-project/pull/129934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-05 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/129751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/129934 >From 6a99b1d1341340b780cf31dd1632b8d18ba65fe4 Mon Sep 17 00:00:00 2001 From: higher-performance Date: Wed, 5 Mar 2025 15:49:06 -0500 Subject: [PATCH] Reduce memory usage in AST parent map generation

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread via cfe-commits
@@ -70,16 +93,37 @@ class ParentMapContext::ParentMap { push_back(Value); } bool contains(const DynTypedNode &Value) { - return Seen.contains(Value); + assert(Value.getMemoizationData()); + bool found = FragileLazySeenCache.contains(&Value); +

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-03-05 Thread Morris Hafner via cfe-commits
mmha wrote: Great! I don't have committer status, yet, if that's your question. https://github.com/llvm/llvm-project/pull/129072 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -70,16 +93,37 @@ class ParentMapContext::ParentMap { push_back(Value); } bool contains(const DynTypedNode &Value) { - return Seen.contains(Value); + assert(Value.getMemoizationData()); + bool found = FragileLazySeenCache.contains(&Value); +

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-05 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/129751 >From 5f119a3a4ae8642d6ab0498c1cf6b39d5099c835 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 27 Feb 2025 15:23:18 -0800 Subject: [PATCH 1/3] [clang][modules][deps] Add mutex as an alternative to fi

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -70,16 +93,37 @@ class ParentMapContext::ParentMap { push_back(Value); } bool contains(const DynTypedNode &Value) { - return Seen.contains(Value); + assert(Value.getMemoizationData()); + bool found = FragileLazySeenCache.contains(&Value); +

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/129934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: @AaronBallman should take a look at this as well. We might take a look at `SetVector` and see if there are any learnings we can take from that. It has a set and a vector together, but might have some interesting things. Finally... I wonder if we were

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread Erich Keane via cfe-commits
@@ -70,16 +93,37 @@ class ParentMapContext::ParentMap { push_back(Value); } bool contains(const DynTypedNode &Value) { - return Seen.contains(Value); + assert(Value.getMemoizationData()); + bool found = FragileLazySeenCache.contains(&Value); +

[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)

2025-03-05 Thread Deric C. via cfe-commits
https://github.com/Icohedron updated https://github.com/llvm/llvm-project/pull/127137 >From 4fae5642c6e8e305cdc687b4968ba5eabaa44b50 Mon Sep 17 00:00:00 2001 From: Icohedron Date: Mon, 27 Jan 2025 11:18:09 -0800 Subject: [PATCH 01/14] Add the AddUint64 HLSL builtin function - Defines the AddUi

[clang] [llvm] [SPARC] Align i128 to 16 bytes in SPARC datalayouts (PR #106951)

2025-03-05 Thread via cfe-commits
@@ -151,7 +151,7 @@ class LLVM_LIBRARY_VISIBILITY SparcV8TargetInfo : public SparcTargetInfo { public: SparcV8TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : SparcTargetInfo(Triple, Opts) { -resetDataLayout("E-m:e-p:32:32-i64:64-f128:64-n32-S64"

[clang] [llvm] [SPARC] Align i128 to 16 bytes in SPARC datalayouts (PR #106951)

2025-03-05 Thread Alex Rønne Petersen via cfe-commits
@@ -151,7 +151,7 @@ class LLVM_LIBRARY_VISIBILITY SparcV8TargetInfo : public SparcTargetInfo { public: SparcV8TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : SparcTargetInfo(Triple, Opts) { -resetDataLayout("E-m:e-p:32:32-i64:64-f128:64-n32-S64"

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread via cfe-commits
@@ -70,16 +93,37 @@ class ParentMapContext::ParentMap { push_back(Value); } bool contains(const DynTypedNode &Value) { - return Seen.contains(Value); + assert(Value.getMemoizationData()); + bool found = FragileLazySeenCache.contains(&Value); +

[clang] [clang] Reject constexpr-unknown values as constant expressions more consistently (PR #129952)

2025-03-05 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/129952 Perform the check for constexpr-unknown values in the same place we perform checks for other values which don't count as constant expressions. While I'm here, also fix a rejects-valid with a reference tha

[clang] [clang] Reject constexpr-unknown values as constant expressions more consistently (PR #129952)

2025-03-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Eli Friedman (efriedma-quic) Changes Perform the check for constexpr-unknown values in the same place we perform checks for other values which don't count as constant expressions. While I'm here, also fix a rejects-valid with a reference

[clang] [Clang][counted_by] Add support for 'counted_by' on struct pointers (PR #127116)

2025-03-05 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/127116 >From b5b9b158e7e379f2d430584e3ccf519677bf27a3 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 10 Jan 2025 17:13:30 -0800 Subject: [PATCH 1/6] [Clang][counted_by] Add support for 'counted_by' on struc

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/129934 >From 55e0d3aca6c4051ebd68a9082005984e2d40c552 Mon Sep 17 00:00:00 2001 From: higher-performance Date: Wed, 5 Mar 2025 15:49:06 -0500 Subject: [PATCH] Reduce memory usage in AST parent map generation

[clang] [CIR] Upstream emitAndUpdateRetAlloca (PR #129933)

2025-03-05 Thread Andy Kaylor via cfe-commits
@@ -13,8 +13,9 @@ void voidret() { return; } int intfunc() { return 42; } // CHECK: cir.func @intfunc() -> !cir.int { -// CHECK: %0 = cir.const #cir.int<42> : !cir.int -// CHECK: cir.return %0 : !cir.int +// CHECK: %0 = cir.alloca !cir.int, !cir.ptr>, ["__retval"] {alig

[clang] [CIR] Upstream emitAndUpdateRetAlloca (PR #129933)

2025-03-05 Thread Andy Kaylor via cfe-commits
@@ -13,8 +13,9 @@ void voidret() { return; } int intfunc() { return 42; } // CHECK: cir.func @intfunc() -> !cir.int { -// CHECK: %0 = cir.const #cir.int<42> : !cir.int -// CHECK: cir.return %0 : !cir.int +// CHECK: %0 = cir.alloca !cir.int, !cir.ptr>, ["__retval"] {alig

[clang] [CIR] Upstream emitAndUpdateRetAlloca (PR #129933)

2025-03-05 Thread Andy Kaylor via cfe-commits
@@ -195,7 +195,16 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType, mlir::Location fnBodyBegin = getLoc(fd->getBody()->getBeginLoc()); builder.CIRBaseBuilderTy::createStore(fnBodyBegin, paramVal, addrVal); } + assert(builder.getInsertionBlo

[clang] [CIR] Upstream emitAndUpdateRetAlloca (PR #129933)

2025-03-05 Thread Andy Kaylor via cfe-commits
@@ -312,4 +326,12 @@ LValue CIRGenFunction::emitLValue(const Expr *e) { } } +void CIRGenFunction::emitAndUpdateRetAlloca(QualType ty, mlir::Location loc, +CharUnits alignment) { + if (ty->isVoidType()) { +return; + } + --

[clang] [clang] Reject constexpr-unknown values as constant expressions more consistently (PR #129952)

2025-03-05 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/129952 >From 9ac636ee137248cafe38f4d2e016cfb885142dff Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 5 Mar 2025 14:20:21 -0800 Subject: [PATCH] [clang] Reject constexpr-unknown values as constant express

[clang] Reduce memory usage in AST parent map generation by lazily checking if nodes have been seen (PR #129934)

2025-03-05 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/129934 >From eaefea589f78e4a50e10ab579e5b27da3152e08e Mon Sep 17 00:00:00 2001 From: higher-performance Date: Wed, 5 Mar 2025 15:49:06 -0500 Subject: [PATCH] Reduce memory usage in AST parent map generation

[clang] [clang] Fix FP -Wformat in functions with 2+ attribute((format)) (PR #129954)

2025-03-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (apple-fcloutier) Changes When defining functions with two or more format attributes, if the format strings don't have the same format family, there is a false positive warning that the incorrect kind of format string is being passed

[clang] [clang] Fix FP -Wformat in functions with 2+ attribute((format)) (PR #129954)

2025-03-05 Thread via cfe-commits
https://github.com/apple-fcloutier created https://github.com/llvm/llvm-project/pull/129954 When defining functions with two or more format attributes, if the format strings don't have the same format family, there is a false positive warning that the incorrect kind of format string is being p

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-03-05 Thread via cfe-commits
=?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Cloutier , =?utf-8?q?F=C3=A9lix?= Clou

[clang] [Dependency Scanning] Teach `DependencyScanningTool::getModuleDependencies` to Process a List of Module Names (PR #129915)

2025-03-05 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu commented: There are two things I am not sure about. https://github.com/llvm/llvm-project/pull/129915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   >