[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/91692 >From 2e442967c20b930788ac0818b4ce10daf2792f91 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 9 May 2024 19:40:46 -0700 Subject: [PATCH] [Sema] Fix handling of fields with initializers in nested an

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/91692 >From 6123b5f43b11f968474baa15623c4bf4d14ed188 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 9 May 2024 19:40:46 -0700 Subject: [PATCH] [Sema] Fix handling of fields with initializers in nested an

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: Left some review comments. Please land https://github.com/llvm/llvm-project/pull/94083 first. I agree it makes sense to land this in essentially its current form; it seems to be the right algorithm. https://github.com/llvm/llvm-project/pull/93362 _

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/93362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -33,6 +33,7 @@ static_library("IPO") { "DeadArgumentElimination.cpp", "ElimAvailExtern.cpp", "EmbedBitcodePass.cpp", +"ExpandVariadics.cpp", efriedma-quic wrote: There's a bot that updates the gn files automatically... so unless you're buil

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [libc] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1037 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-06-03 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Since nothing should be using preserve_none on aarch64 yet, it's probably fine to just fix forward. > I'm not sure under what conditions issues present for this We only allocate a base pointer under restricted circumstances (primarily, functions with dynamic allocation),

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/91692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-06-04 Thread Eli Friedman via cfe-commits
@@ -8287,6 +8289,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, SDValue InGlue; if (RequiresSMChange) { + +if (Subtarget->hasSVE()) { efriedma-quic wrote: If there's no DWARF unwind, nothing can unwind the stack whether or not we store

[clang] [clang CodeGen] Restrict return statements nested in return statements. (PR #94282)

2024-06-04 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: You're right, we have issues anytime we construct an object directly into the return value slot, and the check isn't catching all those cases. It shouldn't really be visible to users unless you're constructing an object using a non-trivial constructor... but the codegen i

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Eli Friedman via cfe-commits
@@ -5348,18 +5348,8 @@ Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) { return llvm::UndefValue::get(ArgTy); } - // FIXME Volatility. - llvm::Value *Val = Builder.CreateLoad(ArgPtr); - - // If EmitVAArg promoted the type, we must truncate it. - if (ArgTy !=

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Eli Friedman via cfe-commits
@@ -761,6 +761,10 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { if (Field->hasAttr()) AllowOverwrite = true; } else { + llvm::Type *LoadType = CGM.getTypes().convertTypeForLoadStore( efriedma-quic wrot

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-04 Thread Eli Friedman via cfe-commits
@@ -128,6 +128,15 @@ class CodeGenTypes { /// memory representation is usually i8 or i32, depending on the target. llvm::Type *ConvertTypeForMem(QualType T, bool ForBitField = false); + /// Check that size and abi alignment of given LLVM type matches size and + /// align

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: llvm::PointerType::getUnqual assumes pointers to addr-space 0 are "unqualified"... but the discussion on #88182 concluded that doesn't make sense: the "unqualified" address space is a target-specific choice, and address-space zero isn't required to have any meaning at all.

[clang] Use pushFullExprCleanup for deferred destroy (PR #88670)

2024-04-15 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -emit-llvm -fexceptions -o - %s -triple x86_64-linux-gnu | FileCheck -check-prefixes=EH,CHECK %s +// RUN: %clang_cc1 -emit-llvm -o - %s -triple x86_64-linux-gnu | FileCheck -check-prefixes=NOEH,CHECK %s +namespace std { + typedef decltype(si

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-15 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Please also fix llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp https://github.com/llvm/llvm-project/pull/88455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Use pushFullExprCleanup for deferred destroy (PR #88670)

2024-04-15 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -emit-llvm -fexceptions -o - %s -triple x86_64-linux-gnu | FileCheck -check-prefixes=EH,CHECK %s +// RUN: %clang_cc1 -emit-llvm -o - %s -triple x86_64-linux-gnu | FileCheck -check-prefixes=NOEH,CHECK %s +namespace std { + typedef decltype(si

[clang] Use pushFullExprCleanup for deferred destroy (PR #88670)

2024-04-15 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88670 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-15 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Parameterize Initialization of `clang::CodeGenerator` on a `TargetInfo` instance which may differ from the one in the `ASTContext` (PR #88977)

2024-04-16 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I don't understand the scenario you're envisioning here. If, for example, `sizeof(long)` is different in the AST vs. CodeGen, everything will very likely explode. And I don't want to make an open-ended commitment to support modifying properties of the target based on wha

[clang] [Coverage][NFC] Avoid visiting non-unique `OpaqueValueExpr` (PR #88910)

2024-04-16 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-16 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I don't think this works correctly? You need to evaluate both the getCommonExpr(), and the getSubExpr(). https://github.com/llvm/llvm-project/pull/1 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [Coverage] Handle array decomposition correctly (PR #88881)

2024-04-16 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Say you have: ``` int foo(); struct A { A(); A(const A&, int = foo()); }; struct B { A a[10]; }; void f(const B& b) { B bb = b; } ``` We want to visit the call to foo(), I think? https://github.com/llvm/llvm-project/pull/1 __

[clang] [Coverage][NFC] Avoid visiting non-unique `OpaqueValueExpr` (PR #88910)

2024-04-16 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Looks like automation didn't trigger for some reason... but quoting the automated message that's supposed to trigger: > ⚠️ We detected that you are using a GitHub private e-mail address to > contribute to the repo. > Please turn off [Keep my email addresses > private](htt

[clang] [ARM64EC] Fix arm_neon.h on ARM64EC. (PR #88572)

2024-04-16 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/88572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread Eli Friedman via cfe-commits
@@ -154,11 +154,20 @@ llvm::Value *CodeGen::emitRoundPointerUpToAlignment(CodeGenFunction &CGF, llvm::Value *Ptr, CharUnits Align) { // OverflowArgArea = (OverflowArgArea

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-16 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,1056 @@ +//===-- ExpandVariadicsPass.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: Apach

[clang] Re-apply "Emit missing cleanups for stmt-expr" and other commits (PR #89154)

2024-04-17 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: What, if anything, about the scenario you're describing is specific to "normal" cleanups? https://github.com/llvm/llvm-project/pull/89154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-17 Thread Eli Friedman via cfe-commits
@@ -844,7 +847,18 @@ const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( if (const FieldDecl *Field = efriedma-quic wrote: FieldNo and Layout are referring to fields of "RD"; the "Field" found in the recursive visit is a member of Record (or

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-17 Thread Eli Friedman via cfe-commits
@@ -844,7 +847,18 @@ const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( if (const FieldDecl *Field = efriedma-quic wrote: Maybe instead of looking for RecordDecls, this code should be looking for fields where the type of the field is an anon

[clang] [ARM64EC] Add softintrin.lib as an implicit dependency to object files. (PR #89171)

2024-04-17 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/89171 This copies MSVC behavior, and avoids weird link errors in certain cases. >From 617b140cbd0c878bb6f4994d89aae3bbd8ea2754 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 17 Apr 2024 23:04:50 -0700 Su

[clang] [ARM64EC] Add softintrin.lib as an implicit dependency to object files. (PR #89171)

2024-04-17 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/89171 >From 39eeb2e7a0f5d82dffdbcb179a1ec967db235264 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 17 Apr 2024 23:04:50 -0700 Subject: [PATCH] [ARM64EC] Add softintrin.lib as an implicit dependency to o

[clang] [InstallAPI][Tests] Update tests to be resilient to reversion iteration config (PR #89270)

2024-04-18 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: How hard would it be to make the output here have a consistent order? I mean, emitting diagnostics in a consistent order isn't nearly as important as emitting consistent binaries, but it's still nice to have if we can get it easily. https://github.com/llvm/llvm-project/p

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-18 Thread Eli Friedman via cfe-commits
@@ -844,7 +847,18 @@ const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( if (const FieldDecl *Field = efriedma-quic wrote: > if there's an inner struct that's not accessible, that doesn't affect the > offsets of fields outside of that inner

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/89126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/89126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-18 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,22 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2 -Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s + +struct foo { + struct bar { +int cou

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: We should probably apply the same fix to CountCountedByAttrs. Along those lines, we should be able to handle: ``` struct bar { int count; int array[] __attribute__((counted_by(count))); }; struct foo { struct bar x; }; void init(void * __attribute

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-18 Thread Eli Friedman via cfe-commits
@@ -826,29 +826,31 @@ const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( ASTContext &Ctx, const RecordDecl *RD, StringRef Name, uint64_t &Offset) { const LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel = getLangOpts().getStrictFlexArraysLe

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-18 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,22 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2 -Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s + +struct foo { + struct bar { +int cou

[clang] [ARM64EC] Add softintrin.lib as an implicit dependency to object files. (PR #89171)

2024-04-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/89171 >From 39eeb2e7a0f5d82dffdbcb179a1ec967db235264 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 17 Apr 2024 23:04:50 -0700 Subject: [PATCH] [ARM64EC] Add softintrin.lib as an implicit dependency to o

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-18 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,40 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2 -Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s + +struct foo { + int x,y,z; + struct bar

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-04-18 Thread Eli Friedman via cfe-commits
@@ -1105,6 +1105,11 @@ bool MicrosoftCXXABI::hasMostDerivedReturn(GlobalDecl GD) const { static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, CodeGenModule &CGM) { + // If the record is marked with the trivial_abi attribute, we don'

[clang] [clang] fix half && bfloat16 convert node expr codegen (PR #89051)

2024-04-18 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: For the vector case, I think you want __builtin_convertvector or something like that https://github.com/llvm/llvm-project/pull/89051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-04-19 Thread Eli Friedman via cfe-commits
@@ -8001,6 +8007,22 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +// SME functions may require SVE to be available for unwinding, as the +// value of VG needs to be preserved across streaming-mode changes. +if (CallerFD &

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM Please don't forget to fix CountCountedByAttrs... but it's fine if it's in a followup. https://github.com/llvm/llvm-project/pull/89126 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [Clang] Loop over FieldDecls instead of all Decls (PR #89453)

2024-04-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/89453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM64EC] Add softintrin.lib as an implicit dependency to object files. (PR #89171)

2024-04-19 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/89171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

2024-04-19 Thread Eli Friedman via cfe-commits
@@ -826,29 +826,32 @@ const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( ASTContext &Ctx, const RecordDecl *RD, StringRef Name, uint64_t &Offset) { const LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel = getLangOpts().getStrictFlexArraysLe

[clang] [Clang][NFC] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Strictly speaking, I don't think this is NFC. Consider, for example: ``` struct S { struct X { int array[1]; } x; struct Y { int count; int array[] __attribute__((__counted_by__(count))); } y; }; void f(void* __attribute__((pass_dynamic_object_size(0; void g(struct

[clang] [Clang] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: If you can pull it off without increasing the size of Decl, sure; not sure it's worthwhile otherwise. https://github.com/llvm/llvm-project/pull/89462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread Eli Friedman via cfe-commits
@@ -930,12 +931,12 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, // Get the flexible array member Decl. const RecordDecl *OuterRD = nullptr; - std::string FAMName; + const FieldDecl *FAMDecl = nullptr; if (const auto *ME = dyn_cast(Bas

[clang] [clang] fix half && bfloat16 convert node expr codegen (PR #89051)

2024-04-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/89051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix half && bfloat16 convert node expr codegen (PR #89051)

2024-04-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/89051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix half && bfloat16 convert node expr codegen (PR #89051)

2024-04-22 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,194 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16 -S -emit-llvm %s -o - | FileCheck %s +// CHECK-LABEL: define dso_local half @test

[clang] [clang] fix half && bfloat16 convert node expr codegen (PR #89051)

2024-04-22 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Looks like automation didn't trigger, but: > ⚠️ We detected that you are using a GitHub private e-mail address to > contribute to the repo. > Please turn off [Keep my email addresses > private](https://github.com/settings/emails) setting in your account. > See [LLVM > Dis

[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

2024-04-22 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I'm still not happy with the AST representation here. The current representation is likely to cause unpredictable results in edge cases, and compatibility constraints mean whatever result the current version happens to produce for those cases is locked in forever. And th

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Eli Friedman via cfe-commits
@@ -10909,6 +10909,14 @@ QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS, if (isObjCPointer && checkArithmeticOnObjCPointer(*this, Loc, PExp)) return QualType(); + // Arithmetic on label addresses is normally allowed, except when we add + // a pt

[clang] [Clang] Ignore empty FieldDecls when asking for the field number (PR #100040)

2024-07-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/100040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Don't crash on sizeless output. (PR #99849)

2024-07-22 Thread Eli Friedman via cfe-commits
@@ -2751,7 +2751,10 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { if (RequiresCast) { unsigned Size = getContext().getTypeSize(QTy); -Ty = llvm::IntegerType::get(getLLVMContext(), Size); +if (Size) + Ty = llvm::IntegerType::get

[clang] [clang][CodeGen] Don't crash on sizeless output. (PR #99849)

2024-07-22 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: not %clang_cc1 -S %s -o /dev/null 2>&1 | FileCheck %s efriedma-quic wrote: Please use "-verify" to check clang diagnostics, not FileCheck. Is there any existing file with inline asm diagnostics this can be added to? https://github.com/l

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/99579 >From 1137011c51285b083cab6c15de670e64337d3de0 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 18 Jul 2024 14:51:13 -0700 Subject: [PATCH 1/6] [ExprConstant] Handle shift overflow the same way as ot

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/99579 >From 1137011c51285b083cab6c15de670e64337d3de0 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 18 Jul 2024 14:51:13 -0700 Subject: [PATCH 1/6] [ExprConstant] Handle shift overflow the same way as ot

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-22 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: There's some existing coverage of the affected diagnostics, which shows we continue to produce those diagnostics... but I added a few more tests for in-class static member variables. https://github.com/llvm/llvm-project/pull/99579 __

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-24 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/99579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-24 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic milestoned https://github.com/llvm/llvm-project/pull/99579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-24 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: /cherry-pick 20eff68 https://github.com/llvm/llvm-project/pull/99579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Allow 'convergent' to be a statement attribute (PR #100637)

2024-07-25 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Missing testcase for the generated IR. https://github.com/llvm/llvm-project/pull/100637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2024-07-25 Thread Eli Friedman via cfe-commits
@@ -1,8 +1,8 @@ // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s -O2 | FileCheck %s -// Make sure the call to b() doesn't get optimized out. +// Make sure the call to b() is eliminated. extern struct x {char& x,y;}y; int b(); int a() { if (!&y.x) b();

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2024-07-25 Thread Eli Friedman via cfe-commits
@@ -2799,9 +2799,30 @@ CodeGenFunction::EmitLoadOfReference(LValue RefLVal, llvm::LoadInst *Load = Builder.CreateLoad(RefLVal.getAddress(), RefLVal.isVolatile()); CGM.DecorateInstructionWithTBAA(Load, RefLVal.getTBAAInfo()); - return makeNaturalAddressForPointer(Load

[clang] [SystemZ][z/OS] Implement z/OS XPLINK ABI (PR #91384)

2024-07-25 Thread Eli Friedman via cfe-commits
@@ -532,9 +533,298 @@ bool SystemZTargetCodeGenInfo::isVectorTypeBased(const Type *Ty, return false; } +//===--===// +// z/OS XPLINK ABI Implementation +//===

[clang] clang: Allow targets to set custom metadata on atomics (PR #96906)

2024-07-25 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/96906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ARM64EC] Add support for hybrid_patchable attribute. (PR #99478)

2024-07-25 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM (Please cherry-pick to 19; I'd like to have this in 19. And maybe https://github.com/cjacek/llvm-project/commit/4febef20ab27ef4440e9dccf3cc65dd6be1f4d7c, if you wouldn't mind opening a pull request for that.) https://github.co

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-07-25 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: As a matter of ensuring the behavior is predictable, I don't like IgnoreParenImpCasts(), and more generally looking through casts without checking the CastKind; it very easily leads to bugs because some casts have important semantics. Particularly lv

[clang] [clang] Allow 'convergent' to be a statement attribute (PR #100637)

2024-07-25 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,99 @@ +// RUN: %clang_cc1 -emit-llvm %s -triple x86_64-unknown-linux-gnu -o - | FileCheck %s efriedma-quic wrote: Consider using update_cc_test_checks.py. I'd like to see checks that we emit convergence tokens on targets where that's the default. h

[clang] [clang] Allow 'convergent' to be a statement attribute (PR #100637)

2024-07-25 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,99 @@ +// RUN: %clang_cc1 -emit-llvm %s -triple x86_64-unknown-linux-gnu -o - | FileCheck %s efriedma-quic wrote: Please don't merge an "auto-generated" file that isn't actually autogenerated by the in-tree version. (Is --check-attributes not what y

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-07-25 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I agree you want to look through some casts... but I'd like to see a check of `getCastKind()` to ensure the cast you're looking through is a cast you're expecting to see. Skipping over CK_BitCast should be fine; I'm concerned you'll end up skipping over something that act

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-07-26 Thread Eli Friedman via cfe-commits
@@ -1185,6 +1189,9 @@ Currently, only the following parameter attributes are defined: value should be sign-extended to the extent required by the target's ABI (which is usually 32-bits) by the caller (for a parameter) or the callee (for a return value). +``noext``

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-07-26 Thread Eli Friedman via cfe-commits
@@ -2,7 +2,7 @@ ; PR933 efriedma-quic wrote: There shouldn't be tests in test/CodeGen/X86 using the default target triple... probably the tests should be relocated or fixed. https://github.com/llvm/llvm-project/pull/100757 _

[clang] [clang] Check inline defs when emitting speculative vtable (PR #100785)

2024-07-26 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Can you give a self-contained example that shows why this is a problem? (I mean, I can imagine there could be some interaction that causes issues, but I'm not sure what that interaction is, in this context.) https://github.com/llvm/llvm-project/pull/100785 ___

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-07-27 Thread Eli Friedman via cfe-commits
@@ -1185,6 +1189,9 @@ Currently, only the following parameter attributes are defined: value should be sign-extended to the extent required by the target's ABI (which is usually 32-bits) by the caller (for a parameter) or the callee (for a return value). +``noext``

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: We already have some code for detecting variable inits that access the variable; see isAccessedBy() in CGDecl.cpp. https://github.com/llvm/llvm-project/pull/101038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: >So I think this supports the notion that this should be a dialect, and we have >to wire defaults differently in MSVC mode as well. I doubt anyone is intentionally depending on equality here. > C++ does have some restrictions on accessing objects that are being > initiali

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > > And C++17 rules forbid a copy on the caller side: "guaranteed copy elision" > > means semantically, there is no copy. > > An extra copy is permitted for trivially-copyable types; otherwise we'd be > required to pass and return all classes indirectly. So we're not forbi

[clang] [clang][CodeGen] Don't crash on output whose size is zero. (PR #99849)

2024-07-29 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/99849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-29 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: Approach generally seems fine; not sure I'll have time to look more closely. https://github.com/llvm/llvm-project/pull/101083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-29 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/101083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-29 Thread Eli Friedman via cfe-commits
@@ -4057,6 +4057,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD, Scope *S, NewQType)) return MergeCompatibleFunctionDecls(New, Old, S, MergeTypeWithOld); +if (getLangOpts().HLSL && Cont

[clang] [clang CodeGen] Restrict return statements nested in return statements. (PR #94282)

2024-07-29 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/94282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang CodeGen] Restrict return statements nested in return statements. (PR #94282)

2024-07-29 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Don't have time to continue looking at this for now. https://github.com/llvm/llvm-project/pull/94282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-29 Thread Eli Friedman via cfe-commits
@@ -4057,6 +4057,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD, Scope *S, NewQType)) return MergeCompatibleFunctionDecls(New, Old, S, MergeTypeWithOld); +if (getLangOpts().HLSL && Cont

<    3   4   5   6   7   8   9   10   11   12   >