[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-20 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,66 @@ +//===- BitcastBuffer.h --*- C++ -*-===// +// +// 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: Apa

[clang] [clang][bytecode] Fix bitcasting from null pointers (PR #116999)

2024-11-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/116999 This looks a little ugly now, I should wait for #116843. >From c316394e5948539beadd62aab71566a42b76a760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 20 Nov 2024 17:14:01 +0100 Subjec

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-20 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,66 @@ +//===- BitcastBuffer.h --*- C++ -*-===// +// +// 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: Apa

[clang] [clang][ExprConst] Reject field access with nullptr base (PR #113885)

2024-11-20 Thread Timm Baeder via cfe-commits
tbaederr wrote: I think I understand what you mean by changing the order now. I changed two other places as well, just to be consistent. https://github.com/llvm/llvm-project/pull/113885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [clang][ExprConst] Reject field access with nullptr base (PR #113885)

2024-11-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/113885 >From de066be9c6d62bb17d50ddbff40d04cda40a2f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 28 Oct 2024 10:04:46 +0100 Subject: [PATCH] [clang][ExprConst] Reject field access with nul

[clang] [clang][bytecode] Fix ToType/FromType diagnostic ordering (PR #116988)

2024-11-20 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/116988 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/116843 >From 7b6b8c76b1438154f07794be4883625da8e9bd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 8 Nov 2024 14:37:56 +0100 Subject: [PATC

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/116843 >From 7b6b8c76b1438154f07794be4883625da8e9bd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 8 Nov 2024 14:37:56 +0100 Subject: [PATC

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/116843 >From 7b6b8c76b1438154f07794be4883625da8e9bd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 8 Nov 2024 14:37:56 +0100 Subject: [PATC

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/116843 >From 7b6b8c76b1438154f07794be4883625da8e9bd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 8 Nov 2024 14:37:56 +0100 Subject: [PATC

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -0,0 +1,66 @@ +//===- BitcastBuffer.h --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for li

[clang] [clang][ExprConst] Reject field access with nullptr base (PR #113885)

2024-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/113885 >From 3005da1e2d25f124466743e5f7a5fc5b969f5740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 28 Oct 2024 10:04:46 +0100 Subject: [PAT

[clang] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From 6a1c51fd8b6b1d04294eaac65b261bedb451f22b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 26 Nov 2024 13:10:33 +0100 Subject: [PATCH] [clang] Avoid re-evaluating field bitwidth ---

[clang] [clang][bytecode] Support ImplicitValueInitExpr for multi-dim arrays (PR #117312)

2024-11-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/117312 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [Sema] Reject non-power-of-2 `_BitInt` matrix element types (PR #117487)

2024-11-25 Thread Timm Baeder via cfe-commits
@@ -2312,6 +2312,18 @@ QualType Sema::BuildArrayType(QualType T, ArraySizeModifier ASM, return T; } +bool CheckBitIntElementType(Sema &S, SourceLocation AttrLoc, tbaederr wrote: ```suggestion static bool CheckBitIntElementType(Sema &S, SourceLocation AttrL

[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)

2024-11-25 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/67520 >From e89c66ced10f0d785d41d3b11c8447388c41e16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 20 Jun 2024 07:39:20 +0200 Subject: [PATC

[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)

2024-11-25 Thread Timm Baeder via cfe-commits
tbaederr wrote: > Also, this should be extended to almost all other thread safety attributes. > For a start, do one or two so that we can see what it looks like. This ends up being pretty ugly since we're collecting the arguments right now, but most of the other attributes don't have arguments

[clang] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/117732 None >From d1d31ec6d00657786212660f657aac638366523f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 26 Nov 2024 13:10:33 +0100 Subject: [PATCH] [clang] Avoid re-evaluating field bitwidt

[clang] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-26 Thread Timm Baeder via cfe-commits
tbaederr wrote: I was hoping that saving the value as an `unsigned` directly would give a little more speedup. `ConstantExpr` version: http://llvm-compile-time-tracker.com/compare.php?from=5a7b79c93e2e0c71aec016973f5f13d3bb2e7a62&to=a55efb0b221e7ea54b8f7c0e3f975c19a54e5796&stat=instructions:u

[clang] [clang] Format bitfield width diagnostics with thousands-separators (PR #117763)

2024-11-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/117763 Wondering if we should have a `toString()` version that does this automatically, or maybe the `operator<<` for diagnostics for AP(S)Int could even do this? Wouldn't be opt-in anymore though. >From 57caaa63c58

[clang] [clang] Format bitfield width diagnostics with thousands-separators (PR #117763)

2024-11-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117763 >From 07b326b59bf9a8e385840a590c5162b9d1914650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 26 Nov 2024 19:26:32 +0100 Subject: [PATCH] [clang] Format bitfield width diagnostics with

[clang] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From f766ba7fdfef40adc304b3bd54ccf48db8288576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:54:51 +0100 Subject: [PATCH] Save FieldDecl BitWidth as a ConstantExpr ---

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-27 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From df3ab058d28e7ac08fc4c3a8a8cdd5638df5b821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:54:51 +0100 Subject: [PATCH] Save FieldDecl BitWidth as a ConstantExpr ---

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-27 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From 27c012ea59959676a3b0a3afc3ed7a6037ec2185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:54:51 +0100 Subject: [PATCH] Save FieldDecl BitWidth as a ConstantExpr ---

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-27 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From ca2184f07dbceda33ca429b3d63015d49fef3684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:54:51 +0100 Subject: [PATCH] Save FieldDecl BitWidth as a ConstantExpr ---

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From ca2184f07dbceda33ca429b3d63015d49fef3684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:54:51 +0100 Subject: [PAT

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-11-27 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From ca2184f07dbceda33ca429b3d63015d49fef3684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:54:51 +0100 Subject: [PAT

[clang] [clang][bytecode] Fix definining extern variables (PR #108940)

2024-09-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108940 At the point of defintion of the variable, a function might already refert to the variable by its index. Replace the index with the new one. >From db26626c766426d6d848f459d4a243319f9badbe Mon Sep 17 00:00:00 2

[clang] [clang][bytecode] Fix definining extern variables (PR #108940)

2024-09-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/108940 >From bdfe4454f2f2ad0b710b0e9036768d311a77f965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 17 Sep 2024 08:49:55 +0200 Subject: [PATCH] [clang][bytecode] Fix defining extern variables

[clang] [clang][bytecode] Fix defining extern variables (PR #108940)

2024-09-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/108940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix defining extern variables (PR #108940)

2024-09-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/108940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Allow right-shift of negative values (PR #108987)

2024-09-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108987 We used to incorrectly diagnose this as a "left shift of negative value". >From 7836fe844ce9dc243d7a2b81daaaf462e02d772f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 17 Sep 2024 16:5

[clang] [clang][bytecode] Implement arithmetic, bitwise and compound assignment operator (PR #108949)

2024-09-17 Thread Timm Baeder via cfe-commits
@@ -1267,12 +1267,8 @@ bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { assert(E->getLHS()->getType()->isVectorType()); assert(E->getRHS()->getType()->isVectorType()); - // FIXME: Current only support comparison binary operator, add support for - // other bina

[clang] [clang][bytecode] Implement arithmetic, bitwise and compound assignment operator (PR #108949)

2024-09-17 Thread Timm Baeder via cfe-commits
@@ -1371,10 +1455,27 @@ bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { return false; } +// If we performed an integer promotion, we need to cast the compute result +// into result vector element type. +if (NeedIntPromot && +!this->e

[clang] [clang][bytecode] Implement arithmetic, bitwise and compound assignment operator (PR #108949)

2024-09-17 Thread Timm Baeder via cfe-commits
@@ -1281,26 +1277,67 @@ bool Compiler::VisitVectorBinOp(const BinaryOperator *E) { const Expr *LHS = E->getLHS(); const Expr *RHS = E->getRHS(); const auto *VecTy = E->getType()->getAs(); + auto Op = E->isCompoundAssignmentOp() +? BinaryOperator::getOpFo

[clang] [clang][bytecode][NFC] Remove APValue Result argument where unnecessary (PR #118199)

2024-12-01 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118199 This is unneeded in almost all circumstances. We only return an APValue back to clang when the evaluation is finished, and that is always done by an EvalEmitter - which has its own implementation of the Ret in

[clang] [clang][bytecode] Support __builtin_reduce_add (PR #117672)

2024-12-01 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117672 >From 1bb49850c392cdc535849f43ad14b02cbbb9dcc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 26 Nov 2024 06:33:12 +0100 Subject: [PATCH] [clang][bytecode] Support __builtin_reduce_add

[clang] [clang][bytecode] Implement __builtin_reduce_mul (PR #118287)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement __builtin_reduce_and (PR #118289)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118289 None >From 3b59280cae47010df112ae9aff091e3fc0708686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 14:03:16 +0100 Subject: [PATCH] [clang][bytecode] Implement __builtin_redu

[clang] [clang][bytecode] Implement __builtin_reduce_xor (PR #118299)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118299 None >From ef14e182caffbd2f4f2e6470fdb53efd00910eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 14:51:03 +0100 Subject: [PATCH] [clang][bytecode] Implement __builtin_redu

[clang] [ExprConst] Handle floating- and char literals in FastEvaluateAsRValue (PR #118294)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118294 This is part of a three-patch series that results in some nice (but not substantial) compile-time improvements: http://llvm-compile-time-tracker.com/compare.php?from=fe1c4f0106fe4fd6d61c38ba46e71fda8f4d1573&to

[clang] [clang][bytecode] Implement __builtin_reduce_and (PR #118289)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/118289 >From a46b7045a7b043c7a984bc5cc33004162ed65380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 14:03:16 +0100 Subject: [PATCH] [clang][bytecode] Implement __builtin_reduce_and

[clang] [clang][bytecode] Implement __builtin_reduce_and (PR #118289)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement __builtin_reduce_or (PR #118292)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118292 None >From 778afb1f6e35f551b0eb56b055d21755f0c55136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 14:24:11 +0100 Subject: [PATCH] [clang][bytecode] Implement __builtin_redu

[clang] [clang][bytecode] Implement __builtin_reduce_xor (PR #118299)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode][NFC] Reject invalid FromTypes in emitBuiltinBitcast (PR #118274)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Add simple __builtin_memcpy implementation (PR #118278)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/118278 >From bcb316bd8f2b6a143cb303f1e67c6bbc04c8c986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 10:45:52 +0100 Subject: [PATCH] [clang][bytecode] Add simple __builtin_memcpy im

[clang] [clang][bytecode] Implement __builtin_reduce_or (PR #118292)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/118292 >From e00015b867094932a2f398c8ff92889ff586aff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 14:24:11 +0100 Subject: [PATCH] [clang][bytecode] Implement __builtin_reduce_or

[clang] [clang][bytecode] Check __builtin_memcpy for null pointers (PR #118313)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118313 None >From 0cc2c1a52538a8fa5fe89bba77e83e00942eeaf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 16:47:50 +0100 Subject: [PATCH] [clang][bytecode] Check __builtin_memcpy f

[clang] [clang][bytecode] Implement __builtin_elementwise_popcount (PR #118307)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118307 None >From 7166a305ef2d64aaa1979ca2f09427015a9df873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 15:56:36 +0100 Subject: [PATCH] [clang][bytecode] Implement __builtin_elem

[clang] [clang][bytecode] Implement __builtin_elementwise_popcount (PR #118307)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode][NFC] Reject invalid FromTypes in emitBuiltinBitcast (PR #118274)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118274 instead of silently accepting them and failing later. >From 989573d4b67760096a40edfae42f853a55f893fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 10:36:58 +0100 Subject: [

[clang] [Clang] Consider preferred_type in bitfield warnings (#116760) (PR #116785)

2024-12-02 Thread Timm Baeder via cfe-commits
@@ -10488,7 +10488,14 @@ static bool AnalyzeBitFieldAssignment(Sema &S, FieldDecl *Bitfield, Expr *Init, // The RHS is not constant. If the RHS has an enum type, make sure the // bitfield is wide enough to hold all the values of the enum without // truncation. -

[clang] [clang][bytecode] Add simple __builtin_memcpy implementation (PR #118278)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118278 Not handling all the special- and error cases yet. Just making sure the bitcast code can be used for this as well. >From 9313b6992afc5e49b0c863b1ad0513b1d75bfc83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=2

[clang] [clang][bytecode] Add simple __builtin_memcpy implementation (PR #118278)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118278 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement __builtin_reduce_mul (PR #118287)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118287 None >From 4c5d7a068871216dfa57f03412c2e47b4e58f865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 13:11:04 +0100 Subject: [PATCH] [clang][bytecode] Implement __builtin_redu

[clang] [clang][bytecode] Check __builtin_memcpy for null pointers (PR #118313)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/118313 >From 577c2b7622d81fba7fe39607e48907d6f47ef9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 2 Dec 2024 16:47:50 +0100 Subject: [PATCH] [clang][bytecode] Check __builtin_memcpy for nul

[clang] [clang][bytecode] Implement __builtin_reduce_or (PR #118292)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-25 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/116843 >From 441fd49350866110d458c247786d0f71096505ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 8 Nov 2024 14:37:56 +0100 Subject: [PATC

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-11-25 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/116843 >From 441fd49350866110d458c247786d0f71096505ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 8 Nov 2024 14:37:56 +0100 Subject: [PATC

[clang] [clang][bytecode] Use bitcasts to cast from integer to vector (PR #117547)

2024-11-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117547 >From 815f917643508d1ccd95e86af3b6b81105bde409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 25 Nov 2024 13:36:51 +0100 Subject: [PATCH] [clang][bytecode] Use bitcasts to cast from int

[clang] [clang][bytecode] Use bitcasts to cast from integer to vector (PR #117547)

2024-11-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/117547 In C, a cast from an integer to a vector is a CK_BitCast. Implement this using the same code we use for __builtin_bit_cast. >From 61e61399ead14ac2508ee0fa97c57683a8ae49b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Timm Baeder via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [clang][bytecode] Use bitcasts to cast from integer to vector (PR #117547)

2024-11-25 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/117547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

2024-11-26 Thread Timm Baeder via cfe-commits
tbaederr wrote: I knew there was something oddly familiar about this: https://reviews.llvm.org/D150191?id=521215 :man_facepalming: https://github.com/llvm/llvm-project/pull/117671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

2024-11-26 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117671 >From 1d77f36a1f7fa974d50ff7a5a98b93bbb01ba26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 26 Nov 2024 08:44:57 +0100 Subject: [PAT

[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

2024-11-26 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: tbaederr wrote: It's the same problem again. For this code: ```c++ #define F(x) x + 1 #define G(x) F(x) + 2 #define ADD(x,y) G(x) + y #define LEVEL4(x) ADD(p,x) #define LEVEL3(x) LEVEL4(x) #define LEVEL2(x) LEVEL3(x) #define LEVEL1(x) LEVEL2(x)

[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

2024-11-26 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -487,14 +487,17 @@ static bool checkRangeForMacroArgExpansion(CharSourceRange Range, /// macro argument expansion as Loc. static bool checkRangesForMacroArgExpansion(FullSourceLoc Loc,

[clang] [Clang] Consider preferred_type in bitfield warnings (#116760) (PR #116785)

2024-11-26 Thread Timm Baeder via cfe-commits
@@ -10488,7 +10488,14 @@ static bool AnalyzeBitFieldAssignment(Sema &S, FieldDecl *Bitfield, Expr *Init, // The RHS is not constant. If the RHS has an enum type, make sure the // bitfield is wide enough to hold all the values of the enum without // truncation. -

[clang] [clang][bytecode][NFC] Remove APValue Result argument where unnecessary (PR #118199)

2024-12-01 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118199 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Support __builtin_reduce_add (PR #117672)

2024-12-01 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/117672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Support vector-to-vector bitcasts (PR #118230)

2024-12-01 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118230 None >From 3bdcf86f356fb6579bebf35ed636b0eae9bf24fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 1 Dec 2024 20:24:05 +0100 Subject: [PATCH] [clang][bytecode] Support vector-to-vector

[clang] [clang][bytecode] Support vector-to-vector bitcasts (PR #118230)

2024-12-01 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode][NFC] Diagnose no-constexpr memcpy/strlen versions (PR #118429)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Handle memmove like memcpy (PR #118431)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118431 This is the same thing for us, except for diagnostic differences. >From ff93c51cbf01df836c93a2076604a2472a90e12c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 06:52:12 +010

[clang] [clang][bytecode] Handle bitcasts involving bitfields (PR #116843)

2024-12-02 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/116843 >From fed5ce3a776fefe5d0c20c09d49db7be49f59389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 8 Nov 2024 14:3

[clang] [clang][bytecode] Handle memmove like memcpy (PR #118431)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118475 ... between unrelated declarations or literals. Leaving this small (I haven't run the whole test suite locally) to get some feedback on the wording and implementation first. The output of the sample in https:

[clang] [clang][bytecode] Fix `__extension__` handling for vector operators (PR #118482)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118482 Don't reject them, but delegate to the subexpression. >From 7576bf72f204904c65add97cdd867c41e5a3fa48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 13:44:14 +0100 Subject: [

[clang] [clang][bytecode] Fix discarded pointer subtractions (PR #118477)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118477 We need to pop the value. >From 409fa110d7eeb4a91f62b64d59aecb30db700ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 13:00:29 +0100 Subject: [PATCH] [clang][bytecode] Fix

[clang] [clang][bytecode] Fix discarded pointer subtractions (PR #118477)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Check __builtin_memcpy for null pointers (PR #118313)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode][NFC] Diagnose no-constexpr memcpy/strlen versions (PR #118429)

2024-12-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118429 None >From 5a16e4d366ca0600a0b8fd98265745223cd8aec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 06:34:51 +0100 Subject: [PATCH] [clang][bytecode][NFC] Diagnose no-constex

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-12-03 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From 90929a23af50f7b209e68055abf4deb903a490cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:

[clang] [clang][bytecode] Handle __builtin_wcslen (PR #118446)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118446 ... just like strlen. >From 652b93f0487d18fc9703c4bba623149c853f9540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 09:39:54 +0100 Subject: [PATCH] [clang][bytecode] Handle

[clang] [clang][bytecode] Handle __builtin_wcslen (PR #118446)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Reject memcpy dummy pointers after null check (PR #118460)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118460 To match the diagnostic output of the current interpreter. >From b98163a979e323e05791c866e53cfb9a977fda52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 11:14:37 +0100 Subje

[clang] [clang][bytecode] Initialize elements in __builtin_elementwise_popcount (PR #118457)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix `__extension__` handling for vector operators (PR #118482)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode][NFC] Diagnose non-constexpr builtin strcmp calls (PR #118442)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118442 None >From cb6db092180506acff805971a6a24841a3aa758f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 09:23:04 +0100 Subject: [PATCH] [clang][bytecode][NFC] Diagnose non-conste

[clang] [clang][bytecode][NFC] Diagnose non-constexpr builtin strcmp calls (PR #118442)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Initialize elements in __builtin_elementwise_popcount (PR #118457)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/118457 None >From fd60051545959575e3db2f033f4bd5d01cef6441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 10:34:26 +0100 Subject: [PATCH] [clang][bytecode] Initialize elements in

[clang] [clang][bytecode] Reject memcpy dummy pointers after null check (PR #118460)

2024-12-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2024-12-04 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117732 >From 90929a23af50f7b209e68055abf4deb903a490cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 27 Nov 2024 08:

[clang] [clang][bytecode] Pass __builtin_memcpy size along (PR #118649)

2024-12-04 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/118649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2024-12-04 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/118475 >From ce52d3d0c04fc53b814debdcd2c5019f488eddc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 11:5

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2024-12-04 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/118475 >From ce52d3d0c04fc53b814debdcd2c5019f488eddc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 3 Dec 2024 11:5

[clang] [clang][bytecode] Fix bitcasting from null pointers (PR #116999)

2024-12-05 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/116999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix bitcasting from null pointers (PR #116999)

2024-12-05 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/116999 >From c9c39e81e3fae1351691feaf99528997114810cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 20 Nov 2024 17:14:01 +0100 Subject: [PATCH] [clang][bytecode] Fix bitcasting from null poin

[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

2024-12-05 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117671 >From a55f27b1c479c91807254bd3f62a1771323d9fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 26 Nov 2024 08:44:57 +0100 Subject: [PAT

<    14   15   16   17   18   19   20   21   22   23   >