[clang] [clang] Better bitfield access units (PR #65742)

2024-03-19 Thread John McCall via cfe-commits
@@ -439,82 +444,247 @@ CGRecordLowering::accumulateBitFields(RecordDecl::field_iterator Field, Members.push_back(MemberInfo(bitsToCharUnits(StartBitOffset), MemberInfo::Field, nullptr, *Field)); } -return; +return Field;

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-19 Thread John McCall via cfe-commits
@@ -439,82 +444,247 @@ CGRecordLowering::accumulateBitFields(RecordDecl::field_iterator Field, Members.push_back(MemberInfo(bitsToCharUnits(StartBitOffset), MemberInfo::Field, nullptr, *Field)); } -return; +return Field;

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-19 Thread John McCall via cfe-commits
@@ -439,82 +444,247 @@ CGRecordLowering::accumulateBitFields(RecordDecl::field_iterator Field, Members.push_back(MemberInfo(bitsToCharUnits(StartBitOffset), MemberInfo::Field, nullptr, *Field)); } -return; +return Field;

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-20 Thread John McCall via cfe-commits
@@ -1495,6 +1495,10 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D, return Actions.ActOnFinishFunctionBody(Res, nullptr, false); } + // Some function attributes (like OptimizeNoneAttr) affect FP options. + Sema::FPFeaturesStateRAII SaveFPFeatures(Action

[clang] Rebase swiftasynccall's musttail support onto the [[clang::musttail]] logic (PR #86011)

2024-03-20 Thread John McCall via cfe-commits
https://github.com/rjmccall created https://github.com/llvm/llvm-project/pull/86011 The old logic expects the call to be the last thing we emitted, and since it kicks in before we emit cleanups, and since `swiftasynccall` functions always return void, that's likely to be true. "Likely" isn't

[clang] Rebase swiftasynccall's musttail support onto the [[clang::musttail]] logic (PR #86011)

2024-03-20 Thread John McCall via cfe-commits
https://github.com/rjmccall closed https://github.com/llvm/llvm-project/pull/86011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread John McCall via cfe-commits
rjmccall wrote: Yeah, I don't think we need this change. The comment is a little unnecessary, but it's not a big deal. Really, the code ought to be using a visitor instead of a `switch`. https://github.com/llvm/llvm-project/pull/85921 ___ cfe-commi

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-22 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. Okay. Thanks for putting up with such a protracted review! I really like where we've ended up. LGTM. Please wait a few days before merging to give other reviewers a chance to give final feedback. https://github.com/llvm/llvm-project/p

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-25 Thread John McCall via cfe-commits
@@ -0,0 +1,74 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// 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] Resolve FIXME: Look at E, not M (PR #85541)

2024-03-28 Thread John McCall via cfe-commits
rjmccall wrote: Well, sometimes we do leave FIXMEs that end up being suprisingly easy to fix. But what FIXME are we talking about here? The patch doesn't remove any FIXMEs, or for that matter include any tests. https://github.com/llvm/llvm-project/pull/85541 _

[clang] Resolve FIXME: Look at E, not M (PR #85541)

2024-03-28 Thread John McCall via cfe-commits
rjmccall wrote: Hmm. Well, you'd have to ask @zygoloid what he was thinking in r183721/r183859, but I don't think it's correct in general to be looking at E (the MTE sub-expression) for most of the logic here. IIRC, the MTE sub-expression is essentially the initializer for the materialized t

[clang] Resolve FIXME: Look at E, not M (PR #85541)

2024-03-29 Thread John McCall via cfe-commits
rjmccall wrote: Hmm. The best solution there is probably to use a consistent representation but introduce some sort of `GLValueThatTheStandardAbsurdlyPretendsIsAnRValue` (definitely the only and best word for this, ship it) that we can use as the value category. IIRC, something similar happe

[clang] [clang] Fix bitfield access unit for vbase corner case (PR #87238)

2024-04-01 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. Doing in in one commit this time seems fine. https://github.com/llvm/llvm-project/pull/87238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [clang] Fix bitfield access unit for vbase corner case (PR #87238)

2024-04-01 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/87238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Subclass `-Wshorten-64-to-32` under `-Wimplicit-int-conversion` (PR #80814)

2024-02-07 Thread John McCall via cfe-commits
rjmccall wrote: This looks right to me, thanks. https://github.com/llvm/llvm-project/pull/80814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ObjC] Check entire chain of superclasses to see if class has fixed offsets (PR #81335)

2024-02-10 Thread John McCall via cfe-commits
https://github.com/rjmccall requested changes to this pull request. Okay, your description of the change here is very misleading; it doesn't even mention that this is specific to having an `@implementation` for every intermediate class. Your test seems completely inadequate — you need to test

[clang] [ObjC] Check entire chain of superclasses to see if class layout can be statically known (PR #81335)

2024-02-12 Thread John McCall via cfe-commits
rjmccall wrote: I talked this over with Mike Ash. I was concerned that Objective-C might allow dynamic class changes that would burn our ability to do this optimization, such as adding ivars during `+initialize`. The existing optimization would work even with a relatively lax runtime as long

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-12 Thread John McCall via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -disable-llvm-passes -O0 -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-12 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/80823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-12 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/80823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-12 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/80823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ObjC] Check entire chain of superclasses to see if class layout can be statically known (PR #81335)

2024-02-12 Thread John McCall via cfe-commits
https://github.com/rjmccall requested changes to this pull request. > @rjmccall Are these tests adequate? No. You need to test the behavior of ivar accesses in the subclass when there is an intermediate superclass that has ivars declared in all the ways I identified. Your test has many tests

[clang] [ObjC] Check entire chain of superclasses to see if class layout can be statically known (PR #81335)

2024-02-12 Thread John McCall via cfe-commits
rjmccall wrote: > Alright. I think the LTO should be done as a follow-up PR since it will > likely take some time and multiple reviews to get right. Yes, that's a fine plan. I expect that that'll be a significant amount of work. https://github.com/llvm/llvm-project/pull/81335

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-12 Thread John McCall via cfe-commits
@@ -361,6 +361,9 @@ CAST_OPERATION(AddressSpaceConversion) // Convert an integer initializer to an OpenCL sampler. CAST_OPERATION(IntToOCLSampler) +// Truncate a vector type (HLSL only). +CAST_OPERATION(HLSLVectorTruncation) rjmccall wrote: Okay. I think thi

[clang] [clang] Better bitfield access units (PR #65742)

2024-02-12 Thread John McCall via cfe-commits
rjmccall wrote: > @rjmccall thanks for your comments. Here's a reimplementation using a single > loop -- the downside is that we may end up repeating the initial grouping > scan, if we search more than 1 Access Unit ahead and fail to find a 'good' > access unit. This update changes the algorit

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-13 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. Thanks, LGTM https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/75481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
@@ -1035,7 +1050,7 @@ EmitIntegerTruncationCheckHelper(Value *Src, QualType SrcType, Value *Dst, } llvm::Value *Check = nullptr; - // 1. Extend the truncated value back to the same width as the Src. + // 1. Convert the Dst back to the same type as Src.

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
@@ -1239,6 +1257,228 @@ void ScalarExprEmitter::EmitIntegerSignChangeCheck(Value *Src, QualType SrcType, {Src, Dst}); } +// Should be called within CodeGenFunction::SanitizerScope RAII scope. +// Returns 'i1 false' when the truncation Src -> Dst was lossy. +st

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
@@ -1097,6 +1112,27 @@ void ScalarExprEmitter::EmitIntegerTruncationCheck(Value *Src, QualType SrcType, {Src, Dst}); } +static llvm::Value *EmitIsNegativeTestHelper(Value *V, QualType VType, + const char *Name, +

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
@@ -5570,11 +5570,44 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { break; } -RValue RV = EmitAnyExpr(E->getRHS()); +llvm::Value *Previous = nullptr; +RValue RV; +QualType SrcType = E->getRHS()->getType(); +// If L

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
@@ -324,6 +326,19 @@ class ScalarExprEmitter void EmitIntegerSignChangeCheck(Value *Src, QualType SrcType, Value *Dst, QualType DstType, SourceLocation Loc); + /// Emit a check that an [implicit] truncation of a bitfield does not + /// dis

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
@@ -1097,6 +1112,27 @@ void ScalarExprEmitter::EmitIntegerTruncationCheck(Value *Src, QualType SrcType, {Src, Dst}); } +static llvm::Value *EmitIsNegativeTestHelper(Value *V, QualType VType, + const char *Name, +

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
@@ -5570,11 +5570,44 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { break; } -RValue RV = EmitAnyExpr(E->getRHS()); +llvm::Value *Previous = nullptr; +RValue RV; +QualType SrcType = E->getRHS()->getType(); +// If L

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
https://github.com/rjmccall commented: You should handle compound assignments. https://github.com/llvm/llvm-project/pull/75481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [clang][UBSan] Add implicit conversion check for bitfields (PR #75481)

2024-02-13 Thread John McCall via cfe-commits
@@ -122,6 +122,26 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +- ``-fsanitize=implicit-unsigned-bitfield-truncation`` catches implicit + unsigned conversions involving bitfields. +- ``-fsanitize=implicit-signed-bitfield-truncatio

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2024-03-12 Thread John McCall via cfe-commits
rjmccall wrote: > @rjmccall Re asking GCC developers about gcc_struct on non-x86: > https://gcc.gnu.org/pipermail/gcc/2024-January/243154.html. Either GCC devs > aren't really worried about this or I can't properly write emails (what's > totally possible). Alright, well, we tried. I think ro

[clang] [clang] Better bitfield access units (PR #65742)

2024-02-23 Thread John McCall via cfe-commits
rjmccall wrote: > > On the target hook, it's a shame we can't easily get this information from > > LLVM. I believe it's already there — `TargetLowering` has an > > `allowsMisalignedMemoryAccesses` method that includes some approximation of > > how fast a particular access would be. In practice

[clang] [ObjC] Check entire chain of superclasses to see if class layout is statically known (PR #81335)

2024-02-26 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. Thanks, that looks great. https://github.com/llvm/llvm-project/pull/81335 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cfi][CodeGen] Call SetLLVMFunctionAttributes{, ForDefinition} on __cf… (PR #78253)

2024-03-01 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/78253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-01 Thread John McCall via cfe-commits
https://github.com/rjmccall commented: I think using the existing information as a default is fine, but please continue to call the hook something like `hasCheapUnalignedAccess()` to preserve the intent, even if it always just calls the other hook. https://github.com/llvm/llvm-project/pull/657

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-01 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/65742 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-01 Thread John McCall via cfe-commits
@@ -394,33 +412,155 @@ void CGRecordLowering::accumulateFields() { : getStorageType(*Field), *Field)); ++Field; -} else { - ++Field; } } } -void -CGRecordLowering::accumulateBitFields(RecordDecl::field_iterator Field, -

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-01 Thread John McCall via cfe-commits
@@ -858,6 +861,10 @@ class TargetInfo : public TransferrableTargetInfo, return PointerWidth; } + /// Return true, iff unaligned accesses are a single instruction (rather than rjmccall wrote: ```suggestion /// Return true iff unaligned accesses are a

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-01 Thread John McCall via cfe-commits
@@ -394,33 +412,155 @@ void CGRecordLowering::accumulateFields() { : getStorageType(*Field), *Field)); ++Field; -} else { - ++Field; } } } -void -CGRecordLowering::accumulateBitFields(RecordDecl::field_iterator Field, -

[clang] [clang] Better bitfield access units (PR #65742)

2024-03-01 Thread John McCall via cfe-commits
@@ -394,33 +412,155 @@ void CGRecordLowering::accumulateFields() { : getStorageType(*Field), *Field)); ++Field; -} else { - ++Field; } } } -void -CGRecordLowering::accumulateBitFields(RecordDecl::field_iterator Field, -

[clang] [clang][Sema] Add noinline check for __builtin_frame_address and __builtin_return_address (PR #82966)

2024-03-04 Thread John McCall via cfe-commits
rjmccall wrote: > I'm seeing evidence that this might be a chatty diagnostic in practice: > > https://sourcegraph.com/github.com/torvalds/linux@90d35da658da8cff0d4ecbb5113f5fac9d00eb72/-/blob/kernel/fork.c?L311 > > https://sourcegraph.com/github.com/torvalds/linux@90d35da658da8cff0d4ecbb5113f5

[clang] [clang][CodeGen][UBSan] Fixing shift-exponent generation for _BitInt (PR #80515)

2024-02-03 Thread John McCall via cfe-commits
rjmccall wrote: > One thing I'll preemptively address is I didn't know where to put the new > unit testing - creating a separate file seems a little heavy handed but I see > that there's a test for UBSan shift generation > (`clang/test/CodeGen/ubsan-shift.c`) and one for UBSan + _BitInt > (`c

[llvm] [clang] [clang-tools-extra] [HLSL] Vector standard conversions (PR #71098)

2024-02-05 Thread John McCall via cfe-commits
@@ -2466,6 +2504,15 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { case CK_IntToOCLSampler: return CGF.CGM.createOpenCLIntToSamplerConversion(E, CGF); + case CK_HLSLVectorTruncation: { +assert(DestTy->isVectorType() && "Expected dest type to be vector ty

[clang-tools-extra] [clang] [llvm] [HLSL] Vector standard conversions (PR #71098)

2024-02-05 Thread John McCall via cfe-commits
@@ -1843,13 +1843,86 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, return true; } +/// Determine whether the conversion from FromType to ToType is a valid +/// floating point conversion. +/// +static bool IsFloatingPointConversion(Sema &S, QualType

[llvm] [clang] [clang-tools-extra] [HLSL] Vector standard conversions (PR #71098)

2024-02-05 Thread John McCall via cfe-commits
@@ -361,6 +361,9 @@ CAST_OPERATION(AddressSpaceConversion) // Convert an integer initializer to an OpenCL sampler. CAST_OPERATION(IntToOCLSampler) +// Truncate a vector type (HLSL only). +CAST_OPERATION(HLSLVectorTruncation) rjmccall wrote: Unfortunately, we

[clang-tools-extra] [clang] [llvm] [HLSL] Vector standard conversions (PR #71098)

2024-02-05 Thread John McCall via cfe-commits
@@ -2414,9 +2420,41 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return EmitScalarConversion(Visit(E), E->getType(), DestTy, CE->getExprLoc(), Opts); } - case CK_IntegralToFloating: - case CK_FloatingToIntegral: - case CK_F

[clang-tools-extra] [clang] [llvm] [HLSL] Vector standard conversions (PR #71098)

2024-02-05 Thread John McCall via cfe-commits
rjmccall wrote: Argh, sorry for the slow response. https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix behavior of `__is_trivially_relocatable(volatile int)` (PR #77092)

2024-01-12 Thread John McCall via cfe-commits
@@ -2669,6 +2669,8 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const { return false; } else if (const auto *RD = BaseElementType->getAsRecordDecl()) { return RD->canPassInRegisters(); + } else if (BaseElementType.isTriviallyCopyableType(C

[libcxx] [flang] [lldb] [clang-tools-extra] [libc] [libunwind] [libcxxabi] [clang] [llvm] [compiler-rt] [lld] Fix a bug in Smith's algorithm used in complex div/mul. (PR #78330)

2024-01-17 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/78330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libc] [lldb] [clang] [llvm] [libunwind] [flang] [lld] [libcxxabi] [clang-tools-extra] [libcxx] [compiler-rt] Fix a bug in Smith's algorithm used in complex div/mul. (PR #78330)

2024-01-17 Thread John McCall via cfe-commits
@@ -978,7 +978,11 @@ ComplexPairTy ComplexExprEmitter::EmitBinDiv(const BinOpInfo &Op) { return EmitRangeReductionDiv(LHSr, LHSi, RHSr, RHSi); else if (Op.FPFeatures.getComplexRange() == LangOptions::CX_Limited) return EmitAlgebraicDiv(LHSr, LHSi, RHSr, RHSi);

[clang-tools-extra] [libc] [lld] [llvm] [flang] [libcxxabi] [clang] [libunwind] [libcxx] [compiler-rt] [lldb] Fix a bug in Smith's algorithm used in complex div/mul. (PR #78330)

2024-01-17 Thread John McCall via cfe-commits
https://github.com/rjmccall commented: It's bad that we don't have a IR test that breaks when you change the IR output like this. Please add one. https://github.com/llvm/llvm-project/pull/78330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [libc] [libcxx] [compiler-rt] [lldb] [flang] [clang-tools-extra] [libunwind] [libcxxabi] [lld] Fix a bug in Smith's algorithm used in complex div. (PR #78330)

2024-01-18 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. LGTM as far as my requests; please wait for approval from the other reviewers. This is unrelated, but I wonder if we should proactively outline this sequence; it's quite long. https://github.com/llvm/llvm-project/pull/78330 __

[clang] [clang-tools-extra] [libc] [llvm] [libcxxabi] [libcxx] [lld] [flang] [libunwind] [lldb] [compiler-rt] Fix a bug in Smith's algorithm used in complex div. (PR #78330)

2024-01-18 Thread John McCall via cfe-commits
rjmccall wrote: > > This is unrelated, but I wonder if we should proactively outline this > > sequence; it's quite long. > > Not sure what you mean. I mean that we could lazily emit a helper function like `__clang_smiths_division_double` and call it instead of emitting like twenty instructio

[libunwind] [clang-tools-extra] [libc] [flang] [llvm] [lld] [libcxx] [clang] [compiler-rt] [lldb] [libcxxabi] Fix a bug in Smith's algorithm used in complex div. (PR #78330)

2024-01-18 Thread John McCall via cfe-commits
rjmccall wrote: If LLVM wants to provide intrinsics that cover patterns that the frontend wants to emit, that'd be great. The frontend will still have to make decisions about e.g. whether to request Smith's algorithm, of course. https://github.com/llvm/llvm-project/pull/78330

[clang] [FPEnv] Add strictfp in some C++ constructors lacking a FunctionDecl. (PR #74883)

2024-01-22 Thread John McCall via cfe-commits
https://github.com/rjmccall requested changes to this pull request. I'm sorry for failing to notice this in my previous review, but I don't think this patch is right. A global initializer should be FP-constrained based on whether the variable is defined in an FP-constrained context. This is t

[clang] SwiftCallingConv: Fix the splitVectorEntry function (PR #69953)

2023-10-26 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. Oops. LGTM. https://github.com/llvm/llvm-project/pull/69953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r310964 - Extract IRGen's constant-emitter into its own helper class and clean up

2017-08-15 Thread John McCall via cfe-commits
Author: rjmccall Date: Tue Aug 15 14:42:52 2017 New Revision: 310964 URL: http://llvm.org/viewvc/llvm-project?rev=310964&view=rev Log: Extract IRGen's constant-emitter into its own helper class and clean up the interface. The ultimate goal here is to make it easier to do some more interesting thi

r310963 - Allow the target field of a CK_ToUnion to be more easily recovered.

2017-08-15 Thread John McCall via cfe-commits
Author: rjmccall Date: Tue Aug 15 14:42:47 2017 New Revision: 310963 URL: http://llvm.org/viewvc/llvm-project?rev=310963&view=rev Log: Allow the target field of a CK_ToUnion to be more easily recovered. Modified: cfe/trunk/include/clang/AST/Expr.h cfe/trunk/lib/AST/Expr.cpp cfe/trunk/

r310962 - Allow StmtVisitor visitation to be parameterized. NFC.

2017-08-15 Thread John McCall via cfe-commits
Author: rjmccall Date: Tue Aug 15 14:42:42 2017 New Revision: 310962 URL: http://llvm.org/viewvc/llvm-project?rev=310962&view=rev Log: Allow StmtVisitor visitation to be parameterized. NFC. Modified: cfe/trunk/include/clang/AST/StmtVisitor.h Modified: cfe/trunk/include/clang/AST/StmtVisitor

r311065 - Further refactoring of the constant emitter. NFC.

2017-08-16 Thread John McCall via cfe-commits
Author: rjmccall Date: Wed Aug 16 22:03:55 2017 New Revision: 311065 URL: http://llvm.org/viewvc/llvm-project?rev=311065&view=rev Log: Further refactoring of the constant emitter. NFC. Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp URL:

Re: [PATCH] D36501: add flag to undo ABI change in r310401

2017-08-24 Thread John McCall via cfe-commits
> On Aug 24, 2017, at 3:48 PM, Richard Smith wrote: > On 24 August 2017 at 12:24, Paul Robinson via Phabricator via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > probinson added a comment. > > Locally we have a couple different tactics for dealing with changes that we > can't suppo

Re: [PATCH] D67774: [Mangle] Add flag to asm labels to disable '\01' prefixing

2020-01-07 Thread John McCall via cfe-commits
On Tue, Jan 7, 2020 at 1:44 PM Aaron Ballman via Phabricator wrote: > aaron.ballman added inline comments. > > > > Comment at: cfe/trunk/lib/AST/Mangle.cpp:127 > +// do not add a "\01" prefix. > +if (!ALA->getIsLiteralLabel() || ALA->getLabel().startswith("llvm.")) { > +

Re: [PATCH] D67774: [Mangle] Add flag to asm labels to disable '\01' prefixing

2020-01-07 Thread John McCall via cfe-commits
On Tue, Jan 7, 2020 at 3:02 PM Aaron Ballman wrote: > On Tue, Jan 7, 2020 at 2:57 PM John McCall via cfe-commits > wrote: > > On Tue, Jan 7, 2020 at 1:44 PM Aaron Ballman via Phabricator > > wrote: > > > Sorry to dredge up an old review, but I recently ran into a bug

Re: [PATCH] D67774: [Mangle] Add flag to asm labels to disable '\01' prefixing

2020-01-07 Thread John McCall via cfe-commits
On Tue, Jan 7, 2020 at 3:18 PM Aaron Ballman wrote: > It seems like GCC doesn't do good things when trying to link two > functions with empty asm labels but Clang does seem to do something > reasonable. I can't quite tell whether this is a case for a diagnostic > or not. Note the generated assembl

[clang] 98ef7e2 - This reduces code duplication between CGObjCMac.cpp and Mangle.cpp

2020-09-28 Thread John McCall via cfe-commits
Author: Ellis Hoag Date: 2020-09-29T02:26:51-04:00 New Revision: 98ef7e29b0fe03da77fa6ef5c86bea9e31c178d0 URL: https://github.com/llvm/llvm-project/commit/98ef7e29b0fe03da77fa6ef5c86bea9e31c178d0 DIFF: https://github.com/llvm/llvm-project/commit/98ef7e29b0fe03da77fa6ef5c86bea9e31c178d0.diff LO

[clang] 984744a - Fix a variety of minor issues with ObjC method mangling:

2020-09-29 Thread John McCall via cfe-commits
Author: John McCall Date: 2020-09-29T19:51:53-04:00 New Revision: 984744a1314ce165378e7945bc45995302a8cb80 URL: https://github.com/llvm/llvm-project/commit/984744a1314ce165378e7945bc45995302a8cb80 DIFF: https://github.com/llvm/llvm-project/commit/984744a1314ce165378e7945bc45995302a8cb80.diff L

[clang] cec49a5 - Revert "[SYCL] Implement __builtin_unique_stable_name."

2020-10-11 Thread John McCall via cfe-commits
Author: John McCall Date: 2020-10-12T01:10:09-04:00 New Revision: cec49a583693752b3984e49f9c193de07c2a7698 URL: https://github.com/llvm/llvm-project/commit/cec49a583693752b3984e49f9c193de07c2a7698 DIFF: https://github.com/llvm/llvm-project/commit/cec49a583693752b3984e49f9c193de07c2a7698.diff L

Re: [PATCH] D100879: [Clang] Propagate guaranteed alignment for malloc and others

2021-11-22 Thread John McCall via cfe-commits
On Mon, Nov 22, 2021 at 1:08 PM David Goldblatt via Phabricator < revi...@reviews.llvm.org> wrote: > davidtgoldblatt added a comment. > > (For background: I'm a jemalloc maintainer and wrote N2293). > > In D100879#3145361 , @rjmccall > wrote: > > > Platfor

Re: [PATCH] D100879: [Clang] Propagate guaranteed alignment for malloc and others

2021-11-22 Thread John McCall via cfe-commits
On Mon, Nov 22, 2021 at 2:28 PM John McCall wrote: > On Mon, Nov 22, 2021 at 1:08 PM David Goldblatt via Phabricator < > revi...@reviews.llvm.org> wrote: > >> and related projects avoid relying on alignment guarantees (e.g. >> libstdc++ at one point considered assuming that 8-byte allocs were 16-

[clang] [AArch64][PAC] Support ptrauth builtins and -fptrauth-intrinsics. (PR #65996)

2023-09-21 Thread John McCall via cfe-commits
@@ -4869,6 +4869,73 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, case Builtin::BI__iso_volatile_store64: return RValue::get(EmitISOVolatileStore(*this, E)); + case Builtin::BI__builtin_ptrauth_auth: + case Builtin::BI__builtin_pt

[clang] [AArch64][PAC] Support ptrauth builtins and -fptrauth-intrinsics. (PR #65996)

2023-09-21 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/65996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][PAC] Support ptrauth builtins and -fptrauth-intrinsics. (PR #65996)

2023-09-21 Thread John McCall via cfe-commits
@@ -0,0 +1,167 @@ +/*=== ptrauth.h - Pointer authentication ---=== + * + * 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: Apac

[clang] [AArch64][PAC] Support ptrauth builtins and -fptrauth-intrinsics. (PR #65996)

2023-09-21 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/65996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Support fixed point type mangling (PR #67750)

2023-09-28 Thread John McCall via cfe-commits
https://github.com/rjmccall commented: This patch is *primarily* adding support for fixed-point types to C++, which seems like it ought to be in the PR title. With that said, I don't have any objection to either the goal or the implementation. https://github.com/llvm/llvm-project/pull/67750 _

[clang] [clang][codegen] Add a verifier IR pass before any further passes. (PR #68015)

2023-10-02 Thread John McCall via cfe-commits
@@ -1020,21 +1022,23 @@ void EmitAssemblyHelper::RunOptimizationPipeline( } if (CodeGenOpts.FatLTO) { - MPM = PB.buildFatLTODefaultPipeline(Level, PrepareForThinLTO, - PrepareForThinLTO || -

[clang] [clang][codegen] Add a verifier IR pass before any further passes. (PR #68015)

2023-10-02 Thread John McCall via cfe-commits
@@ -923,6 +923,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline( PB.crossRegisterProxies(LAM, FAM, CGAM, MAM); ModulePassManager MPM; + // Add a verifier pass, before any other passes, to catch CodeGen issues. + MPM.addPass(VerifierPass()); rjmccall

[clang] [clang][codegen] Add a verifier IR pass before any further passes. (PR #68015)

2023-10-03 Thread John McCall via cfe-commits
rjmccall wrote: Thank you. If your PR is just changing things so that we run the existing verifier on the direct result of IR generation instead of only verifying it after a few passes run, I agree that it's the right thing to do. https://github.com/llvm/llvm-project/pull/68015 __

[clang] [clang][codegen] Add a verifier IR pass before any further passes. (PR #68015)

2023-10-03 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. https://github.com/llvm/llvm-project/pull/68015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure fixed point conversions work in C++ (PR #68344)

2023-10-05 Thread John McCall via cfe-commits
@@ -1,6 +1,8 @@ // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py -// RUN: %clang_cc1 -ffixed-point -triple x86_64-unknown-linux-gnu -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,SIGNED -// RUN: %clang_cc1 -ffixed-point -triple x86_64-un

[clang] [clang] Ensure fixed point conversions work in C++ (PR #68344)

2023-10-05 Thread John McCall via cfe-commits
@@ -2192,6 +2194,9 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, From->isIntegerConstantExpr(S.getASTContext())) { SCS.Second = ICK_Compatible_Conversion; FromType = ToType; + } else if (ToType->isFixedPointType() || FromType->

[clang] [clang] Ensure fixed point conversions work in C++ (PR #68344)

2023-10-05 Thread John McCall via cfe-commits
@@ -156,7 +156,8 @@ ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind) { // it was omitted by the patch that added // ICK_Zero_Queue_Conversion ICR_C_Conversion, -ICR_C_Conversion_Extension +ICR_C_

[clang] [clang] Ensure fixed point conversions work in C++ (PR #68344)

2023-10-05 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/68344 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MS] Follow up fix to pass aligned args to variadic x86_32 functions (PR #65692)

2023-09-08 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/65692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MS] Follow up fix to pass aligned args to variadic x86_32 functions (PR #65692)

2023-09-08 Thread John McCall via cfe-commits
@@ -812,11 +815,13 @@ ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty, CCState &State, } llvm::IntegerType *PaddingType = NeedsPadding ? Int32 : nullptr; -// Pass over-aligned aggregates on Windows indirectly. This behavior was -// added in MSVC 201

[clang] [MS] Follow up fix to pass aligned args to variadic x86_32 functions (PR #65692)

2023-09-08 Thread John McCall via cfe-commits
https://github.com/rjmccall requested changes to this pull request. Functionally LGTM; just a minor request. https://github.com/llvm/llvm-project/pull/65692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] 7848a3c - Update the ARC docs for non-trivial ownership in structs.

2020-02-26 Thread John McCall via cfe-commits
Author: John McCall Date: 2020-02-26T16:42:08-05:00 New Revision: 7848a3c8ab54570f5875e63606ff75b5736750b4 URL: https://github.com/llvm/llvm-project/commit/7848a3c8ab54570f5875e63606ff75b5736750b4 DIFF: https://github.com/llvm/llvm-project/commit/7848a3c8ab54570f5875e63606ff75b5736750b4.diff L

[clang] a7950ff - [NFC] Correct accidental use of tabs.

2019-12-13 Thread John McCall via cfe-commits
Author: John McCall Date: 2019-12-14T00:16:47-05:00 New Revision: a7950ffd12caa2fb7ed4704128011bceeacd35e9 URL: https://github.com/llvm/llvm-project/commit/a7950ffd12caa2fb7ed4704128011bceeacd35e9 DIFF: https://github.com/llvm/llvm-project/commit/a7950ffd12caa2fb7ed4704128011bceeacd35e9.diff L

[clang] b6f03a5 - [NFC] Rename ClangASTEmitters.h -> ASTTableGen.h

2019-12-13 Thread John McCall via cfe-commits
Author: John McCall Date: 2019-12-14T00:16:47-05:00 New Revision: b6f03a5a6b57b7858098051e60c2ce2fd4058461 URL: https://github.com/llvm/llvm-project/commit/b6f03a5a6b57b7858098051e60c2ce2fd4058461 DIFF: https://github.com/llvm/llvm-project/commit/b6f03a5a6b57b7858098051e60c2ce2fd4058461.diff L

[clang] d14a569 - MSVC build fix: forget some unneeded and incorrect friends.

2019-12-13 Thread John McCall via cfe-commits
Author: John McCall Date: 2019-12-14T01:02:09-05:00 New Revision: d14a5693c07f0fb1b82c75ed72f77a495751dcf7 URL: https://github.com/llvm/llvm-project/commit/d14a5693c07f0fb1b82c75ed72f77a495751dcf7 DIFF: https://github.com/llvm/llvm-project/commit/d14a5693c07f0fb1b82c75ed72f77a495751dcf7.diff L

[clang] c2f1831 - Move ASTRecordReader into its own header; NFC.

2019-12-14 Thread John McCall via cfe-commits
Author: John McCall Date: 2019-12-14T03:28:23-05:00 New Revision: c2f18315ff53006e44afe065368019e41cb98053 URL: https://github.com/llvm/llvm-project/commit/c2f18315ff53006e44afe065368019e41cb98053 DIFF: https://github.com/llvm/llvm-project/commit/c2f18315ff53006e44afe065368019e41cb98053.diff L

Re: [clang] c2f1831 - Move ASTRecordReader into its own header; NFC.

2019-12-14 Thread John McCall via cfe-commits
me/thakis/src/llvm-project/out/gn/obj/clang/test/Modules/Output/merge-lifetime-extended-temporary.cpp.tmp -x c++ -I/usr/local/google/home/thakis/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary -verify -std=c++11 /usr/local/google/home/thakis/src/llvm-project/clang/test

Re: [clang] 5708f2d - [clang] Fix modules build after addition of TypeBitCodes.def

2019-12-14 Thread John McCall via cfe-commits
On 14 Dec 2019, at 12:25, Raphael Isemann via cfe-commits wrote: Author: Raphael Isemann Date: 2019-12-14T18:24:53+01:00 New Revision: 5708f2daf7386ef5f1ec54db4bda2b48bbcbe934 URL: https://github.com/llvm/llvm-project/commit/5708f2daf7386ef5f1ec54db4bda2b48bbcbe934 DIFF: https://github.com/llv

[clang] 00bc76e - Move Basic{Reader,Writer} emission into ASTPropsEmitter; NFC.

2019-12-16 Thread John McCall via cfe-commits
Author: John McCall Date: 2019-12-16T13:33:59-05:00 New Revision: 00bc76edddb5a6cd417610e96289a5dc15245867 URL: https://github.com/llvm/llvm-project/commit/00bc76edddb5a6cd417610e96289a5dc15245867 DIFF: https://github.com/llvm/llvm-project/commit/00bc76edddb5a6cd417610e96289a5dc15245867.diff L

[clang] c82e4ef - Always -I clang/include when tblgen'ing in Clang.

2019-12-16 Thread John McCall via cfe-commits
Author: John McCall Date: 2019-12-16T13:33:59-05:00 New Revision: c82e4ef6960b9f09fc77abc10f374417007f5f00 URL: https://github.com/llvm/llvm-project/commit/c82e4ef6960b9f09fc77abc10f374417007f5f00 DIFF: https://github.com/llvm/llvm-project/commit/c82e4ef6960b9f09fc77abc10f374417007f5f00.diff L

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