Skip to content

Commit 481e923

Browse files
author
z1.cciauto
committed
merge main into amd-staging
2 parents 444d66f + 9a2a4f6 commit 481e923

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+725
-357
lines changed

bolt/utils/dot2html/d3-graphviz-template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
33
<body>
4-
<script src="https://d3js.org/d3.v5.min.js"></script>
5-
<script src="https://unpkg.com/@hpcc-js/wasm@0.3.11/dist/index.min.js"></script>
6-
<script src="https://unpkg.com/d3-graphviz@3.0.5/build/d3-graphviz.js"></script>
4+
<script src="https://d3js.org/d3.v7.min.js"></script>
5+
<script src="https://unpkg.com/@hpcc-js/wasm@2.20.0/dist/graphviz.umd.js"></script>
6+
<script src="https://unpkg.com/d3-graphviz@5.6.0/build/d3-graphviz.js"></script>
77
<div id="graph" style="text-align: center;"></div>
88
<script>
99
var dotSrc = `

clang/lib/CIR/CodeGen/CIRGenAtomic.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,26 @@ void CIRGenFunction::emitAtomicInit(Expr *init, LValue dest) {
718718
return;
719719
}
720720

721-
case cir::TEK_Aggregate:
722-
cgm.errorNYI(init->getSourceRange(), "emitAtomicInit: aggregate type");
721+
case cir::TEK_Aggregate: {
722+
// Fix up the destination if the initializer isn't an expression
723+
// of atomic type.
724+
bool zeroed = false;
725+
if (!init->getType()->isAtomicType()) {
726+
zeroed = atomics.emitMemSetZeroIfNecessary();
727+
dest = atomics.projectValue();
728+
}
729+
730+
// Evaluate the expression directly into the destination.
731+
assert(!cir::MissingFeatures::aggValueSlotGC());
732+
AggValueSlot slot = AggValueSlot::forLValue(
733+
dest, AggValueSlot::IsNotDestructed, AggValueSlot::IsNotAliased,
734+
AggValueSlot::DoesNotOverlap,
735+
zeroed ? AggValueSlot::IsZeroed : AggValueSlot::IsNotZeroed);
736+
737+
emitAggExpr(init, slot);
723738
return;
724739
}
740+
}
725741

726742
llvm_unreachable("bad evaluation kind");
727743
}

clang/lib/CIR/CodeGen/CIRGenCall.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo,
522522
assert(!cir::MissingFeatures::opCallPaddingArgs());
523523

524524
mlir::Type argType = convertType(canQualArgType);
525-
if (!mlir::isa<cir::RecordType>(argType)) {
525+
if (!mlir::isa<cir::RecordType>(argType) &&
526+
!mlir::isa<cir::ComplexType>(argType)) {
526527
mlir::Value v;
527528
if (arg.isAggregate())
528529
cgm.errorNYI(loc, "emitCall: aggregate call argument");
@@ -540,15 +541,16 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo,
540541
cirCallArgs[argNo] = v;
541542
} else {
542543
Address src = Address::invalid();
543-
if (!arg.isAggregate())
544-
cgm.errorNYI(loc, "emitCall: non-aggregate call argument");
545-
else
544+
if (!arg.isAggregate()) {
545+
src = createMemTemp(arg.ty, loc, "coerce");
546+
arg.copyInto(*this, src, loc);
547+
} else {
546548
src = arg.hasLValue() ? arg.getKnownLValue().getAddress()
547549
: arg.getKnownRValue().getAggregateAddress();
550+
}
548551

549552
// Fast-isel and the optimizer generally like scalar values better than
550553
// FCAs, so we flatten them if this is safe to do for this argument.
551-
auto argRecordTy = cast<cir::RecordType>(argType);
552554
mlir::Type srcTy = src.getElementType();
553555
// FIXME(cir): get proper location for each argument.
554556
mlir::Location argLoc = loc;
@@ -564,7 +566,7 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo,
564566
// uint64_t DstSize = CGM.getDataLayout().getTypeAllocSize(STy);
565567
// if (SrcSize < DstSize) {
566568
assert(!cir::MissingFeatures::dataLayoutTypeAllocSize());
567-
if (srcTy != argRecordTy) {
569+
if (srcTy != argType) {
568570
cgm.errorNYI(loc, "emitCall: source type does not match argument type");
569571
} else {
570572
// FIXME(cir): this currently only runs when the types are exactly the
@@ -676,6 +678,18 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo,
676678
llvm_unreachable("Invalid evaluation kind");
677679
}
678680

681+
void CallArg::copyInto(CIRGenFunction &cgf, Address addr,
682+
mlir::Location loc) const {
683+
LValue dst = cgf.makeAddrLValue(addr, ty);
684+
if (!hasLV && rv.isScalar())
685+
cgf.cgm.errorNYI(loc, "copyInto scalar value");
686+
else if (!hasLV && rv.isComplex())
687+
cgf.emitStoreOfComplex(loc, rv.getComplexValue(), dst, /*isInit=*/true);
688+
else
689+
cgf.cgm.errorNYI(loc, "copyInto hasLV");
690+
isUsed = true;
691+
}
692+
679693
void CIRGenFunction::emitCallArg(CallArgList &args, const clang::Expr *e,
680694
clang::QualType argType) {
681695
assert(argType->isReferenceType() == e->isGLValue() &&

clang/lib/CIR/CodeGen/CIRGenCall.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ struct CallArg {
224224
}
225225

226226
bool isAggregate() const { return hasLV || rv.isAggregate(); }
227+
228+
void copyInto(CIRGenFunction &cgf, Address addr, mlir::Location loc) const;
227229
};
228230

229231
class CallArgList : public llvm::SmallVector<CallArg, 8> {

clang/lib/CIR/CodeGen/CIRGenExprAggregate.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
144144
void VisitUnaryCoawait(UnaryOperator *e) {
145145
cgf.cgm.errorNYI(e->getSourceRange(), "AggExprEmitter: VisitUnaryCoawait");
146146
}
147-
void VisitUnaryExtension(UnaryOperator *e) {
148-
cgf.cgm.errorNYI(e->getSourceRange(),
149-
"AggExprEmitter: VisitUnaryExtension");
150-
}
147+
void VisitUnaryExtension(UnaryOperator *e) { Visit(e->getSubExpr()); }
151148
void VisitSubstNonTypeTemplateParmExpr(SubstNonTypeTemplateParmExpr *e) {
152149
cgf.cgm.errorNYI(e->getSourceRange(),
153150
"AggExprEmitter: VisitSubstNonTypeTemplateParmExpr");
@@ -184,7 +181,8 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
184181
cgf.cgm.errorNYI(e->getSourceRange(), "AggExprEmitter: VisitBinAssign");
185182
}
186183
void VisitBinComma(const BinaryOperator *e) {
187-
cgf.cgm.errorNYI(e->getSourceRange(), "AggExprEmitter: VisitBinComma");
184+
cgf.emitIgnoredExpr(e->getLHS());
185+
Visit(e->getRHS());
188186
}
189187
void VisitBinCmp(const BinaryOperator *e) {
190188
cgf.cgm.errorNYI(e->getSourceRange(), "AggExprEmitter: VisitBinCmp");
@@ -212,9 +210,11 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
212210
}
213211
void VisitChooseExpr(const ChooseExpr *e) { Visit(e->getChosenSubExpr()); }
214212
void VisitCXXParenListInitExpr(CXXParenListInitExpr *e) {
215-
cgf.cgm.errorNYI(e->getSourceRange(),
216-
"AggExprEmitter: VisitCXXParenListInitExpr");
213+
visitCXXParenListOrInitListExpr(e, e->getInitExprs(),
214+
e->getInitializedFieldInUnion(),
215+
e->getArrayFiller());
217216
}
217+
218218
void VisitArrayInitLoopExpr(const ArrayInitLoopExpr *e,
219219
llvm::Value *outerBegin = nullptr) {
220220
cgf.cgm.errorNYI(e->getSourceRange(),

clang/lib/Sema/SemaTemplateDeductionGuide.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,27 +1189,20 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
11891189
// parameter list of a synthesized CTAD guide. See also the FIXME in
11901190
// test/SemaCXX/cxx20-ctad-type-alias.cpp:test25.
11911191
Sema::CheckTemplateArgumentInfo CTAI;
1192+
for (auto TA : Output.arguments())
1193+
if (SemaRef.CheckTemplateArgument(
1194+
TP, TA, F, F->getLocation(), F->getLocation(),
1195+
/*ArgumentPackIndex=*/-1, CTAI,
1196+
Sema::CheckTemplateArgumentKind::CTAK_Specified))
1197+
return nullptr;
11921198
if (Input.getArgument().getKind() == TemplateArgument::Pack) {
1193-
for (auto TA : Output.arguments()) {
1194-
if (SemaRef.CheckTemplateArgument(
1195-
TP, TA, F, F->getLocation(), F->getLocation(),
1196-
/*ArgumentPackIndex=*/-1, CTAI,
1197-
Sema::CheckTemplateArgumentKind::CTAK_Specified))
1198-
return nullptr;
1199-
}
12001199
// We will substitute the non-deduced template arguments with these
12011200
// transformed (unpacked at this point) arguments, where that substitution
12021201
// requires a pack for the corresponding parameter packs.
12031202
TemplateArgsForBuildingFPrime[Index] =
12041203
TemplateArgument::CreatePackCopy(Context, CTAI.SugaredConverted);
12051204
} else {
12061205
assert(Output.arguments().size() == 1);
1207-
TemplateArgumentLoc Transformed = Output.arguments()[0];
1208-
if (SemaRef.CheckTemplateArgument(
1209-
TP, Transformed, F, F->getLocation(), F->getLocation(),
1210-
/*ArgumentPackIndex=*/-1, CTAI,
1211-
Sema::CheckTemplateArgumentKind::CTAK_Specified))
1212-
return nullptr;
12131206
TemplateArgsForBuildingFPrime[Index] = CTAI.SugaredConverted[0];
12141207
}
12151208
}

clang/test/CIR/CodeGen/complex.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,3 +1311,49 @@ void real_on_scalar_from_imag_with_type_promotion() {
13111311
// OGCG: %[[A_IMAG_F32:.*]] = fpext half %[[A_IMAG]] to float
13121312
// OGCG: %[[A_IMAG_F16:.*]] = fptrunc float %[[A_IMAG_F32]] to half
13131313
// OGCG: store half %[[A_IMAG_F16]], ptr %[[B_ADDR]], align 2
1314+
1315+
void complex_type_parameter(float _Complex a) {}
1316+
1317+
// CIR: %[[A_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["a", init]
1318+
// CIR: cir.store %{{.*}}, %[[A_ADDR]] : !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>
1319+
1320+
// TODO(CIR): the difference between the CIR LLVM and OGCG is because the lack of calling convention lowering,
1321+
// Test will be updated when that is implemented
1322+
1323+
// LLVM: %[[A_ADDR:.*]] = alloca { float, float }, i64 1, align 4
1324+
// LLVM: store { float, float } %{{.*}}, ptr %[[A_ADDR]], align 4
1325+
1326+
// OGCG: %[[A_ADDR:.*]] = alloca { float, float }, align 4
1327+
// OGCG: store <2 x float> %a.coerce, ptr %[[A_ADDR]], align 4
1328+
1329+
void complex_type_argument() {
1330+
float _Complex a;
1331+
complex_type_parameter(a);
1332+
}
1333+
1334+
// CIR: %[[A_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["a"]
1335+
// CIR: %[[ARG_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["coerce"]
1336+
// CIR: %[[TMP_A:.*]] = cir.load{{.*}} %[[A_ADDR]] : !cir.ptr<!cir.complex<!cir.float>>, !cir.complex<!cir.float>
1337+
// CIR: cir.store{{.*}} %[[TMP_A]], %[[ARG_ADDR]] : !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>
1338+
// CIR: %[[TMP_ARG:.*]] = cir.load{{.*}} %[[ARG_ADDR]] : !cir.ptr<!cir.complex<!cir.float>>, !cir.complex<!cir.float>
1339+
// CIR: cir.call @_Z22complex_type_parameterCf(%[[TMP_ARG]]) : (!cir.complex<!cir.float>) -> ()
1340+
1341+
// LLVM: %[[A_ADDR:.*]] = alloca { float, float }, i64 1, align 4
1342+
// LLVM: %[[ARG_ADDR:.*]] = alloca { float, float }, i64 1, align 4
1343+
// LLVM: %[[TMP_A:.*]] = load { float, float }, ptr %[[A_ADDR]], align 4
1344+
// LLVM: store { float, float } %[[TMP_A]], ptr %[[ARG_ADDR]], align 4
1345+
// LLVM: %[[TMP_ARG:.*]] = load { float, float }, ptr %[[ARG_ADDR]], align 4
1346+
// LLVM: call void @_Z22complex_type_parameterCf({ float, float } %[[TMP_ARG]])
1347+
1348+
// OGCG: %[[A_ADDR:.*]] = alloca { float, float }, align 4
1349+
// OGCG: %[[ARG_ADDR:.*]] = alloca { float, float }, align 4
1350+
// OGCG: %[[A_REAL_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 0
1351+
// OGCG: %[[A_REAL:.*]] = load float, ptr %[[A_REAL_PTR]], align 4
1352+
// OGCG: %[[A_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 1
1353+
// OGCG: %[[A_IMAG:.*]] = load float, ptr %[[A_IMAG_PTR]], align 4
1354+
// OGCG: %[[ARG_REAL_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[ARG_ADDR]], i32 0, i32 0
1355+
// OGCG: %[[ARG_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[ARG_ADDR]], i32 0, i32 1
1356+
// OGCG: store float %[[A_REAL]], ptr %[[ARG_REAL_PTR]], align 4
1357+
// OGCG: store float %[[A_IMAG]], ptr %[[ARG_IMAG_PTR]], align 4
1358+
// OGCG: %[[TMP_ARG:.*]] = load <2 x float>, ptr %[[ARG_ADDR]], align 4
1359+
// OGCG: call void @_Z22complex_type_parameterCf(<2 x float> noundef %[[TMP_ARG]])
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
2+
// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
3+
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll
4+
// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s
5+
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
6+
// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s
7+
8+
struct CompleteS {
9+
int a;
10+
char b;
11+
};
12+
13+
void cxx_paren_list_init_expr() { CompleteS a(1, 'a'); }
14+
15+
// CIR: %[[A_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr<!rec_CompleteS>, ["a", init]
16+
// CIR: %[[ELEM_0_PTR:.*]] = cir.get_member %[[A_ADDR]][0] {name = "a"} : !cir.ptr<!rec_CompleteS> -> !cir.ptr<!s32i>
17+
// CIR: %[[ELEM_0_VAL:.*]] = cir.const #cir.int<1> : !s32i
18+
// CIR: cir.store{{.*}} %[[ELEM_0_VAL]], %[[ELEM_0_PTR]] : !s32i, !cir.ptr<!s32i>
19+
// CIR: %[[ELEM_1_PTR:.*]] = cir.get_member %[[A_ADDR]][1] {name = "b"} : !cir.ptr<!rec_CompleteS> -> !cir.ptr<!s8i>
20+
// CIR: %[[ELEM_1_VAL:.*]] = cir.const #cir.int<97> : !s8i
21+
// CIR: cir.store{{.*}} %[[ELEM_1_VAL]], %[[ELEM_1_PTR]] : !s8i, !cir.ptr<!s8i>
22+
23+
// LLVM: %[[A_ADDR:.*]] = alloca %struct.CompleteS, i64 1, align 4
24+
// LLVM: %[[ELEM_0_PTR:.*]] = getelementptr %struct.CompleteS, ptr %[[A_ADDR]], i32 0, i32 0
25+
// LLVM: store i32 1, ptr %[[ELEM_0_PTR]], align 4
26+
// LLVM: %[[ELEM_1_PTR:.*]] = getelementptr %struct.CompleteS, ptr %[[A_ADDR]], i32 0, i32 1
27+
// LLVM: store i8 97, ptr %[[ELEM_1_PTR]], align 4
28+
29+
// OGCG: %[[A_ADDR:.*]] = alloca %struct.CompleteS, align 4
30+
// OGCG: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[A_ADDR]], ptr align 4 @__const._Z24cxx_paren_list_init_exprv.a, i64 8, i1 false)

clang/test/CIR/CodeGen/struct.cpp

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,67 @@ void generic_selection() {
183183
// OGCG: %[[C_ADDR:.*]] = alloca i32, align 4
184184
// OGCG: %[[D_ADDR:.*]] = alloca %struct.CompleteS, align 4
185185
// OGCG: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[D_ADDR]], ptr align 4 %[[A_ADDR]], i64 8, i1 false)
186+
187+
void atomic_init() {
188+
_Atomic CompleteS a;
189+
__c11_atomic_init(&a, {});
190+
}
191+
192+
// CIR: cir.func{{.*}} @_Z11atomic_initv()
193+
// CIR: %[[A_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr<!rec_CompleteS>, ["a"]
194+
// CIR: %[[ELEM_0_PTR:.*]] = cir.get_member %[[A_ADDR]][0] {name = "a"} : !cir.ptr<!rec_CompleteS> -> !cir.ptr<!s32i>
195+
// CIR: %[[CONST_0:.*]] = cir.const #cir.int<0> : !s32i
196+
// CIR: cir.store{{.*}} %[[CONST_0]], %[[ELEM_0_PTR]] : !s32i, !cir.ptr<!s32i>
197+
// CIR: %[[ELEM_1_PTR:.*]] = cir.get_member %[[A_ADDR]][1] {name = "b"} : !cir.ptr<!rec_CompleteS> -> !cir.ptr<!s8i>
198+
// CIR: %[[CONST_0:.*]] = cir.const #cir.int<0> : !s8i
199+
// CIR: cir.store{{.*}} %[[CONST_0]], %[[ELEM_1_PTR]] : !s8i, !cir.ptr<!s8i>
200+
201+
// LLVM: define{{.*}} void @_Z11atomic_initv()
202+
// LLVM: %[[A_ADDR:.*]] = alloca %struct.CompleteS, i64 1, align 8
203+
// LLVM: %[[ELEM_0_PTR:.*]] = getelementptr %struct.CompleteS, ptr %[[A_ADDR]], i32 0, i32 0
204+
// LLVM: store i32 0, ptr %[[ELEM_0_PTR]], align 8
205+
// LLVM: %[[ELEM_1_PTR:.*]] = getelementptr %struct.CompleteS, ptr %[[A_ADDR]], i32 0, i32 1
206+
// LLVM: store i8 0, ptr %[[ELEM_1_PTR]], align 4
207+
208+
// OGCG: define{{.*}} void @_Z11atomic_initv()
209+
// OGCG: %[[A_ADDR:.*]] = alloca %struct.CompleteS, align 8
210+
// OGCG: %[[ELEM_0_PTR:.*]] = getelementptr inbounds nuw %struct.CompleteS, ptr %[[A_ADDR]], i32 0, i32 0
211+
// OGCG: store i32 0, ptr %[[ELEM_0_PTR]], align 8
212+
// OGCG: %[[ELEM_1_PTR:.*]] = getelementptr inbounds nuw %struct.CompleteS, ptr %[[A_ADDR]], i32 0, i32 1
213+
// OGCG: store i8 0, ptr %[[ELEM_1_PTR]], align 4
214+
215+
void unary_extension() {
216+
CompleteS a = __extension__ CompleteS();
217+
}
218+
219+
// CIR: %[[A_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr<!rec_CompleteS>, ["a", init]
220+
// CIR: %[[ZERO_INIT:.*]] = cir.const #cir.zero : !rec_CompleteS
221+
// CIR: cir.store{{.*}} %[[ZERO_INIT]], %[[A_ADDR]] : !rec_CompleteS, !cir.ptr<!rec_CompleteS>
222+
223+
// LLVM: %[[A_ADDR:.*]] = alloca %struct.CompleteS, i64 1, align 4
224+
// LLVM: store %struct.CompleteS zeroinitializer, ptr %[[A_ADDR]], align 4
225+
226+
// OGCG: %[[A_ADDR:.*]] = alloca %struct.CompleteS, align 4
227+
// OGCG: call void @llvm.memset.p0.i64(ptr align 4 %[[A_ADDR]], i8 0, i64 8, i1 false)
228+
229+
void bin_comma() {
230+
CompleteS a = (CompleteS(), CompleteS());
231+
}
232+
233+
// CIR: cir.func{{.*}} @_Z9bin_commav()
234+
// CIR: %[[A_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr<!rec_CompleteS>, ["a", init]
235+
// CIR: %[[TMP_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr<!rec_CompleteS>, ["agg.tmp0"]
236+
// CIR: %[[ZERO:.*]] = cir.const #cir.zero : !rec_CompleteS
237+
// CIR: cir.store{{.*}} %[[ZERO]], %[[TMP_ADDR]] : !rec_CompleteS, !cir.ptr<!rec_CompleteS>
238+
// CIR: %[[ZERO:.*]] = cir.const #cir.zero : !rec_CompleteS
239+
// CIR: cir.store{{.*}} %[[ZERO]], %[[A_ADDR]] : !rec_CompleteS, !cir.ptr<!rec_CompleteS>
240+
241+
// LLVM: define{{.*}} void @_Z9bin_commav()
242+
// LLVM: %[[A_ADDR:.*]] = alloca %struct.CompleteS, i64 1, align 4
243+
// LLVM: %[[TMP_ADDR:.*]] = alloca %struct.CompleteS, i64 1, align 4
244+
// LLVM: store %struct.CompleteS zeroinitializer, ptr %[[TMP_ADDR]], align 4
245+
// LLVM: store %struct.CompleteS zeroinitializer, ptr %[[A_ADDR]], align 4
246+
247+
// OGCG: define{{.*}} void @_Z9bin_commav()
248+
// OGCG: %[[A_ADDR:.*]] = alloca %struct.CompleteS, align 4
249+
// OGCG: call void @llvm.memset.p0.i64(ptr align 4 %[[A_ADDR]], i8 0, i64 8, i1 false)

flang/include/flang/Parser/message.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ class Message : public common::ReferenceCounted<Message> {
307307
bool Merge(const Message &);
308308
bool operator==(const Message &that) const;
309309
bool operator!=(const Message &that) const { return !(*this == that); }
310+
bool AtSameLocation(const Message &) const;
310311

311312
private:
312-
bool AtSameLocation(const Message &) const;
313313
std::variant<ProvenanceRange, CharBlock> location_;
314314
std::variant<MessageFixedText, MessageFormattedText, MessageExpectedText>
315315
text_;

0 commit comments

Comments
 (0)