@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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
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
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
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
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
efriedma-quic wrote:
X19 is the base register; can we actually allocate arguments in it in general?
This seems hard to fix.
It looks like frame lowering assumes X9 is available; that's probably fixable,
but the code needs to be reworked, I think.
X15 is used on Windows for stack allocation;
@@ -8287,6 +8289,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo ,
SDValue InGlue;
if (RequiresSMChange) {
+
+if (Subtarget->hasSVE()) {
efriedma-quic wrote:
There are two different kinds of DWARF "unwind info"; one is the kind that's in
a
https://github.com/efriedma-quic approved this pull request.
https://github.com/llvm/llvm-project/pull/94228
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
Ping
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
https://github.com/efriedma-quic created
https://github.com/llvm/llvm-project/pull/94282
The construct has unclear semantics in general, and it's not really interesting
to try to support. So diagnose it.
Some subset of the cases this rejects might be possible to handle, if this
shows up in
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/94228
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1853,18 +1853,26 @@ static std::string getMangledNameImpl(CodeGenModule
, GlobalDecl GD,
break;
case MultiVersionKind::Target: {
auto *Attr = FD->getAttr();
+assert(Attr &&
+ "Expected TargetAttr to be present for attribute
https://github.com/efriedma-quic approved this pull request.
https://github.com/llvm/llvm-project/pull/94228
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
> > The correct answer here is probably to fix the sizes in the RecordLayout
> > itself; in particular, the DataSize of the members.
>
> That would be ideal, but also means we'd have to reflect the various C++
> attributes that affect layout in DWARF. Avoiding adding such
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+class ObjectSizeVisitor
+: public ConstStmtVisitor {
+ bool SkipASE;
+
@@ -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
@@ -2567,16 +2567,16 @@ int main() {
// CHECK3-NEXT:[[I:%.*]] = alloca i32, align 4
// CHECK3-NEXT:[[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK3-NEXT:[[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
-// CHECK3-NEXT:
@@ -1062,6 +1063,160 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+class ObjectSizeVisitor
+: public ConstStmtVisitor {
+ ASTContext
+
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+class ObjectSizeVisitor
+: public ConstStmtVisitor {
+ bool SkipASE;
+
efriedma-quic wrote:
Please add a table to LangRef comparing the behavior of the three versions of
min/max intrinsics for various inputs.
https://github.com/llvm/llvm-project/pull/93841
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
efriedma-quic wrote:
I'm skeptical it's correct to skip all the assertions like this; the assertions
are there to ensure the layout of the LLVM IR type matches the layout provided
by the RecordLayout. If the LLVM IR layout is wrong, address-related
computations will be wrong, and ultimately
@@ -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 !=
@@ -743,6 +743,20 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr
) {
CallerType.Func = CallerDecl->getType()->getAs();
}
+ if (Context.getTargetInfo().getTriple().isPPC()) {
+if (Context.getTargetInfo().getTriple().isOSAIX())
+ return
@@ -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
@@ -436,9 +436,9 @@ class ScalarExprEmitter
if (Value *Result = ConstantEmitter(CGF).tryEmitConstantExpr(E)) {
if (E->isGLValue())
-return CGF.Builder.CreateLoad(Address(
-Result, CGF.ConvertTypeForMem(E->getType()),
-
@@ -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
+ ///
@@ -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 !=
@@ -1533,9 +1533,17 @@ void CodeGenFunction::EmitReturnStmt(const ReturnStmt
) {
Builder.CreateStore(Result.getScalarVal(), ReturnValue);
} else {
switch (getEvaluationKind(RV->getType())) {
-case TEK_Scalar:
- Builder.CreateStore(EmitScalarExpr(RV),
@@ -2567,16 +2567,16 @@ int main() {
// CHECK3-NEXT:[[I:%.*]] = alloca i32, align 4
// CHECK3-NEXT:[[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK3-NEXT:[[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
-// CHECK3-NEXT:
@@ -743,6 +743,20 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr
) {
CallerType.Func = CallerDecl->getType()->getAs();
}
+ if (Context.getTargetInfo().getTriple().isPPC()) {
+if (Context.getTargetInfo().getTriple().isOSAIX())
+ return
@@ -0,0 +1,1659 @@
+//=- AArch64SchedOryon.td - Qualcomm Oryon CPU 001 ---*- tablegen -*-=//
+//
+// 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:
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/93530
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5341,6 +5341,15 @@ void CodeGenModule::EmitGlobalVarDefinition(const
VarDecl *D,
!IsDefinitionAvailableExternally &&
D->needsDestruction(getContext()) == QualType::DK_cxx_destructor;
+ // It is helpless to emit the definition for an available_externally
https://github.com/efriedma-quic closed
https://github.com/llvm/llvm-project/pull/90303
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/93314
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5341,6 +5341,15 @@ void CodeGenModule::EmitGlobalVarDefinition(const
VarDecl *D,
!IsDefinitionAvailableExternally &&
D->needsDestruction(getContext()) == QualType::DK_cxx_destructor;
+ // It is helpless to emit the definition for an available_externally
https://github.com/efriedma-quic commented:
I think if a variable is GVA_AvailableExternally, and we can't emit a constant,
we should just completely skip emitting the definition: there isn't any point
to emitting an available_externally definition that doesn't actually contain
any
efriedma-quic wrote:
How does this interact with #91364?
https://github.com/llvm/llvm-project/pull/93495
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic updated
https://github.com/llvm/llvm-project/pull/90303
>From 4a3612bcf0e6dd3a68e2b648bb662b4faf154b26 Mon Sep 17 00:00:00 2001
From: Eli Friedman
Date: Fri, 26 Apr 2024 16:58:57 -0700
Subject: [PATCH] [clang codegen] Delete unnecessary GEP cleanup code.
efriedma-quic wrote:
Oh, I somehow thought the macro was part of the spec; reading again, I guess it
isn't, it's just an attempt to implement the spec.
We probably want some feedback from libc implementers to check if this is what
they want. I don't really want to end up in a situation where
https://github.com/efriedma-quic closed
https://github.com/llvm/llvm-project/pull/85837
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
(In the future, please leave a note on the pull request when you push an
update; as far as
I can tell, GitHub doesn't generate a notification when you force-push to the
branch.)
https://github.com/llvm/llvm-project/pull/85837
https://github.com/efriedma-quic approved this pull request.
LGTM, but maybe wait a few days to merge in case someone else has comments.
https://github.com/llvm/llvm-project/pull/92699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -965,6 +965,16 @@ void Preprocessor::Lex(Token ) {
LastTokenWasAt = Result.is(tok::at);
--LexLevel;
+ if (Result.is(tok::l_brace)) {
+CurlyBraceLevel++;
+ } else if (Result.is(tok::r_brace)) {
+if (!RoundingPragmas.empty() &&
efriedma-quic
https://github.com/efriedma-quic commented:
This approach seems much better.
https://github.com/llvm/llvm-project/pull/92699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/92699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -48,10 +48,13 @@ uint8x16x4_t test_vld4q_u8(const uint8_t *addr)
// CHECK-LABEL: @test_vst2q_u32(
// CHECK-NEXT: entry:
-// CHECK-NEXT:[[VALUE_COERCE_FCA_0_0_EXTRACT:%.*]] = extractvalue
[[STRUCT_UINT32X4X2_T:%.*]] [[VALUE_COERCE:%.*]], 0, 0
-// CHECK-NEXT:
@@ -44,20 +44,20 @@ struct S1 f1(struct S1 s1) { return s1; }
// CHECK-SOFT: define{{.*}} void @_Z2f22S2(ptr dead_on_unwind noalias
nocapture writable writeonly sret(%struct.S2) align 8 %agg.result, [4 x i32]
%s2.coerce)
// CHECK-HARD: define{{.*}} arm_aapcs_vfpcc [2 x <2 x
@@ -46,9 +46,9 @@ int mane() {
char1 f1{1};
char1 f2{1};
-// CHECK: [[TMP:%.+]] = alloca i16
efriedma-quic wrote:
The revised version of casting integers is a bit more aggressive; it's hard to
make it precisely match the old code while still
@@ -177,7 +179,12 @@ kernel void KernelTwoMember(struct StructTwoMember u) {
// AMDGCN-LABEL: define{{.*}} amdgpu_kernel void @KernelLargeTwoMember
// AMDGCN-SAME: (%struct.LargeStructTwoMember %[[u_coerce:.*]])
// AMDGCN: %[[u:.*]] = alloca %struct.LargeStructTwoMember,
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/93115
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/93115
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic updated
https://github.com/llvm/llvm-project/pull/93115
>From 19f3b677d92ed88b825b455d738055da05f91e0d Mon Sep 17 00:00:00 2001
From: Eli Friedman
Date: Thu, 23 May 2024 18:38:04 -0700
Subject: [PATCH] Fix codegen of consteval functions returning an empty
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+class ObjectSizeVisitor
+: public ConstStmtVisitor {
+ bool SkipASE;
+
@@ -1052,6 +1053,165 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+class ObjectSizeVisitor
+: public ConstStmtVisitor {
+ bool SkipASE;
+
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+class ObjectSizeVisitor
+: public ConstStmtVisitor {
+ bool SkipASE;
+
@@ -1062,6 +1063,159 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+class ObjectSizeVisitor
+: public ConstStmtVisitor {
+ bool SkipASE;
+
@@ -135,6 +135,17 @@ class AggExprEmitter : public StmtVisitor {
EnsureDest(E->getType());
if (llvm::Value *Result = ConstantEmitter(CGF).tryEmitConstantExpr(E)) {
+ // An empty record can overlap other data (if declared with
+ // no_unique_address); omit
efriedma-quic wrote:
I didn't think so at first glance... but yes, we do, in certain obscure cases:
```
#include
struct A { char c; A(); };
struct __attribute((packed)) S { char a; int x; __attribute((aligned(2))) char
y; consteval S() : x(1), a(3), y(2) {} };
struct S2 {
https://github.com/efriedma-quic created
https://github.com/llvm/llvm-project/pull/93115
If a class is empty, don't store it to memory: the store might overwrite useful
data.
(See also d60c3d08.)
Fixes #93040.
>From bdfcc729c309fc5b1092b67d7c3c803c852ae251 Mon Sep 17 00:00:00 2001
From: Eli
@@ -1793,6 +1793,37 @@ void ItaniumCXXABI::EmitDestructorCall(CodeGenFunction
,
ThisTy, VTT, VTTTy, nullptr);
}
+// Check if any non-inline method has the specified attribute.
+template
+static bool CXXRecordNonInlineHasAttr(const CXXRecordDecl
@@ -11868,8 +11868,10 @@ static bool CheckMultiVersionFunction(Sema ,
FunctionDecl *NewFD,
return false;
if (!OldDecl || !OldDecl->getAsFunction() ||
- OldDecl->getDeclContext()->getRedeclContext() !=
- NewFD->getDeclContext()->getRedeclContext()) {
+
efriedma-quic wrote:
Looks fine.
https://github.com/llvm/llvm-project/pull/93086
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/92579
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1793,6 +1793,37 @@ void ItaniumCXXABI::EmitDestructorCall(CodeGenFunction
,
ThisTy, VTT, VTTTy, nullptr);
}
+// Check if any non-inline method has the specified attribute.
+template
+static bool CXXRecordNonInlineHasAttr(const CXXRecordDecl
https://github.com/efriedma-quic closed
https://github.com/llvm/llvm-project/pull/90255
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1793,6 +1793,37 @@ void ItaniumCXXABI::EmitDestructorCall(CodeGenFunction
,
ThisTy, VTT, VTTTy, nullptr);
}
+// Check if any non-inline method has the specified attribute.
+template
+static bool CXXRecordNonInlineHasAttr(const CXXRecordDecl
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/92885
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/91965
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
I think the underlying functionality is pretty clearly useful: identical code
folding gives significant codesize reductions. In fact, on Windows, the linker
does this kind of folding automatically by default (despite the fact that it
isn't standards-compliant). I imagine
https://github.com/efriedma-quic approved this pull request.
Please don't use "NFC" markings for patches that change the emitted IR, even if
it doesn't significantly impact the resulting assembly in most cases.
That said, LGTM
https://github.com/llvm/llvm-project/pull/92836
efriedma-quic wrote:
This patch, as proposed, doesn't seem like a good idea: it's very likely to
miscompile user code without any diagnostic. Are you sure you don't want one of
the following?
- A soft-float ABI (-mabi=aapcs-soft)
- Completely forbidding the use of floating-point values
efriedma-quic wrote:
Bot is unreliable, so copy-pasting:
> ⚠️ 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
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/90255
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/92612
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1950,8 +1950,22 @@ ConstantLValueEmitter::tryEmitBase(const
APValue::LValueBase ) {
if (D->hasAttr())
return CGM.GetWeakRefReference(D).getPointer();
-if (auto FD = dyn_cast(D))
- return CGM.GetAddrOfFunction(FD);
+if (auto FD = dyn_cast(D)) {
+
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/90849
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -emit-llvm -triple i386-linux -Wno-unknown-pragmas %s -o -
| FileCheck %s
efriedma-quic wrote:
Is there some reason the preprocessor can't parse FENV_ROUND? Breaking code
with -save-temps etc. seems bad.
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/92778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -emit-llvm -triple i386-linux -Wno-unknown-pragmas %s -o -
| FileCheck %s
efriedma-quic wrote:
Since this is a preprocessor testcase, can you just use -E?
https://github.com/llvm/llvm-project/pull/92699
@@ -3054,6 +3054,13 @@ QualType ASTContext::removeAddrSpaceQualType(QualType T)
const {
if (!T.hasAddressSpace())
return T;
+ // For arrays, strip the qualifier off the element type, then reconstruct the
+ // array type
+ if (T.getTypePtr()->isArrayType()) {
+
@@ -537,8 +537,9 @@ void AggExprEmitter::EmitArrayInit(Address DestPtr,
llvm::ArrayType *AType,
elementType.isTriviallyCopyableType(CGF.getContext())) {
CodeGen::CodeGenModule = CGF.CGM;
ConstantEmitter Emitter(CGF);
+Qualifiers Quals;
QualType
@@ -537,8 +537,9 @@ void AggExprEmitter::EmitArrayInit(Address DestPtr,
llvm::ArrayType *AType,
elementType.isTriviallyCopyableType(CGF.getContext())) {
CodeGen::CodeGenModule = CGF.CGM;
ConstantEmitter Emitter(CGF);
+Qualifiers Quals;
QualType
@@ -4180,8 +4180,10 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const
ArraySubscriptExpr *E,
// If the base is a vector type, then we are forming a vector element lvalue
// with this subscript.
- if (E->getBase()->getType()->isVectorType() &&
-
efriedma-quic wrote:
If we're going to do this, it should probably also work for constants.
Also, I think I'd prefer to sort out the situation with the C++ standard's
rules for constant merging before we start extending those rules. See #63628.
https://github.com/llvm/llvm-project/pull/92499
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/92473
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
clang specifically diagnoses always_inline functions. So for example, say you
want to write something like:
```
#include
__attribute__((always_inline, target("+sve")))
static inline void f(void* p) __arm_streaming_compatible {
*(svuint32_t*)p = svmul_m(svptrue_b32(),
@@ -949,11 +949,11 @@ tryEmitGlobalCompoundLiteral(ConstantEmitter ,
static llvm::Constant *
EmitArrayConstant(CodeGenModule , llvm::ArrayType *DesiredType,
- llvm::Type *CommonElementType, unsigned ArrayBound,
+ llvm::Type
@@ -535,20 +535,23 @@ void AggExprEmitter::EmitArrayInit(Address DestPtr,
llvm::ArrayType *AType,
elementType.isTriviallyCopyableType(CGF.getContext())) {
CodeGen::CodeGenModule = CGF.CGM;
ConstantEmitter Emitter(CGF);
-LangAS AS =
efriedma-quic wrote:
> Thinking about it a bit more, maybe we can just do some magic to make things
> work? Say, if you specify `__attribute__((target("sve")))
> __arm_streaming_compatible`, and the caller is in streaming mode, allow the
> call even if the caller doesn't have SVE proper.
efriedma-quic wrote:
The key here is that `__arm_streaming_compatible` is the only way to write code
that runs in both streaming and non-streaming mode; outside of
`__arm_streaming_compatible`, there generally isn't an issue. If you know
you're not in streaming mode, you can just check
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/92427
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
clang already generates certain diagnostics from ExprConstant; expanding the
set of diagnostics could be reasonable.
Alternatively, we could try to add some sort of cooperation between
DiagRuntimeBehavior and constant evaluation, to try to avoid having to diagnose
101 - 200 of 889 matches
Mail list logo