[clang] [MS] Put dllexported inline global initializers in a comdat (PR #107154)

2024-09-03 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: If there isn't a way to emit conforming code, then I think it's fine to emit non-conforming code, as long as there's an appropriate comment. Breaking the ABI is clearly worse. Does this impact non-MS targets? https://github.com/llvm/llvm-project/pull/107154 _

[clang] [MS] Put dllexported inline global initializers in a comdat (PR #107154)

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

[clang] [Clang][CodeGen] Don't emit assumptions if current block is unreachable. (PR #106936)

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

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

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

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

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

[clang] [clang] Fix FnInfoOpts::operator&= and FnInfoOpts::operator|= not updating assigned operands (PR #107050)

2024-09-05 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM... but in the future, please try to make the commit message indicate what effects this has. (I'll rewrite it this time.) https://github.com/llvm/llvm-project/pull/107050 ___ cfe-commit

[clang] [clang] Fix FnInfoOpts::operator&= and FnInfoOpts::operator|= not updating assigned operands (PR #107050)

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

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

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

[clang] [llvm] [DirectX] Add DirectXTargetCodeGenInfo (PR #104856)

2024-09-05 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,53 @@ +//===- DirectX.cpp-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [llvm] [ARM] Save floating point registers and status registers with save_fp function attribute (PR #89654)

2024-09-06 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,34 @@ +// REQUIRES: arm-registered-target +// RUN: %clang -target arm-none-none-eabihf -mcpu=cortex-r5 -mfpu=vfpv3-d16 -marm -S -o - %s \ +// RUN: | FileCheck %s --check-prefix=CHECK-R +// RUN: %clang -target arm-none-none-eabihf -mcpu=cortex-r5 -mfpu=vfpv3-d16 -mthum

[clang] [llvm] [ARM] Save floating point registers and status registers with save_fp function attribute (PR #89654)

2024-09-06 Thread Eli Friedman via cfe-commits
@@ -338,10 +338,16 @@ def warn_anyx86_excessive_regsave : Warning< InGroup>; def warn_arm_interrupt_vfp_clobber : Warning< "interrupt service routine with vfp enabled may clobber the " - "interruptee's vfp state">, + "interruptee's vfp state; " + "consider using the `int

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-06 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Isn't this a bug in the mangler? I mean, it's better to print an error rather than silently miscompile, but this doesn't really solve the issue. https://github.com/llvm/llvm-project/pull/107581 ___ cfe-commits mailing list cfe-com

[clang] [TBAA] Emit "omnipotent char" for intrinsics with type cast (PR #107793)

2024-09-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: See https://reviews.llvm.org/D119319; CC @sdesmalen-arm @paulwalker-arm https://github.com/llvm/llvm-project/pull/107793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > The SME type attributes are not part of the name mangling If `int(&)() __arm_streaming` is a different type from `int(&)()` for template instantiation, it should have different mangling. If it doesn't, that's a bug. If there is no spec for the correct mangling, someone

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: (You shouldn't need to special-case lambdas; any use of the type needs the appropriate mangling, except maybe the function declaration itself.) https://github.com/llvm/llvm-project/pull/107581 ___ cfe-commits mailing list cfe-comm

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

2024-09-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: You mean, if all three operands are boolean vectors? I'm surprised that doesn't already work. https://github.com/llvm/llvm-project/pull/91306 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

2024-09-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The relevant bit of code is: ``` // The OpenCL operator with a vector condition is sufficiently // different to merit its own checker. if ((getLangOpts().OpenCL && Cond.get()->getType()->isVectorType()) || Cond.get()->getType()->isExtVectorType()) return Open

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-09-09 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: ExprConstant.cpp currently assumes that an CK_HLSLVectorTruncation can't return a scalar type. https://github.com/llvm/llvm-project/pull/104844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [lld] [llvm] [clang][MIPS] Add support for mipsel-windows-* targets (PR #107744)

2024-09-09 Thread Eli Friedman via cfe-commits
=?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Poussineau , =?utf-8?q?Hervé?= Po

[clang] [llvm] [ARM] Save floating point registers and status registers with save_fp function attribute (PR #89654)

2024-09-09 Thread Eli Friedman via cfe-commits
@@ -0,0 +1,34 @@ +// REQUIRES: arm-registered-target +// RUN: %clang -target arm-none-none-eabihf -mcpu=cortex-r5 -mfpu=vfpv3-d16 -marm -S -o - %s \ +// RUN: | FileCheck %s --check-prefix=CHECK-R +// RUN: %clang -target arm-none-none-eabihf -mcpu=cortex-r5 -mfpu=vfpv3-d16 -mthum

[clang] [NFC] Move warning from CodeGen to Sema. (PR #107397)

2024-09-09 Thread Eli Friedman via cfe-commits
@@ -6784,6 +6784,10 @@ def warn_arc_lifetime_result_type : Warning< "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 " "lifetime qualifier on return type is ignored">, InGroup; +def warn_next_larger_fp_type_same_size_than_fp : Warning< + "higher

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-11 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Sure, it makes sense to print a diagnostic for lambdas. - I'm having a bit of trouble understanding the way the new code is structured. What makes the definition of lambda call operators special here? Do we not call GetOrCreateLLVMFunction with IsForDefinition set?

[clang] [WIP][Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I'd expect some kind of diagnostic when the specified field doesn't have a corresponding counted_by field. https://github.com/llvm/llvm-project/pull/102549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-08-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: There's some followup discussion suggesting a different IR representation at https://github.com/llvm/llvm-project/pull/102199#discussion_r1706094411 . https://github.com/llvm/llvm-project/pull/96478 ___ cfe-commits mailing list

[clang] [llvm] [IR] Add method to GlobalVariable to change type of initializer. (PR #102553)

2024-08-08 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/102553 With opaque pointers, nothing directly uses the value type, so we can mutate it if we want. This avoid doing a complicated RAUW dance. >From f3151c0b623881ca29d4c965f93cf5aa0714d32e Mon Sep 17 00:00:00 2

[clang] [llvm] [IR] Add method to GlobalVariable to change type of initializer. (PR #102553)

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

[clang] [WIP][Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: So the idea here is that if the struct in question uses counted_by, you automatically set the count... and if, for whatever reason, the compiler can't find the corresponding field, you just throw away the count? That seems like an terrifying API; it's impossible to predic

[clang] Add flag to suppress overflow errors in C++ constant expressions. (PR #102390)

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

[clang] Add flag to suppress overflow errors in C++ constant expressions. (PR #102390)

2024-08-11 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Note I'm not really attached to merging this either. I mostly posted this to have a space to discuss the consequences of #70307/#100452. If the decision is that we don't want this, I'm fine with that. Also, if we change our mind based on user reports, this would be prett

[clang] [X86_64] Fix empty field error in vaarg of C++. (PR #101639)

2024-08-11 Thread Eli Friedman via cfe-commits
@@ -3124,26 +3124,76 @@ RValue X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, CGF.Builder.CreateStore(V, CGF.Builder.CreateStructGEP(Tmp, 1)); RegAddr = Tmp.withElementType(LTy); - } else if (neededInt) { -RegAddr = Address(CGF.Builder.CreateG

[clang] [X86_64] Fix empty field error in vaarg of C++. (PR #101639)

2024-08-12 Thread Eli Friedman via cfe-commits
@@ -3124,26 +3124,76 @@ RValue X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, CGF.Builder.CreateStore(V, CGF.Builder.CreateStructGEP(Tmp, 1)); RegAddr = Tmp.withElementType(LTy); - } else if (neededInt) { -RegAddr = Address(CGF.Builder.CreateG

[clang] [X86_64] Fix empty field error in vaarg of C++. (PR #101639)

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

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-12 Thread Eli Friedman via cfe-commits
@@ -67,33 +327,85 @@ declare i32 @e3(ptr nocapture byval(%struct.LargeStruct) align 16 %in) nounwind ; We can't do tail call since address of s is passed to the callee and part of ; s is in caller's local frame. efriedma-quic wrote: Pretty sure this comment is

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-12 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: Please also add a testcase for something like: ``` struct Large { int x[60]; }; void f(long long a, long long b, Large c, Large d); void g(long long a, long long b, Large c, Large d) { [[clang::musttail]] return f(a,b,d,c); } ``` https://github.com/l

[clang] [llvm] [ARM] musttail fixes (PR #102896)

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

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-12 Thread Eli Friedman via cfe-commits
@@ -540,6 +540,8 @@ class CCState { }); } + void dump() const; efriedma-quic wrote: `#ifndef NDEBUG`? https://github.com/llvm/llvm-project/pull/102896 ___ cfe-commits mailing list cfe-commits@list

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-12 Thread Eli Friedman via cfe-commits
@@ -5085,7 +5085,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, RawAddress SRetAlloca = RawAddress::invalid(); llvm::Value *UnusedReturnSizePtr = nullptr; if (RetAI.isIndirect() || RetAI.isInAlloca() || RetAI.isCoerceAndExpand()) { -if (IsVirtu

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-12 Thread Eli Friedman via cfe-commits
@@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 ; RUN: llc -mtriple armv7 -target-abi aapcs -float-abi soft -O0 -o - < %s \ ; RUN: | FileCheck %s -check-prefix CHECK-SOFT -check-prefix CHECK

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-12 Thread Eli Friedman via cfe-commits
@@ -3088,70 +3057,44 @@ bool ARMTargetLowering::IsEligibleForTailCallOptimization( getEffectiveCallingConv(CalleeCC, isVarArg), getEffectiveCallingConv(CallerCC, CallerF.isVarArg()), MF, C, Ins, CCAssignFnForReturn(CalleeCC, isVarArg), -

[clang] [llvm] [HLSL][DXIL][SPIRV] Create llvm dot intrinsic and use for HLSL (PR #102872)

2024-08-12 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Missing LangRef changes. https://github.com/llvm/llvm-project/pull/102872 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Overflow Pattern Exclusions (PR #100272)

2024-08-12 Thread Eli Friedman via cfe-commits
@@ -195,13 +196,23 @@ static bool CanElideOverflowCheck(const ASTContext &Ctx, const BinOpInfo &Op) { if (!Op.mayHaveIntegerOverflow()) return true; + const UnaryOperator *UO = dyn_cast(Op.E); + + if (UO && UO->getOpcode() == UO_Minus && UO->isIntegerConstantExpr(Ctx)

[clang] [Clang] Overflow Pattern Exclusions (PR #100272)

2024-08-12 Thread Eli Friedman via cfe-commits
@@ -3860,6 +3860,7 @@ class CStyleCastExpr final class BinaryOperator : public Expr { enum { LHS, RHS, END_EXPR }; Stmt *SubExprs[END_EXPR]; + bool ExcludedOverflowPattern = false; efriedma-quic wrote: I'd prefer to avoid increasing the size of BinaryOper

[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

2024-08-13 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > adding nuw is also valid for signed indices here I don't understand how you think this would work; a-1 and a+-1 are required to produce the same result. https://github.com/llvm/llvm-project/pull/103088 ___ cfe-commits mailing l

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-14 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Please fix the diagnostics in pre-C23 mode to mention that we're following C23 rules. https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [clang-repl] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

2024-08-14 Thread Eli Friedman via cfe-commits
@@ -106,9 +101,9 @@ class CodeGenTypes { } CodeGenModule &getCGM() const { return CGM; } ASTContext &getContext() const { return Context; } - const ABIInfo &getABIInfo() const { return TheABIInfo; } + const ABIInfo &getABIInfo() const; efriedma-quic wro

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

2024-08-14 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM... but please consider submitting a patch to expand the explanation in ItaniumCXXABI::canSpeculativelyEmitVTableAsBaseClass. If I'm following correctly, the function in question is, in fact, odr-used in the translation unit in q

[clang] [Clang] Overflow Pattern Exclusions (PR #100272)

2024-08-14 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: I think serialization is missing for the new bit on BinaryOperator. I'm not sure why we're storing it in the first place, though; it's queried in exactly one place, so there isn't really any benefit to precomputing it. https://github.com/llvm/llvm-p

[clang] [Clang] Overflow Pattern Exclusions (PR #100272)

2024-08-14 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM The other thing you could do is modify ScalarExprEmitter::EmitCompare... if it sees an overflow pattern, it passes that down as an argument to the visit of the add. But I guess given the current structure of the code, that gets

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-15 Thread Eli Friedman via cfe-commits
@@ -5085,7 +5085,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, RawAddress SRetAlloca = RawAddress::invalid(); llvm::Value *UnusedReturnSizePtr = nullptr; if (RetAI.isIndirect() || RetAI.isInAlloca() || RetAI.isCoerceAndExpand()) { -if (IsVirtu

[clang] [clang] Handle tm mangling on Solaris in PPMacroExpansion.cpp (PR #100724)

2024-08-15 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The mangler is in clang/lib/AST/ItaniumMangle.cpp; maybe look at CXXNameMangler::mangleStandardSubstitution. https://github.com/llvm/llvm-project/pull/100724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [clang] Handle tm mangling on Solaris in PPMacroExpansion.cpp (PR #100724)

2024-08-15 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The failure is essentially a bootstrap failure. (The buildbot in question is not technically bootstrapping, but it's using clang 18 as the host compiler.) https://github.com/llvm/llvm-project/pull/100724 ___ cfe-commits mailing l

[clang] [llvm] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87310)

2024-04-04 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: If you don't like the current rules, you can ask the C++ standard committee to change them. (See https://isocpp.org/std/submit-issue .) https://github.com/llvm/llvm-project/pull/87310 ___ cfe-commits mailing list cfe-commits@list

[clang] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. (PR #87717)

2024-04-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/87717 intrin.h checks for x86_64. But the "x86_64" define is also defined for ARM64EC, and we don't support all the intrinsics in ARM64EC mode. Fix the preprocessor checks to handle this correctly. (If we actua

[clang] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. (PR #87717)

2024-04-04 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: CC @bylaws @mstorsjo @cjacek @MaxEW707 @CaseyCarter https://github.com/llvm/llvm-project/pull/87717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM64EC] Add support for parsing __vectorcall (PR #87725)

2024-04-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/87725 MSVC doesn't support generating __vectorcall calls in Arm64EC mode, but it does treat it as a distinct type. The Microsoft STL depends on this functionality. (Not sure if this is intentional.) Add suppo

[clang] [ARM64EC] Add support for parsing __vectorcall (PR #87725)

2024-04-04 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: CC @bylaws @mstorsjo @cjacek @MaxEW707 @CaseyCarter https://github.com/llvm/llvm-project/pull/87725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. (PR #87717)

2024-04-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/87717 >From f18163b82b61f843f57c9c5e7e1dde24877f7210 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 4 Apr 2024 14:25:36 -0700 Subject: [PATCH] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. intri

[clang] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. (PR #87717)

2024-04-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/87717 >From f18163b82b61f843f57c9c5e7e1dde24877f7210 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 4 Apr 2024 14:25:36 -0700 Subject: [PATCH 1/2] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. i

[clang] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. (PR #87717)

2024-04-04 Thread Eli Friedman via cfe-commits
@@ -413,6 +413,7 @@ static __inline__ void __DEFAULT_FN_ATTRS __writecr3(unsigned __INTPTR_TYPE__ __cr3_val) { __asm__ ("mov {%0, %%cr3|cr3, %0}" : : "r"(__cr3_val) : "memory"); } +#endif efriedma-quic wrote: That chunk of declarations near the top of the fi

[clang] [OpenMP][CodeGen] Improved codegen for combined loop directives (PR #87278)

2024-04-05 Thread Eli Friedman via cfe-commits
@@ -6135,6 +6137,79 @@ processImplicitMapsWithDefaultMappers(Sema &S, DSAStackTy *Stack, } } +namespace { +/// A 'teams loop' with a nested 'loop bind(parallel)' or generic function +/// call in the associated loop-nest cannot be a 'parallel for'. +class TeamsLoopChecker fi

[clang] [X86_64] fix arg pass error in struct. (PR #86902)

2024-04-05 Thread Eli Friedman via cfe-commits
@@ -2100,8 +2100,12 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, Class &Lo, postMerge(Size, Lo, Hi); return; } + + bool InMemory = Offset % getContext().getTypeAlign(i->getType()) || + (i->getType()->getAs()

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-06 Thread Eli Friedman via cfe-commits
@@ -1230,11 +1230,26 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S, JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); + const DeclStmt *RangeDS = cast(S.getRangeStmt()); + const VarDecl *RangeV

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-06 Thread Eli Friedman via cfe-commits
@@ -311,9 +311,9 @@ pushTemporaryCleanup(CodeGenFunction &CGF, const MaterializeTemporaryExpr *M, CleanupKind CleanupKind; if (Lifetime == Qualifiers::OCL_Strong) { const ValueDecl *VD = M->getExtendingDecl(); - bool Precise = -

[clang] [llvm] Revert "[AArch64] Add support for -ffixed-x30" (PR #88019)

2024-04-08 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/88019 This reverts commit e770153865c53c4fd72a68f23acff33c24e42a08. This wasn't reviewed, and the functionality in question was intentionally rejected the last time it was discussed in https://reviews.llvm.org/D

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-08 Thread Eli Friedman via cfe-commits
@@ -1230,11 +1230,26 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S, JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); + const DeclStmt *RangeDS = cast(S.getRangeStmt()); + const VarDecl *RangeV

[clang] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. (PR #87717)

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

[clang] [llvm] [clang][llvm] Remove "implicit-section-name" attribute (PR #87906)

2024-04-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: I'd suggest adding bitcode upgrade if it isn't too hard (I don't think it should be?) Otherwise looks fine. https://github.com/llvm/llvm-project/pull/87906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [llvm] Revert "[AArch64] Add support for -ffixed-x30" (PR #88019)

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

[clang] [Clang] Add support for scalable vectors in __builtin_reduce_* functions (PR #87750)

2024-04-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Given there isn't any target-independent way to construct such a type, it feels sort of redundant. (A user could easily implement this themselves.) But I can't think of a reason to avoid adding this. Please update documentation and add a release note. https://github.com

[clang] [Clang][CodeGen] Fix `CanSkipVTablePointerInitialization` for dynamic classes with a trivial anonymous union (PR #84651)

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

[clang] [Clang][CodeGen] Fix `CanSkipVTablePointerInitialization` for dynamic classes with a trivial anonymous union (PR #84651)

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

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-04-09 Thread Eli Friedman via cfe-commits
@@ -2177,7 +2177,8 @@ struct CounterCoverageMappingBuilder } void VisitOpaqueValueExpr(const OpaqueValueExpr* OVE) { -Visit(OVE->getSourceExpr()); +if (const Expr *SE = OVE->getSourceExpr()) efriedma-quic wrote: If you have a BinaryConditionalOper

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-09 Thread Eli Friedman via cfe-commits
@@ -1230,11 +1230,26 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S, JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); + const DeclStmt *RangeDS = cast(S.getRangeStmt()); + const VarDecl *RangeV

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Why can't we just declare that the "generic" address-space must always be 0? The specific numbers we use for address-spaces are completely arbitrary anyway. https://github.com/llvm/llvm-project/pull/88182 ___ cfe-commits mailing

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-09 Thread Eli Friedman via cfe-commits
@@ -4551,6 +4554,7 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction( llvm::Function *F = llvm::Function::Create(FTy, llvm::Function::ExternalLinkage, + getDataLayout().getProgramAddressSpace(), efriedma-quic wrote:

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-09 Thread Eli Friedman via cfe-commits
@@ -3581,8 +3582,10 @@ ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject( isExternallyVisible(TPO->getLinkageAndVisibility().getLinkage()) ? llvm::GlobalValue::LinkOnceODRLinkage : llvm::GlobalValue::InternalLinkage; - auto *GV = new llvm::

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > > > querying a modules global AS from the target, rather than from the data > > > layout (some DL's are incomplete, e.g. SPIRV's) > > That is a bug in those DataLayouts > > Do we spell out the requirement somewhere? I am only asking because, for > example, [neither SPIR

[clang] 349327f - [ARM64EC] Make intrin.h include arm64intrin.h.

2024-04-09 Thread Eli Friedman via cfe-commits
Author: Eli Friedman Date: 2024-04-09T19:37:35-07:00 New Revision: 349327f7e73ab7a314ef08c463dd04fcea623150 URL: https://github.com/llvm/llvm-project/commit/349327f7e73ab7a314ef08c463dd04fcea623150 DIFF: https://github.com/llvm/llvm-project/commit/349327f7e73ab7a314ef08c463dd04fcea623150.diff

[clang] [ARM64EC] Add support for parsing __vectorcall (PR #87725)

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

[clang] [X86_64] fix arg pass error in struct. (PR #86902)

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

[clang] [X86_64] fix arg pass error in struct. (PR #86902)

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

[clang] [llvm] [clang][llvm] Remove "implicit-section-name" attribute (PR #87906)

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

[clang] [codegen] Emit missing cleanups for stmt-expr and coro suspensions [take-2] (PR #85398)

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

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-04-10 Thread Eli Friedman via cfe-commits
@@ -2177,7 +2177,8 @@ struct CounterCoverageMappingBuilder } void VisitOpaqueValueExpr(const OpaqueValueExpr* OVE) { -Visit(OVE->getSourceExpr()); +if (const Expr *SE = OVE->getSourceExpr()) efriedma-quic wrote: The point of the "unique" flag is p

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-10 Thread Eli Friedman via cfe-commits
@@ -1230,11 +1230,26 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S, JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); + const DeclStmt *RangeDS = cast(S.getRangeStmt()); + const VarDecl *RangeV

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-10 Thread Eli Friedman via cfe-commits
@@ -1230,11 +1230,26 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S, JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); + const DeclStmt *RangeDS = cast(S.getRangeStmt()); + const VarDecl *RangeV

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-10 Thread Eli Friedman via cfe-commits
@@ -1230,11 +1230,26 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S, JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); + const DeclStmt *RangeDS = cast(S.getRangeStmt()); + const VarDecl *RangeV

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-11 Thread Eli Friedman via cfe-commits
@@ -3581,8 +3582,10 @@ ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject( isExternallyVisible(TPO->getLinkageAndVisibility().getLinkage()) ? llvm::GlobalValue::LinkOnceODRLinkage : llvm::GlobalValue::InternalLinkage; - auto *GV = new llvm::

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

2024-04-11 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Forbidding usage in C++ probably avoids the worst of the canonical-type issues, but there's still some potential for weird results. Particularly with type merging; for example, if you write `a ? (wrap_int)x : 1`, is the result a wrapping type? https://github.com/llvm/llv

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

2024-04-12 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/88572 Since 97fe519d, in ARM64EC mode, we don't define `__aarch64__`. Fix various preprocessor guards to account for this. >From 1931103205e566ef49bbfa96272b3304c89f7d2d Mon Sep 17 00:00:00 2001 From: Eli Friedm

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

2024-06-05 Thread Eli Friedman via cfe-commits
@@ -8287,6 +8289,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, SDValue InGlue; if (RequiresSMChange) { + +if (Subtarget->hasSVE()) { efriedma-quic wrote: Oh, right, there's also that dimension. I'm not sure I understand the interacti

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

2024-06-05 Thread Eli Friedman via cfe-commits
@@ -4656,14 +4656,14 @@ static void InitCatchParam(CodeGenFunction &CGF, auto catchRD = CatchType->getAsCXXRecordDecl(); CharUnits caughtExnAlignment = CGF.CGM.getClassPointerAlignment(catchRD); - llvm::Type *PtrTy = CGF.UnqualPtrTy; // addrspace 0 ok efr

[clang] [llvm] [ARM] r11 is reserved when using -mframe-chain=aapcs (PR #86951)

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

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Eli Friedman via cfe-commits
@@ -1830,6 +1830,9 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables &CGVT, if (VTable->hasInitializer()) return; + if (RD->shouldEmitInExternalSource()) +return; efriedma-quic wrote: This check seems like it's at the wrong level; if we

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread Eli Friedman via cfe-commits
@@ -6853,6 +6853,13 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) DI->completeUnusedClass(*CRD); } +// If we're emitting a dynamic class from the importable module we're +// emi

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-07 Thread Eli Friedman via cfe-commits
@@ -6853,6 +6853,13 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) DI->completeUnusedClass(*CRD); } +// If we're emitting a dynamic class from the importable module we're +// emi

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-07 Thread Eli Friedman via cfe-commits
@@ -3219,7 +3219,8 @@ void CodeGenModule::EmitVTablesOpportunistically() { for (const CXXRecordDecl *RD : OpportunisticVTables) { assert(getVTables().isVTableExternal(RD) && "This queue should only contain external vtables"); -if (getCXXABI().canSpeculative

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

2024-06-07 Thread Eli Friedman via cfe-commits
@@ -196,12 +196,14 @@ bool AArch64FunctionInfo::needsAsyncDwarfUnwindInfo( const MachineFunction &MF) const { if (!NeedsAsyncDwarfUnwindInfo) { const Function &F = MF.getFunction(); +const AArch64FunctionInfo *AFI = MF.getInfo(); // The check got "minsize" i

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

2024-06-07 Thread Eli Friedman via cfe-commits
@@ -214,7 +232,8 @@ declare double @za_shared_callee(double) "aarch64_inout_za" define double @za_new_caller_to_za_shared_callee(double %x) nounwind noinline optnone "aarch64_new_za"{ ; CHECK-COMMON-LABEL: za_new_caller_to_za_shared_callee: ; CHECK-COMMON: // %bb.0: //

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

2024-06-07 Thread Eli Friedman via cfe-commits
@@ -196,12 +196,14 @@ bool AArch64FunctionInfo::needsAsyncDwarfUnwindInfo( const MachineFunction &MF) const { if (!NeedsAsyncDwarfUnwindInfo) { const Function &F = MF.getFunction(); +const AArch64FunctionInfo *AFI = MF.getInfo(); // The check got "minsize" i

<    1   2   3   4   5   6   7   8   9   10   >