Skip to content

Commit d3eb36b

Browse files
authored
Merge branch 'main' into breakpoint-add
2 parents fb2e2df + b975a7b commit d3eb36b

File tree

24 files changed

+404
-243
lines changed

24 files changed

+404
-243
lines changed

clang/cmake/caches/Fuchsia.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
179179
set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
180180

181181
if(FUCHSIA_ENABLE_PGO)
182-
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")
182+
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED IR CACHE BOOL "")
183183

184184
set(_FUCHSIA_BOOTSTRAP_TARGETS
185185
generate-profdata

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 21 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -539,28 +539,22 @@ let Features = "avx", Attributes = [NoThrow] in {
539539

540540
let Features = "avx", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
541541
def lddqu256 : X86Builtin<"_Vector<32, char>(char const *)">;
542-
}
543-
544-
let Features = "avx", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
545-
def maskloadpd : X86Builtin<"_Vector<2, double>(_Vector<2, double const *>, _Vector<2, long long int>)">;
546-
def maskloadps : X86Builtin<"_Vector<4, float>(_Vector<4, float const *>, _Vector<4, int>)">;
547-
}
548542

549-
let Features = "avx", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
550543
def maskloadpd256 : X86Builtin<"_Vector<4, double>(_Vector<4, double const *>, _Vector<4, long long int>)">;
551544
def maskloadps256 : X86Builtin<"_Vector<8, float>(_Vector<8, float const *>, _Vector<8, int>)">;
545+
546+
def maskstorepd256 : X86Builtin<"void(_Vector<4, double *>, _Vector<4, long long int>, _Vector<4, double>)">;
547+
def maskstoreps256 : X86Builtin<"void(_Vector<8, float *>, _Vector<8, int>, _Vector<8, float>)">;
552548
}
553549

554550
let Features = "avx", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
551+
def maskloadpd : X86Builtin<"_Vector<2, double>(_Vector<2, double const *>, _Vector<2, long long int>)">;
552+
def maskloadps : X86Builtin<"_Vector<4, float>(_Vector<4, float const *>, _Vector<4, int>)">;
553+
555554
def maskstorepd : X86Builtin<"void(_Vector<2, double *>, _Vector<2, long long int>, _Vector<2, double>)">;
556555
def maskstoreps : X86Builtin<"void(_Vector<4, float *>, _Vector<4, int>, _Vector<4, float>)">;
557556
}
558557

559-
let Features = "avx", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
560-
def maskstorepd256 : X86Builtin<"void(_Vector<4, double *>, _Vector<4, long long int>, _Vector<4, double>)">;
561-
def maskstoreps256 : X86Builtin<"void(_Vector<8, float *>, _Vector<8, int>, _Vector<8, float>)">;
562-
}
563-
564558
let Features = "avx", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
565559
def vec_ext_v32qi : X86Builtin<"char(_Vector<32, char>, _Constant int)">;
566560
def vec_ext_v16hi : X86Builtin<"short(_Vector<16, short>, _Constant int)">;
@@ -626,13 +620,11 @@ let Features = "avx2", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWi
626620

627621
def psllwi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
628622
def pslldi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
629-
def psllqi256
630-
: X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
623+
def psllqi256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
631624

632625
def psrlwi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
633626
def psrldi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
634-
def psrlqi256
635-
: X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
627+
def psrlqi256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
636628

637629
def psrawi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
638630
def psradi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
@@ -658,87 +650,39 @@ let Features = "avx2", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWi
658650
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
659651
def maskloadd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int const *>, _Vector<8, int>)">;
660652
def maskloadq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int const *>, _Vector<4, long long int>)">;
661-
}
662-
663-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
664-
def maskloadd : X86Builtin<"_Vector<4, int>(_Vector<4, int const *>, _Vector<4, int>)">;
665-
def maskloadq : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int const *>, _Vector<2, long long int>)">;
666-
}
667653

668-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
669654
def maskstored256 : X86Builtin<"void(_Vector<8, int *>, _Vector<8, int>, _Vector<8, int>)">;
670655
def maskstoreq256 : X86Builtin<"void(_Vector<4, long long int *>, _Vector<4, long long int>, _Vector<4, long long int>)">;
656+
657+
def gatherd_pd256 : X86Builtin<"_Vector<4, double>(_Vector<4, double>, double const *, _Vector<4, int>, _Vector<4, double>, _Constant char)">;
658+
def gatherq_pd256 : X86Builtin<"_Vector<4, double>(_Vector<4, double>, double const *, _Vector<4, long long int>, _Vector<4, double>, _Constant char)">;
659+
def gatherd_ps256 : X86Builtin<"_Vector<8, float>(_Vector<8, float>, float const *, _Vector<8, int>, _Vector<8, float>, _Constant char)">;
660+
def gatherq_ps256 : X86Builtin<"_Vector<4, float>(_Vector<4, float>, float const *, _Vector<4, long long int>, _Vector<4, float>, _Constant char)">;
661+
662+
def gatherd_q256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, long long int const *, _Vector<4, int>, _Vector<4, long long int>, _Constant char)">;
663+
def gatherq_q256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, long long int const *, _Vector<4, long long int>, _Vector<4, long long int>, _Constant char)">;
664+
def gatherd_d256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int const *, _Vector<8, int>, _Vector<8, int>, _Constant char)">;
665+
def gatherq_d256 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, int const *, _Vector<4, long long int>, _Vector<4, int>, _Constant char)">;
671666
}
672667

673668
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
669+
def maskloadd : X86Builtin<"_Vector<4, int>(_Vector<4, int const *>, _Vector<4, int>)">;
670+
def maskloadq : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int const *>, _Vector<2, long long int>)">;
671+
674672
def maskstored : X86Builtin<"void(_Vector<4, int *>, _Vector<4, int>, _Vector<4, int>)">;
675673
def maskstoreq : X86Builtin<"void(_Vector<2, long long int *>, _Vector<2, long long int>, _Vector<2, long long int>)">;
676-
}
677674

678-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
679675
def gatherd_pd : X86Builtin<"_Vector<2, double>(_Vector<2, double>, double const *, _Vector<4, int>, _Vector<2, double>, _Constant char)">;
680-
}
681-
682-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
683-
def gatherd_pd256 : X86Builtin<"_Vector<4, double>(_Vector<4, double>, double const *, _Vector<4, int>, _Vector<4, double>, _Constant char)">;
684-
}
685-
686-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
687676
def gatherq_pd : X86Builtin<"_Vector<2, double>(_Vector<2, double>, double const *, _Vector<2, long long int>, _Vector<2, double>, _Constant char)">;
688-
}
689-
690-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
691-
def gatherq_pd256 : X86Builtin<"_Vector<4, double>(_Vector<4, double>, double const *, _Vector<4, long long int>, _Vector<4, double>, _Constant char)">;
692-
}
693-
694-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
695677
def gatherd_ps : X86Builtin<"_Vector<4, float>(_Vector<4, float>, float const *, _Vector<4, int>, _Vector<4, float>, _Constant char)">;
696-
}
697-
698-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
699-
def gatherd_ps256 : X86Builtin<"_Vector<8, float>(_Vector<8, float>, float const *, _Vector<8, int>, _Vector<8, float>, _Constant char)">;
700-
}
701-
702-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
703678
def gatherq_ps : X86Builtin<"_Vector<4, float>(_Vector<4, float>, float const *, _Vector<2, long long int>, _Vector<4, float>, _Constant char)">;
704-
}
705679

706-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
707-
def gatherq_ps256 : X86Builtin<"_Vector<4, float>(_Vector<4, float>, float const *, _Vector<4, long long int>, _Vector<4, float>, _Constant char)">;
708-
}
709-
710-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
711680
def gatherd_q : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, long long int const *, _Vector<4, int>, _Vector<2, long long int>, _Constant char)">;
712-
}
713-
714-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
715-
def gatherd_q256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, long long int const *, _Vector<4, int>, _Vector<4, long long int>, _Constant char)">;
716-
}
717-
718-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
719681
def gatherq_q : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, long long int const *, _Vector<2, long long int>, _Vector<2, long long int>, _Constant char)">;
720-
}
721-
722-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
723-
def gatherq_q256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, long long int const *, _Vector<4, long long int>, _Vector<4, long long int>, _Constant char)">;
724-
}
725-
726-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
727682
def gatherd_d : X86Builtin<"_Vector<4, int>(_Vector<4, int>, int const *, _Vector<4, int>, _Vector<4, int>, _Constant char)">;
728-
}
729-
730-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
731-
def gatherd_d256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int const *, _Vector<8, int>, _Vector<8, int>, _Constant char)">;
732-
}
733-
734-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
735683
def gatherq_d : X86Builtin<"_Vector<4, int>(_Vector<4, int>, int const *, _Vector<2, long long int>, _Vector<4, int>, _Constant char)">;
736684
}
737685

738-
let Features = "avx2", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
739-
def gatherq_d256 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, int const *, _Vector<4, long long int>, _Vector<4, int>, _Constant char)">;
740-
}
741-
742686
let Features = "f16c", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
743687
def vcvtps2ph : X86Builtin<"_Vector<8, short>(_Vector<4, float>, _Constant int)">;
744688
}

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
9292
mlir::Value value, CastKind kind,
9393
QualType destTy);
9494

95+
mlir::Value emitNullValue(QualType ty, mlir::Location loc) {
96+
return cgf.cgm.emitNullConstant(ty, loc);
97+
}
98+
9599
mlir::Value emitPromotedValue(mlir::Value result, QualType promotionType) {
96100
return builder.createFloatingCast(result, cgf.convertType(promotionType));
97101
}
@@ -182,6 +186,13 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
182186
return builder.getBool(e->getValue(), cgf.getLoc(e->getExprLoc()));
183187
}
184188

189+
mlir::Value VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *e) {
190+
if (e->getType()->isVoidType())
191+
return {};
192+
193+
return emitNullValue(e->getType(), cgf.getLoc(e->getSourceRange()));
194+
}
195+
185196
mlir::Value VisitCastExpr(CastExpr *e);
186197
mlir::Value VisitCallExpr(const CallExpr *e);
187198

@@ -1966,11 +1977,9 @@ mlir::Value ScalarExprEmitter::VisitInitListExpr(InitListExpr *e) {
19661977
cgf.getLoc(e->getSourceRange()), vectorType, elements);
19671978
}
19681979

1969-
if (numInitElements == 0) {
1970-
cgf.cgm.errorNYI(e->getSourceRange(),
1971-
"InitListExpr Non VectorType with 0 init elements");
1972-
return {};
1973-
}
1980+
// C++11 value-initialization for the scalar.
1981+
if (numInitElements == 0)
1982+
return emitNullValue(e->getType(), cgf.getLoc(e->getExprLoc()));
19741983

19751984
return Visit(e->getInit(0));
19761985
}

0 commit comments

Comments
 (0)