[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/130690 >From a945e21869e5276c66ac979acd893d9bd9afe2cc Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Mon, 10 Mar 2025 16:18:34 -0700 Subject: [PATCH 1/4] [CIR] Upstream CastOp and scalar conversions This patch upstrea

[clang] [Clang][NFC] Add test for CWG2289 "Uniqueness of structured binding names" (PR #131054)

2025-03-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yanzuo Liu (zwuis) Changes The resolution of [CWG2289](https://wg21.link/cwg2289) added that the name of a structured binding must be unique in its declarative region, and was implemented in https://github.com/llvm/llvm-project/commit/bd

[clang] [Clang][CodeGen][UBSan] Add more precise attributes to recoverable ubsan handlers (PR #130990)

2025-03-12 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/130990 >From ea0d82d48d7a28467dc4e945314b57bc2b63085c Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 13 Mar 2025 00:39:09 +0800 Subject: [PATCH 1/3] [Clang][CodeGen][UBSan] Add pre-commit tests. NFC. --- cla

[clang] [alpha.webkit.ForwardDeclChecker] Add a new WebKit checker for forward declarations (PR #130554)

2025-03-12 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/130554 >From d2edd9b5fd188476e59790c333497516933532bb Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sun, 9 Mar 2025 23:06:33 -0700 Subject: [PATCH 1/3] [alpha.webkit.ForwardDeclChecker] Add a new WebKit checker for

[clang] [alpha.webkit.webkit.RetainPtrCtorAdoptChecker] Add a new WebKit checker for correct use of RetainPtr, adoptNS, and adoptCF (PR #128679)

2025-03-12 Thread Rashmi Mudduluru via cfe-commits
@@ -3760,6 +3760,26 @@ Here are some examples of situations that we warn about as they *might* be poten NSObject* unretained = retained.get(); // warn } +webkit.RetainPtrCtorAdoptChecker + +The goal of this rule is to make sure the co

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-03-12 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > I'd still prefer to get this right for all address-spaces, so we don't need > to revisit later. Sentinel pointer value support for non-0 address spaces is still work in progress: https://github.com/llvm/llvm-project/pull/83109 I am ok to add a helper like `Address::isConstant

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

2025-03-12 Thread via cfe-commits
higher-performance wrote: So, this is going to sound very silly, but it seems I may have missed the obvious, and the solution may have been extremely simple: `llvm::SmallPtrSet`, on the return value of `clang::DynTypedNode::getMemoizationData()`. The reason is that the original code only ever

[clang] [HLSL][NFC] Update HLSL AST tests to be more readable (PR #130910)

2025-03-12 Thread Alex Sepkowski via cfe-commits
https://github.com/alsepkow approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/130910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenCL] Fix Missing `-fdeclare-opencl-builtins` When Using `--save-temps` (PR #131017)

2025-03-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Yeah these are implemented in bitcode file, therefore it needs the front end > to be able to recognize it instead of treating it as an unknown symbol. In a normal world they would just be in a header and then the library would get linked in later. https://github.com/llvm/llvm

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -33,6 +33,14 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { llvm_unreachable("NYI: PPC double-double format for long double"); llvm_unreachable("Unsupported format for long double"); } + + bool isSized(mlir::Type ty) { +if (mlir::isa(ty)) + r

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

2025-03-12 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/129934 >From 6966e56ddfd9a8c8e6a96b2ec6d977a0b7372ad6 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] [Fuchsia] Add llc to toolchain (PR #130999)

2025-03-12 Thread Petr Hosek via cfe-commits
petrhosek wrote: Can you check the toolchain binary size increase? Is `llc` included in the `llvm` binary? https://github.com/llvm/llvm-project/pull/130999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 nit, else LGTM. https://github.com/llvm/llvm-project/pull/130502 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for emitting ignored statements (PR #130869)

2025-03-12 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1,7 +1,9 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir // RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR -// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o %

[clang] [Sema] Diagnose by-value copy constructors in template instantiations (PR #130866)

2025-03-12 Thread via cfe-commits
@@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template +struct A{ +A(); +A(A&); +A(A); // expected-error{{copy constructor must pass its first argument by reference}} +}; + +void f() { +A a = A(); // expected-note{{in instantiation of template

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-12 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur commented: This is what I would like to do more generally, not just for AIX. This PR however will break using a shared library libflang_rt.runtime.so. Ideally, we would synchronize with the compiler-rt implementation which already has many supporting functions su

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-12 Thread Michael Kruse via cfe-commits
@@ -1345,7 +1345,16 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args, if (AsNeeded) addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false); } -CmdArgs.push_back("-lflang_rt.runtime"); +if (TC.getTriple().isOSAIX()) { +

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -90,20 +89,259 @@ class ScalarExprEmitter : public StmtVisitor { builder.getCIRBoolAttr(e->getValue())); } - mlir::Value VisitCastExpr(CastExpr *E); + mlir::Value VisitCastExpr(CastExpr *e); + + mlir::Value VisitExplicitCastExpr(ExplicitCastExpr *e) { +ret

[clang] [CIR] Upstream support for emitting ignored statements (PR #130869)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -55,10 +55,154 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s, if (mlir::succeeded(emitSimpleStmt(s, useCurrentScope))) return mlir::success(); - // Only a subset of simple statements are supported at the moment. When more - // kinds of statements ar

[clang] [Clang][NFCI] Remove CallExpr::CreateTemporary() (PR #130921)

2025-03-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/130921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Support] Introduce new `AdvisoryLock` interface (PR #130989)

2025-03-12 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/130989 >From cd0b9a8b878c4ecd929552c836f3d4665e926ef4 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 12 Mar 2025 09:37:27 -0700 Subject: [PATCH 1/2] [Support] Introduce new `AdvisoryLock` interface This PR

[clang] [clang][NFCI] Fix getGridValues for unsupported targets (PR #131023)

2025-03-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/131023 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Add GPU profiling flags to driver (PR #94268)

2025-03-12 Thread Ethan Luis McDonough via cfe-commits
@@ -152,7 +152,7 @@ INSTR_PROF_VALUE_NODE(PtrToNodeT, llvm::PointerType::getUnqual(Ctx), Next, \ #define INSTR_PROF_DATA_DEFINED #endif INSTR_PROF_RAW_HEADER(uint64_t, Magic, __llvm_profile_get_magic()) -INSTR_PROF_RAW_HEADER(uint64_t, Version, __llvm_profile_get_version()) +I

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -90,24 +89,279 @@ class ScalarExprEmitter : public StmtVisitor { builder.getCIRBoolAttr(e->getValue())); } - mlir::Value VisitCastExpr(CastExpr *E); + mlir::Value VisitCastExpr(CastExpr *e); + + mlir::Value VisitExplicitCastExpr(ExplicitCastExpr *e) { +ret

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-12 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129408 >From 8995f2517be1235e01cd68d0d68199505b8ffaad Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sat, 1 Mar 2025 19:22:25 -0500 Subject: [PATCH] [clang-tidy] detect explicit casting within modernize-use-defau

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -90,20 +89,259 @@ class ScalarExprEmitter : public StmtVisitor { builder.getCIRBoolAttr(e->getValue())); } - mlir::Value VisitCastExpr(CastExpr *E); + mlir::Value VisitCastExpr(CastExpr *e); + + mlir::Value VisitExplicitCastExpr(ExplicitCastExpr *e) { +ret

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-12 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129408 >From a06de0100d34d3f18b8eca690161b3720620f4af Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sat, 1 Mar 2025 19:22:25 -0500 Subject: [PATCH] [clang-tidy] detect explicit casting within modernize-use-defau

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-12 Thread via cfe-commits
@@ -156,7 +156,8 @@ Changes in existing checks - Improved :doc:`modernize-use-default-member-init ` check by matching - ``constexpr`` and ``static`` values on member initialization. + ``constexpr`` and ``static``` values on member initialization and by detecting explicit

[clang-tools-extra] [clang-tidy] detect explicit casting within modernize-use-default-member-init (PR #129408)

2025-03-12 Thread David Rivera via cfe-commits
@@ -158,6 +158,10 @@ Changes in existing checks ` check by matching ``constexpr`` and ``static`` values on member initialization. +- Improved :doc:`modernize-use-default-member-init + ` check by detecting + explicit casting of built-in types within member list initializa

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Morris Hafner via cfe-commits
@@ -121,29 +375,174 @@ mlir::Value CIRGenFunction::emitScalarExpr(const Expr *e) { return ScalarExprEmitter(*this, builder).Visit(const_cast(e)); } +[[maybe_unused]] static bool MustVisitNullValue(const Expr *e) { + // If a null pointer expression's type is the C++0x nullp

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-03-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/128938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-12 Thread IƱaki Amatria Barral via cfe-commits
https://github.com/inaki-amatria closed https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Refactoring HLSLExternalSemaSource (PR #131032)

2025-03-12 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/131032 Moving builder classes into separate files `HLSLBuiltinTypeDeclBuilder.cpp`/`.h` and changing a some `HLSLExternalSemaSource` methods to private. This is a prep work before we start adding more builtin types an

[clang] [HLSL] Add bounds checks for the HLSL `fmod` vector arguments and return types (PR #131035)

2025-03-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Kaitlin Peng (kmpeng) Changes Fixes #131024. - Fixes template for scalar and vector `fmod` intrinsic overloads - Fixes `fmod` Sema test --- Full diff: https://github.com/llvm/llvm-project/pull/131035.diff 3 Files Affected: - (modified) c

[clang] [Clang] Optimize -Wunsafe-buffer-usage. (PR #125492)

2025-03-12 Thread Ziqing Luo via cfe-commits
@@ -186,106 +212,193 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor { return DynamicRecursiveASTVisitor::TraverseStmt(Node); } + void setASTContext(ASTContext &Context) { ActiveASTContext = &Context; } + + void setHandler(const UnsafeBufferUsageHa

[clang] [clang-repl] Fix target creation in Wasm.cpp (PR #130909)

2025-03-12 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 edited https://github.com/llvm/llvm-project/pull/130909 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 202137dbead88004c956595106ab6d80d597508c 18163c0e0de0704e95392166532011b0e63ea95f --e

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-03-12 Thread Craig Topper via cfe-commits
https://github.com/topperc edited https://github.com/llvm/llvm-project/pull/130973 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for emitting ignored statements (PR #130869)

2025-03-12 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/130869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add bounds checks for the HLSL `fmod` vector arguments and return types (PR #131035)

2025-03-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kaitlin Peng (kmpeng) Changes Fixes #131024. - Fixes template for scalar and vector `fmod` intrinsic overloads - Fixes `fmod` Sema test --- Full diff: https://github.com/llvm/llvm-project/pull/131035.diff 3 Files Affected: - (modified)

[clang] [clang][NFCI] Fix getGridValues for unsupported targets (PR #131023)

2025-03-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/131023 >From 700cedcb1e2c241452f34177d1a597c3d3386e9d Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 12 Mar 2025 13:27:56 -0700 Subject: [PATCH] [clang][NFCI] Fix getGridValues for unsupported targets Signed-

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/130502 >From 0b00b1b477f7d81220350669ecb43f87d2667a6d Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sun, 9 Mar 2025 19:14:34 +0100 Subject: [PATCH 1/6] [CIR] Upstream basic support for ArrayType --- clang/in

[clang] 64b9410 - [CIR] Upstream support for emitting ignored statements (#130869)

2025-03-12 Thread via cfe-commits
Author: Andy Kaylor Date: 2025-03-12T14:38:19-07:00 New Revision: 64b94105d5c7a1a578dc2fb846747411686b666b URL: https://github.com/llvm/llvm-project/commit/64b94105d5c7a1a578dc2fb846747411686b666b DIFF: https://github.com/llvm/llvm-project/commit/64b94105d5c7a1a578dc2fb846747411686b666b.diff L

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/130502 >From 0b00b1b477f7d81220350669ecb43f87d2667a6d Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sun, 9 Mar 2025 19:14:34 +0100 Subject: [PATCH 1/6] [CIR] Upstream basic support for ArrayType --- clang/in

[clang] 0359677 - [Driver] Avoid repeated hash lookups (NFC) (#130888)

2025-03-12 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-03-12T08:47:11-07:00 New Revision: 0359677695a741dcf8e26adee692a0dd285fcb91 URL: https://github.com/llvm/llvm-project/commit/0359677695a741dcf8e26adee692a0dd285fcb91 DIFF: https://github.com/llvm/llvm-project/commit/0359677695a741dcf8e26adee692a0dd285fcb91.diff L

[clang] [HLSL] Add bounds checks for the HLSL `fmod` vector arguments and return types (PR #131035)

2025-03-12 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng created https://github.com/llvm/llvm-project/pull/131035 Fixes #131024. - Fixes template for scalar and vector `fmod` intrinsic overloads - Fixes `fmod` Sema test >From b33ab9d6a3c87c59ca9b2d3e8e5001f1d79bb620 Mon Sep 17 00:00:00 2001 From: kmpeng Date: Tue, 11 Mar 20

[clang] [llvm] Use global TimerGroups for both new pass manager and old pass manager timers (PR #130375)

2025-03-12 Thread Alan Zhao via cfe-commits
@@ -39,19 +39,20 @@ Timer *getPassTimer(Pass *); /// This class implements -time-passes functionality for new pass manager. /// It provides the pass-instrumentation callbacks that measure the pass /// execution time. They collect timing info into individual timers as -/// passe

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -90,24 +89,279 @@ class ScalarExprEmitter : public StmtVisitor { builder.getCIRBoolAttr(e->getValue())); } - mlir::Value VisitCastExpr(CastExpr *E); + mlir::Value VisitCastExpr(CastExpr *e); + + mlir::Value VisitExplicitCastExpr(ExplicitCastExpr *e) { +ret

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -84,26 +96,266 @@ class ScalarExprEmitter : public StmtVisitor { } mlir::Value VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *e) { -mlir::Type type = cgf.convertType(e->getType()); +mlir::Type type = convertType(e->getType()); return builder.create(

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -90,24 +89,279 @@ class ScalarExprEmitter : public StmtVisitor { builder.getCIRBoolAttr(e->getValue())); } - mlir::Value VisitCastExpr(CastExpr *E); + mlir::Value VisitCastExpr(CastExpr *e); + + mlir::Value VisitExplicitCastExpr(ExplicitCastExpr *e) { +ret

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -90,24 +89,279 @@ class ScalarExprEmitter : public StmtVisitor { builder.getCIRBoolAttr(e->getValue())); } - mlir::Value VisitCastExpr(CastExpr *E); + mlir::Value VisitCastExpr(CastExpr *e); + + mlir::Value VisitExplicitCastExpr(ExplicitCastExpr *e) { +ret

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -78,6 +78,156 @@ class LLVMLoweringInfo { class CIR_Op traits = []> : Op, LLVMLoweringInfo; +//===--===// +// CastOp +//===--===// + +

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -90,24 +89,279 @@ class ScalarExprEmitter : public StmtVisitor { builder.getCIRBoolAttr(e->getValue())); } - mlir::Value VisitCastExpr(CastExpr *E); + mlir::Value VisitCastExpr(CastExpr *e); + + mlir::Value VisitExplicitCastExpr(ExplicitCastExpr *e) { +ret

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -121,29 +375,174 @@ mlir::Value CIRGenFunction::emitScalarExpr(const Expr *e) { return ScalarExprEmitter(*this, builder).Visit(const_cast(e)); } +[[maybe_unused]] static bool MustVisitNullValue(const Expr *e) { + // If a null pointer expression's type is the C++0x nullp

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -121,29 +359,159 @@ mlir::Value CIRGenFunction::emitScalarExpr(const Expr *e) { return ScalarExprEmitter(*this, builder).Visit(const_cast(e)); } +[[maybe_unused]] static bool MustVisitNullValue(const Expr *e) { + // If a null pointer expression's type is the C++0x nullp

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -247,6 +280,179 @@ struct ConvertCIRToLLVMPass StringRef getArgument() const override { return "cir-flat-to-llvm"; } }; +mlir::Type CIRToLLVMCastOpLowering::convertTy(mlir::Type ty) const { + return getTypeConverter()->convertType(ty); +} + +mlir::LogicalResult CIRToLLVM

[clang] [llvm] Add support for template as type parameter (PR #127654)

2025-03-12 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Could you please take a look at the attached DWARF and let me know your > concerns with the implementation? Sure - I see the effect, but I still think it's probably not worthwhile due to the limited capacity, inconsistency (due to that limited expressiveness) between direct

[clang] [clang][lit] mkdir before mkstemp in is_filesystem_case_insensitive() (PR #131036)

2025-03-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Arthur Eubanks (aeubanks) Changes In the CMake build test_exec_root already exists here, but not in the gn build, which causes this to fail. --- Full diff: https://github.com/llvm/llvm-project/pull/131036.diff 1 Files Affected: - (modi

[clang] [clang][lit] mkdir before mkstemp in is_filesystem_case_insensitive() (PR #131036)

2025-03-12 Thread Arthur Eubanks via cfe-commits
https://github.com/aeubanks created https://github.com/llvm/llvm-project/pull/131036 In the CMake build test_exec_root already exists here, but not in the gn build, which causes this to fail. >From 6ab707eec90cbe1d8a8f5ddf19765f514b275095 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: We

[clang] cba9dc6 - [libc][nfc] Use common implementation of read_first_lane_u64 (#131027)

2025-03-12 Thread via cfe-commits
Author: Jon Chesterfield Date: 2025-03-12T21:29:46Z New Revision: cba9dc6e9d0455a0c4897c9acf61961b448b9d60 URL: https://github.com/llvm/llvm-project/commit/cba9dc6e9d0455a0c4897c9acf61961b448b9d60 DIFF: https://github.com/llvm/llvm-project/commit/cba9dc6e9d0455a0c4897c9acf61961b448b9d60.diff L

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/130690 >From a945e21869e5276c66ac979acd893d9bd9afe2cc Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Mon, 10 Mar 2025 16:18:34 -0700 Subject: [PATCH 1/5] [CIR] Upstream CastOp and scalar conversions This patch upstrea

[clang] [libc][nfc] Use common implementation of read_first_lane_u64 (PR #131027)

2025-03-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-s390x-linux` running on `systemz-1` while building `clang` at step 2 "checkout". Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/9054 Here is the relevant piece of the build log for t

[clang] [CIR] Upstream basic support for sizeof and alignof (PR #130847)

2025-03-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/130847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc][nfc] Use common implementation of read_first_lane_u64 (PR #131027)

2025-03-12 Thread Jon Chesterfield via cfe-commits
https://github.com/JonChesterfield closed https://github.com/llvm/llvm-project/pull/131027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Amr Hesham via cfe-commits
@@ -33,6 +33,15 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { llvm_unreachable("NYI: PPC double-double format for long double"); llvm_unreachable("Unsupported format for long double"); } + + bool isSized(mlir::Type ty) { +if (mlir::isa(ty)) + r

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -33,6 +33,15 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { llvm_unreachable("NYI: PPC double-double format for long double"); llvm_unreachable("Unsupported format for long double"); } + + bool isSized(mlir::Type ty) { +if (mlir::isa(ty)) + r

[clang] [alpha.webkit.ForwardDeclChecker] Add a new WebKit checker for forward declarations (PR #130554)

2025-03-12 Thread Rashmi Mudduluru via cfe-commits
https://github.com/t-rasmud approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/130554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFCI] Fix getGridValues for unsupported targets (PR #131023)

2025-03-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/131023 I broke this in https://github.com/llvm/llvm-project/commit/f3cd2238383f695c719e7eab6aebec828781ec91, I should have added this to the `SPIRV64` subclass, but I accidentally added it to base `TargetInfo`. >From

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/130502 >From 0b00b1b477f7d81220350669ecb43f87d2667a6d Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sun, 9 Mar 2025 19:14:34 +0100 Subject: [PATCH 1/5] [CIR] Upstream basic support for ArrayType --- clang/in

[clang] c476a4a - [Clang][OpenCL] Fix Missing `-fdeclare-opencl-builtins` When Using `--save-temps` (#131017)

2025-03-12 Thread via cfe-commits
Author: Shilei Tian Date: 2025-03-12T17:00:19-04:00 New Revision: c476a4a907a51371f051fd83987aaeb2c4a011af URL: https://github.com/llvm/llvm-project/commit/c476a4a907a51371f051fd83987aaeb2c4a011af DIFF: https://github.com/llvm/llvm-project/commit/c476a4a907a51371f051fd83987aaeb2c4a011af.diff L

[clang] [llvm] Reapply "[AArch64][SVE] Improve fixed-length addressing modes. (#130263)" (PR #130625)

2025-03-12 Thread Paul Walker via cfe-commits
paulwalker-arm wrote: Sorry for the delay and thanks for the investigation @rj-jesus. This is so not intentional behaviour. VLS based auto vectorisation was implemented before the VLS ACLE extensions and by that time it's likely fixed length calls to `llvm.vscale()` were constant folded a

[clang] [CIR] Upstream basic support for sizeof and alignof (PR #130847)

2025-03-12 Thread Amr Hesham via cfe-commits
@@ -148,3 +150,27 @@ mlir::Value ScalarExprEmitter::VisitCastExpr(CastExpr *ce) { } return {}; } + +/// Return the size or alignment of the type of argument of the sizeof +/// expression as an integer. +mlir::Value ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr( +con

[clang] [Clang][OpenCL] Fix Missing `-fdeclare-opencl-builtins` When Using `--save-temps` (PR #131017)

2025-03-12 Thread Shilei Tian via cfe-commits
https://github.com/shiltian closed https://github.com/llvm/llvm-project/pull/131017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream basic support for sizeof and alignof (PR #130847)

2025-03-12 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/130847 >From 337b23e5ddb8ad9ef470e9c62d6fc136ccb070ee Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Tue, 11 Mar 2025 22:42:28 +0100 Subject: [PATCH 1/3] [CIR] Upstream basic support for sizeof and alignof ---

[clang] [Sema] Diagnose by-value copy constructors in template instantiations (PR #130866)

2025-03-12 Thread via cfe-commits
https://github.com/Megan0704-1 updated https://github.com/llvm/llvm-project/pull/130866 >From 80e764fcfa1912e9d3771f4edb354569741010b7 Mon Sep 17 00:00:00 2001 From: Megan Date: Tue, 11 Mar 2025 17:09:04 -0700 Subject: [PATCH 1/4] [Sema] Diagnose by-value copy constructors in template instanti

[clang] [HLSL][NFC] Refactoring HLSLExternalSemaSource (PR #131032)

2025-03-12 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 1a626e63b5a009075eea87c01f0661144b1ec010 7ebfc826ca27c71ef80f4a1b38b2d3a2e155b777 --e

[clang] [CIR] Upstream support for emitting ignored statements (PR #130869)

2025-03-12 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/130869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc][nfc] Use common implementation of read_first_lane_u64 (PR #131027)

2025-03-12 Thread Jon Chesterfield via cfe-commits
https://github.com/JonChesterfield updated https://github.com/llvm/llvm-project/pull/131027 >From 68f09d0f3f7849b91cb39ce42ba48e3e4aafb488 Mon Sep 17 00:00:00 2001 From: Jon Chesterfield Date: Wed, 12 Mar 2025 20:31:39 + Subject: [PATCH] [libc][nfc] Use common implementation of read_first_l

[clang] [CIR] Upstream support for emitting ignored statements (PR #130869)

2025-03-12 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,53 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o

[clang] [libc][nfc] Use common implementation of read_first_lane_u64 (PR #131027)

2025-03-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. This means that `nvptxintrin.h` and `amdgpuintrin.h` can't be included standalone, but I'm not sure it's a big deal since we already define a lot of the common functionality in the `gpurintrin.h` header. https://github.com/llvm/llvm-projec

[clang] [Clang][OpenCL] Fix Missing `-fdeclare-opencl-builtins` When Using `--save-temps` (PR #131017)

2025-03-12 Thread Shilei Tian via cfe-commits
shiltian wrote: Yeah these are implemented in bitcode file, therefore it needs the front end to be able to recognize it instead of treating it as an unknown symbol. https://github.com/llvm/llvm-project/pull/131017 ___ cfe-commits mailing list cfe-comm

[clang] [clang][NFCI] Fix getGridValues for unsupported targets (PR #131023)

2025-03-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/131023 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFCI] Fix getGridValues for unsupported targets (PR #131023)

2025-03-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/131023 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Andy Kaylor via cfe-commits
@@ -33,6 +33,14 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { llvm_unreachable("NYI: PPC double-double format for long double"); llvm_unreachable("Unsupported format for long double"); } + + bool isSized(mlir::Type ty) { +if (mlir::isa(ty)) + r

[clang] [clang][NFCI] Fix getGridValues for unsupported targets (PR #131023)

2025-03-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nick Sarnie (sarnex) Changes I broke this in https://github.com/llvm/llvm-project/commit/f3cd2238383f695c719e7eab6aebec828781ec91, I should have added this to the `SPIRV64` subclass, but I accidentally added it to base `TargetInfo`. ---

[clang] [CIR] Upstream support for emitting ignored statements (PR #130869)

2025-03-12 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/130869 >From a4e8aa13f97a6c73389822f6fdcf6f5970792462 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 11 Mar 2025 17:01:44 -0700 Subject: [PATCH 1/2] [CIR] Upstream support for emitting ignored statements Thi

[clang] [libc][nfc] Use common implementation of read_first_lane_u64 (PR #131027)

2025-03-12 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 15e6bb6224177805d8b6a8268f08a2b88ae4dd70 a343ee96a2cadf4c508e12e74568d4cdf63ee75a --e

[clang] [clang] Fix a segfault when M is a nullptr (PR #130712)

2025-03-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This needs a release note and it would be helpful to know how you found this and a test w/ a minimal reproducer. Are there any bugs reports for this? https://github.com/llvm/llvm-project/pull/130712 ___ cfe-commits

[clang] [libc][nfc] Use common implementation of read_first_lane_u64 (PR #131027)

2025-03-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libc Author: Jon Chesterfield (JonChesterfield) Changes No codegen regression on either target. The two builtin_ffs implied on nvptx CSE away. ``` define internal i64 @__gpu_read_first_lane_u64(i64 noundef %__lane_mask, i64 noundef %__x) #2 { entry:

[clang] [libc][nfc] Use common implementation of read_first_lane_u64 (PR #131027)

2025-03-12 Thread Jon Chesterfield via cfe-commits
https://github.com/JonChesterfield created https://github.com/llvm/llvm-project/pull/131027 No codegen regression on either target. The two builtin_ffs implied on nvptx CSE away. ``` define internal i64 @__gpu_read_first_lane_u64(i64 noundef %__lane_mask, i64 noundef %__x) #2 { entry: %shr

[clang] [Clang] Optimize -Wunsafe-buffer-usage. (PR #125492)

2025-03-12 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. https://github.com/llvm/llvm-project/pull/125492 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Use global TimerGroups for both new pass manager and old pass manager timers (PR #130375)

2025-03-12 Thread Arthur Eubanks via cfe-commits
@@ -39,19 +39,20 @@ Timer *getPassTimer(Pass *); /// This class implements -time-passes functionality for new pass manager. /// It provides the pass-instrumentation callbacks that measure the pass /// execution time. They collect timing info into individual timers as -/// passe

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-03-12 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > We only perform this optimization in addrspace(0). I'd still prefer to get this right for all address-spaces, so we don't need to revisit later. But really, I'm more concerned about the "happens to get folded" part: there isn't a stable set of values that get constant-

[clang] [alpha.webkit.webkit.RetainPtrCtorAdoptChecker] Add a new WebKit checker for correct use of RetainPtr, adoptNS, and adoptCF (PR #128679)

2025-03-12 Thread Ryosuke Niwa via cfe-commits
@@ -3760,6 +3760,26 @@ Here are some examples of situations that we warn about as they *might* be poten NSObject* unretained = retained.get(); // warn } +webkit.RetainPtrCtorAdoptChecker + +The goal of this rule is to make sure the co

[clang] Fixes: Can not use C99 function names as variable names in C89 (PR #129979)

2025-03-12 Thread Vinay Deshmukh via cfe-commits
vinay-deshmukh wrote: @frederick-vs-ja Any suggestions on how to go about making further progress on this one? Sort of stuck right now. https://github.com/llvm/llvm-project/pull/129979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [CIR] Add transform test for cir-flatten-cfg (PR #130861)

2025-03-12 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @bcardosolopes Do you have any comments on this before I merge it? https://github.com/llvm/llvm-project/pull/130861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.webkit.RetainPtrCtorAdoptChecker] Add a new WebKit checker for correct use of RetainPtr, adoptNS, and adoptCF (PR #128679)

2025-03-12 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/128679 >From b4001f95cf6d35f59ef8af6df8f2bdbe043da380 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Tue, 25 Feb 2025 00:47:45 -0800 Subject: [PATCH 1/8] [alpha.webkit.webkit.RetainPtrCtorAdoptChecker] Add a new WebK

[clang] [alpha.webkit.ForwardDeclChecker] Add a new WebKit checker for forward declarations (PR #130554)

2025-03-12 Thread Ryosuke Niwa via cfe-commits
@@ -0,0 +1,335 @@ +//===- ForwardDeclChecker.cpp *- 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: Ap

[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

2025-03-12 Thread Erich Keane via cfe-commits
@@ -33,6 +33,14 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { llvm_unreachable("NYI: PPC double-double format for long double"); llvm_unreachable("Unsupported format for long double"); } + + bool isSized(mlir::Type ty) { +if (mlir::isa(ty)) + r

[clang] [alpha.webkit.ForwardDeclChecker] Add a new WebKit checker for forward declarations (PR #130554)

2025-03-12 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/130554 >From d2edd9b5fd188476e59790c333497516933532bb Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sun, 9 Mar 2025 23:06:33 -0700 Subject: [PATCH 1/3] [alpha.webkit.ForwardDeclChecker] Add a new WebKit checker for

  1   2   3   4   5   >