[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,149 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOp(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); + + if

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,88 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify tbaederr wrote: Why no RUN line for the current interpreter? https://github.com/llvm/llvm-project/pull/

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -139,6 +139,7 @@ class Compiler : public ConstStmtVisitor, bool>, bool VisitGNUNullExpr(const GNUNullExpr *E); bool VisitCXXThisExpr(const CXXThisExpr *E); bool VisitUnaryOperator(const UnaryOperator *E); + bool VisitVectorUnaryOp(const UnaryOperator *E); ---

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,149 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOp(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); + + if

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [NFC][Clang][Interp] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (PR #106071)

2024-08-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. LGTM if the CI comes back green, but we use "[clang][bytecode]" (all lowercase) in the commit message now. https://github.com/llvm/llvm-project/pull/106071 ___ cfe-commits mailing list cfe-commit

[clang] Performance optimizations for function effects (nonblocking attribute etc.) (PR #96844)

2024-06-26 Thread Timm Baeder via cfe-commits
tbaederr wrote: I guess you meant to link to https://llvm-compile-time-tracker.com/compare.php?from=f03cb005eb4ba3c6fb645aca2228e907db8cd452&to=038b39d3235c6c8151127c34d34f498dd298273c&stat=instructions:u directly? https://github.com/llvm/llvm-project/pull/96844 ___

[clang] [clang][Interp] Merge ByteCodeExprGen and ByteCodeStmtGen (PR #83683)

2024-06-27 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/83683 >From 74550f244eed465d4f0db1787eecb73a09d5881a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 2 Mar 2024 17:00:26 +0100 Subject: [PATCH] [clang][Interp] Merge ByteCode{Stmt,Expr}Gen ---

[clang] [clang][Interp] Merge ByteCodeExprGen and ByteCodeStmtGen (PR #83683)

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

[clang] [clang][Interp] Merge ByteCodeExprGen and ByteCodeStmtGen (PR #83683)

2024-06-27 Thread Timm Baeder via cfe-commits
tbaederr wrote: That failure looks like it's just a case of https://github.com/llvm/llvm-project/issues/54972 https://github.com/llvm/llvm-project/pull/83683 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang] Implement function pointer type discrimination (PR #96992)

2024-06-28 Thread Timm Baeder via cfe-commits
@@ -2220,6 +2220,11 @@ llvm::Constant *ConstantLValueEmitter::emitPointerAuthPointer(const Expr *E) { // The assertions here are all checked by Sema. assert(Result.Val.isLValue()); + const auto *Base = Result.Val.getLValueBase().get(); + if (const auto *Decl = dyn_cast_

[clang] [Clang][ExprConstant] fix constant expression did not evaluate to integer (PR #97146)

2024-06-29 Thread Timm Baeder via cfe-commits
@@ -15858,7 +15858,7 @@ static bool FastEvaluateAsRValue(const Expr *Exp, Expr::EvalResult &Result, } if (const auto *CE = dyn_cast(Exp)) { -if (CE->hasAPValueResult()) { +if (CE->hasAPValueResult() && !CE->getAPValueResult().isLValue()) { tbaeder

[clang] [clang][bytecode] Implement base casts on integral pointers (PR #108340)

2024-09-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108340 Get the right offset to apply from the RecordLayout. >From af62225a90e3dd2ebd234c391a4e05dd1d1d7df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 12 Sep 2024 09:36:17 +0200 Subject: [

[clang] [clang][bytecode] Fix modify_global diagnostics in C++11 (PR #108358)

2024-09-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108358 We shouldn't emit this until C++14. >From 82627320e5b3ec07f01d9f1761e5e871b1dc5919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 12 Sep 2024 12:44:48 +0200 Subject: [PATCH] [clang][by

[clang] [clang][bytecode] Fix modify_global diagnostics in C++11 (PR #108358)

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

[clang] [clang][bytecode] Add support for creating dummies for expressions (PR #108394)

2024-09-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108394 None >From 39e7df01a18e43a681e20e375afcd0dc8e67432c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 12 Sep 2024 15:16:08 +0200 Subject: [PATCH] [clang][bytecode] Add support for creatin

[clang] [clang][bytecode] Implement base casts on integral pointers (PR #108340)

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

[clang] [clang][bytecode] Add support for creating dummies for expressions (PR #108394)

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

[clang] [clang][bytecode] Add support for creating dummies for expressions (PR #108394)

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

[clang] [clang][bytecode] Implement HLSLVectorTruncation casts (PR #108499)

2024-09-12 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108499 None >From 058053a85bb2fe41b2bb98c2e460df1f74058f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 13 Sep 2024 06:21:25 +0200 Subject: [PATCH] [clang][bytecode] Implement HLSLVectorTru

[clang] [clang][ExprConst] Allow comparisons with string literals (PR #106733)

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

[clang] [clang][bytecode] Fix two-pointer-style std::initializer_lists (PR #107565)

2024-09-13 Thread Timm Baeder via cfe-commits
tbaederr wrote: Apparently I've already pushed this. https://github.com/llvm/llvm-project/pull/107565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement HLSLVectorTruncation casts (PR #108499)

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

[clang] [clang][bytecode] Fix two-pointer-style std::initializer_lists (PR #107565)

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

[clang] [clang][ExprConst] Explicitly reject dependent types without diagnostic (PR #108598)

2024-09-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108598 This should never happen I believe, but if it does, the "non-literal type ''" diagnostic is weird. That dependent type should never reach this stage I believe. If we actually try to generate code for this, we

[clang] [clang][ExprConst] Explicitly reject dependent types without diagnostic (PR #108598)

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

[clang] [clang][bytecode] Fix reinterpret_casts from pointer to non-pointers (PR #108811)

2024-09-16 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/108811 We need to be a little more careful here with whether or nor we are able to do the cast at all or not. >From 462cd5016c72728ed120773a0da0aab1895649b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?

[clang] [clang][bytecode] Fix reinterpret_casts from pointer to non-pointers (PR #108811)

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

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

2024-10-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/67520 >From 55efd18bb177150a1fd170cb1535e225854967a6 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: [PATCH] Warn on RequiresCapability attribute mismatch -

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

2024-10-08 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -2249,7 +2249,7 @@ void fooF1(Foo *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_) { f

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

2024-10-08 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -2282,6 +2308,9 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContex

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/112126 This is a subset of #68288, with hopefully narrower scope. It does not support bitcasting to non-integral types yet. The tests are from #68288 and partially from #74775. The `BitcastBuffer` struct is currentl

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

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

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/112126 >From 6e692d50d9151c4d76518229da101834f449c93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Oct 2024 08:57:48 +0200 Subject: [PATCH] [clang][bytecode] Start implementing __builtin_

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/112126 >From 4eedfc2870d66c3581d78bc4963ec3999b4ce4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Oct 2024 08:57:48 +0200 Subject: [PATCH] [clang][bytecode] Start implementing __builtin_

[clang] [clang][bytecode] Fix __builtin_convertvector with float-cast (PR #112238)

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

[clang] [clang][bytecode] Diagnose reference to non-constexpr variable of const type in C23 constexpr (PR #112211)

2024-10-15 Thread Timm Baeder via cfe-commits
tbaederr wrote: Yup, you can ignore that failure https://github.com/llvm/llvm-project/pull/112211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/112126 >From 6c461a3e463459d8b1b24351f5a74f942aac21d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Oct 2024 08:57:48 +0200 Subject: [PATCH] [clang][bytecode] Start implementing __builtin_

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/112126 >From 113f583cada40dd55804a7174aaef2a239c39951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Oct 2024 08:57:48 +0200 Subject: [PATCH] [clang][bytecode] Start implementing __builtin_

[clang] [clang][bytecode] Fix discarding block expressions (PR #112185)

2024-10-14 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/112185 None >From 8a1887cc301342f11a53aaed903e2f59577ac739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 14 Oct 2024 13:44:54 +0200 Subject: [PATCH] [clang][bytecode] Fix discarding block ex

[clang] [clang][bytecode] Implement __builtin_f{maximum, minimum}_num (PR #112335)

2024-10-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/112335 None >From 1e6dd3b0103d7c81f948f021c0dc4edb825375be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 15 Oct 2024 10:59:41 +0200 Subject: [PATCH] [clang][bytecode] Implement __builtin_f{m

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-15 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , 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/112126 >From f245dbdc7288e6690f8d484cf984069f3970c3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= D

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-15 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: tbaederr wrote: Marking this as a draft until I have fixed things on big-endian hosts. https://github.com/llvm/llvm-project/pull/112126

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-15 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr converted_to_draft https://github.com/llvm/llvm-project/pull/112126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][bytecode] Diagnose reference to non-constexpr variable of const type in C23 constexpr (PR #112211)

2024-10-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/112211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement __builtin_f{maximum, minimum}_num (PR #112335)

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

[clang] [clang][bytecode] Fix source range of uncalled base dtor (PR #111683)

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

[clang] [clang][bytecode] Diagnose class-specific operator delete calls (PR #111700)

2024-10-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111700 None >From e4ec0569603e78f82939d179b06839d2bc3deed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Oct 2024 17:30:44 +0200 Subject: [PATCH] [clang][bytecode] Diagnose class-specific

[clang] [clang][bytecode] Only allow lossless ptr-to-int casts (PR #111669)

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

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

2024-10-08 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , 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/67520 >From 055f7

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

2024-10-08 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: tbaederr wrote: Meh, adding the attribute to the definition and declaration of a member functio

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

2024-10-08 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , 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/67520 >From 055f7

[clang] [clang][bytecode] Make sure ia32_bzhi input is an integer (PR #111505)

2024-10-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111505 None >From 0194defe73dc816fa3993235eac84cb5571e4582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 8 Oct 2024 10:57:14 +0200 Subject: [PATCH] [clang][bytecode] Make sure ia32_bzhi inpu

[clang] [clang][bytecode] Make sure ia32_bzhi input is an integer (PR #111505)

2024-10-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/111505 >From bca04d7c89573c5ec1272fc2621b9e4acfae997e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 8 Oct 2024 10:57:14 +0200 Subject: [PATCH] [clang][bytecode] Make sure ia32_bzhi input is a

[clang] [clang][bytecode] Make sure ia32_bzhi input is an integer (PR #111505)

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

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

2024-10-08 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , 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/67520 >From 055f7

[clang] [clang][bytecode] Fix source range of uncalled base dtor (PR #111683)

2024-10-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111683 Make this emit the same source range as the current interpreter. >From e9a62e3a7f0d14bde4c78f7b3abbd869bad8f4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Oct 2024 16:03:32 +0200

[clang] [clang][bytecode] Implement __builtin_ai32_addcarryx* (PR #111671)

2024-10-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111671 None >From 73aec534d3b1b320855a08638ce5ef410a5de11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Oct 2024 14:55:12 +0200 Subject: [PATCH] [clang][bytecode] Implement __builtin_ai32

[clang] [clang][bytecode] Emit better diagnostic for invalid shufflevector index (PR #111643)

2024-10-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111643 None >From b4bbdf61030978621c07b25dda7790a43f10ab3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Oct 2024 09:22:44 +0200 Subject: [PATCH] [clang][bytecode] Emit better diagnostic f

[clang] [clang][bytecode] Implement __builtin_ai32_addcarryx* (PR #111671)

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

[clang] [clang][bytecode] Only allow lossless ptr-to-int casts (PR #111669)

2024-10-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111669 Only allow those casts if the bitwidth of the two types match. >From 6d68260682f723fa7a010e2fd381da32316ed5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Oct 2024 14:03:39 +0200 S

[clang] [clang][bytecode] Emit better diagnostic for invalid shufflevector index (PR #111643)

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

[clang] [clang][bytecode] Implement __builtin_assume_aligned (PR #111968)

2024-10-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111968 None >From ad01583c5a32d9d3d19d1a0bb459a503c1bccecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 11 Oct 2024 10:34:52 +0200 Subject: [PATCH] [clang][bytecode] Implement __builtin_ass

[clang] [clang][bytecode] Return an lvalue path for dummy pointers (PR #111862)

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

[clang] [clang][bytecode] Use PredefinedExpr as base for its variable (PR #111956)

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

[clang] [clang][ExprConstant] Remove an outdated TODO comment (PR #111959)

2024-10-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111959 Seems like passing the quantities directly seems to work fine. >From b76af9501358a60b7aaa62c5710dab6c65168bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 11 Oct 2024 09:33:13 +0200

[clang] [clang][bytecode] Check number of addcarry/subborrow args (PR #111952)

2024-10-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111952 Apparently this can fail as well. >From 129097176ae2673f8b6a5270edefbf6a787df55b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 11 Oct 2024 07:34:50 +0200 Subject: [PATCH] [clang][byte

[clang] [clang][bytecode] Implement __builtin_assume_aligned (PR #111968)

2024-10-11 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/111968 >From 1fa9d5d93ede0cb84d958d166a5cc725e542e7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 11 Oct 2024 10:34:52 +0200 Subject: [PATCH] [clang][bytecode] Implement __builtin_assume_al

[clang] [clang] Implement constexpr __builtin_bit_cast for complex types (PR #109981)

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

[clang] [clang][bytecode] Fix temporary lvalue base expression (PR #111808)

2024-10-10 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111808 We need to use the MaterializeTemporaryExpr here so the checks in ExprConstant.cpp do the right thing. >From d06e3aab6e01050db6ceaa43b2659623fc8f1f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?

[clang] [clang][bytecode] Fix temporary lvalue base expression (PR #111808)

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

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread Timm Baeder via cfe-commits
tbaederr wrote: > > Can you add a test that passes a non-float value and checks that it's > > rejected? > > Do you mean something like this? > > ``` > $ cat xx.c > #include > > float f(char *a, char *b) { > return fminimum_num(a, b); > } > $ ./bin/clang -std=c23 -O2 -S -emit-llvm xx

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread Timm Baeder via cfe-commits
@@ -15314,6 +15314,32 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { Result = RHS; return true; } + + case Builtin::BI__builtin_fmaximum_num: + case Builtin::BI__builtin_fmaximum_numf: + case Builtin::BI__builtin_fmaximum_numl: + case Builtin::B

[clang] [clang][bytecode] Implement __builtin_assume_aligned (PR #111968)

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

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread Timm Baeder via cfe-commits
tbaederr wrote: Add it as a succcessful test then to check that the `EvaluateFloat` calls don't fail https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread Timm Baeder via cfe-commits
tbaederr wrote: It's not your fault https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExprConstant] Remove an outdated TODO comment (PR #111959)

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

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-04 Thread Timm Baeder via cfe-commits
tbaederr wrote: Generally LGTM. https://github.com/llvm/llvm-project/pull/110986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr __builtin_bit_cast for complex types (PR #109981)

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

[clang] [clang][bytecode] Change isArrayElement() for narrowed composite arrays (PR #111110)

2024-10-04 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/10 Make isArrayElement() return true here, so we can know that such a pointer is in fact an array element and handle it properly in toAPValue(). >From d9ca4e19a4f5f9f17f941661782f20055ba1c6fe Mon Sep 17 00:00:00

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

2024-10-04 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: tbaederr wrote: Hmm, so this is causing problems: ```c++ namespace DoubleLockBug { class Foo { public: Mutex mu_; int a GUARDED_BY(m

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

2024-10-04 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , 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/67520 >From 1c117257921fc1c246fbb9f51e3c95

[clang] [clang][docs] Add documentation for APValue constructors (PR #109994)

2024-10-03 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/109994 >From 5a0832c88169e12e43deb498ead994e04966bb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 25 Sep 2024 16:42:55 +0200 Subject: [PATCH] [clang][docs] Add documentation for APValue con

[clang] [clang][bytecode] Change isArrayElement() for narrowed composite arrays (PR #111110)

2024-10-04 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/10 >From 2a2f13453a467ff4afbc9976a673cacb11b4eace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 4 Oct 2024 08:37:16 +0200 Subject: [PATCH] [clang][bytecode] Change isArrayElement() for na

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

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

[clang] [clang][bytecode] Remove superfluous check from fixed-point div (PR #110478)

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

[clang] [clang][bytecode] Handle DiscardResult for fixed-point literals (PR #110475)

2024-09-30 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/110475 None >From b69e9bb4bca8710fae493086e4c4250a5ab1f249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 30 Sep 2024 11:14:05 +0200 Subject: [PATCH] [clang][bytecode] Handle DiscardResult fo

[clang] [clang][bytecode] Cast fixed-point cmp result to int if necessary (PR #110469)

2024-09-30 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/110469 This is the case in C. >From 4c2de21a53bc6b048c3d7fc8e2a333fd7d13cdcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 30 Sep 2024 11:00:37 +0200 Subject: [PATCH] [clang][bytecode] Cast

[clang] [clang][bytecode] Remove superfluous check from fixed-point div (PR #110478)

2024-09-30 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/110478 We shouldn't do this check for fixed-point values, at least the current interpreter doesn't do it. >From 2be9e0aa010451324cd3a1e873fb8640535823d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= D

[clang] [clang][bytecode] Cast fixed-point cmp result to int if necessary (PR #110469)

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

[clang] [clang][bytecode] Handle DiscardResult for fixed-point literals (PR #110475)

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

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

2024-10-01 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: tbaederr wrote: This example from the failing test should warn I think: ```c++ class Foo { public: void foo1(); void foo2(); void foo3(Foo

[clang] [clang][bytecode] Save a per-Block IsWeak bit (PR #111248)

2024-10-05 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111248 Checking the decl for every load is rather expensive. >From 7011cb6a67c154f2d93036dfcaa381f83e070f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 5 Oct 2024 12:56:31 +0200 Subject: [

[clang] [clang][bytecode] Implement the constexpr built-in abs function. (PR #112459)

2024-10-15 Thread Timm Baeder via cfe-commits
tbaederr wrote: > This patch fixes the issue. What issue? Is there a bug open about this? You didn't implement it for the bytecode interpreter at all, only for the current interpreter. https://github.com/llvm/llvm-project/pull/112459 ___ cfe-commits

[clang] [clang] Implement constexpr __builtin_bit_cast for complex types (PR #109981)

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

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-16 Thread Timm Baeder via cfe-commits
tbaederr wrote: Victory! 1) Iterate composite fields backwards for big-endian targets 2) Fix `BitcatBuffer::data()` pointing to the wrong byte if the number of bytes in the buffer is not a multiple of `sizeof(uint64_t)` (which is what `llvm::BitBuffer` uses internally) and we're on a big-end

<    10   11   12   13   14   15   16   17   18   19   >