Skip to content

Commit 6f42d31

Browse files
committed
Merge branch 'users/meinersbur/flang_runtime' into users/meinersbur/flang_runtime_shared
2 parents c87b596 + faf5ddc commit 6f42d31

File tree

209 files changed

+10471
-6176
lines changed

Some content is hidden

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

209 files changed

+10471
-6176
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ Improvements to Clang's diagnostics
127127
- The ``-Wunique-object-duplication`` warning has been added to warn about objects
128128
which are supposed to only exist once per program, but may get duplicated when
129129
built into a shared library.
130+
- Fixed a bug where Clang's Analysis did not correctly model the destructor behavior of ``union`` members (#GH119415).
130131

131132
Improvements to Clang's time-trace
132133
----------------------------------

clang/include/clang/AST/OperationKinds.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,6 @@ CAST_OPERATION(HLSLVectorTruncation)
367367
// Non-decaying array RValue cast (HLSL only).
368368
CAST_OPERATION(HLSLArrayRValue)
369369

370-
// Aggregate by Value cast (HLSL only).
371-
CAST_OPERATION(HLSLElementwiseCast)
372-
373370
//===- Binary Operations -------------------------------------------------===//
374371
// Operators listed in order of precedence.
375372
// Note that additions to this should also update the StmtVisitor class,

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ CODEGENOPT(TimePassesPerRun , 1, 0) ///< Set when -ftime-report=per-pass-run is
320320
CODEGENOPT(TimeTrace , 1, 0) ///< Set when -ftime-trace is enabled.
321321
VALUE_CODEGENOPT(TimeTraceGranularity, 32, 500) ///< Minimum time granularity (in microseconds),
322322
///< traced by time profiler
323+
CODEGENOPT(InterchangeLoops , 1, 0) ///< Run loop-interchange.
323324
CODEGENOPT(UnrollLoops , 1, 0) ///< Control whether loops are unrolled.
324325
CODEGENOPT(RerollLoops , 1, 0) ///< Control whether loops are rerolled.
325326
CODEGENOPT(NoUseJumpTables , 1, 0) ///< Set when -fno-jump-tables is enabled.

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4069,6 +4069,10 @@ def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group<f_Group>,
40694069
Visibility<[ClangOption, CC1Option]>,
40704070
HelpText<"Issue call to specified function rather than a trap instruction">,
40714071
MarshallingInfoString<CodeGenOpts<"TrapFuncName">>;
4072+
def floop_interchange : Flag<["-"], "floop-interchange">, Group<f_Group>,
4073+
HelpText<"Enable the loop interchange pass">, Visibility<[ClangOption, CC1Option]>;
4074+
def fno_loop_interchange: Flag<["-"], "fno-loop-interchange">, Group<f_Group>,
4075+
HelpText<"Disable the loop interchange pass">, Visibility<[ClangOption, CC1Option]>;
40724076
def funroll_loops : Flag<["-"], "funroll-loops">, Group<f_Group>,
40734077
HelpText<"Turn on loop unroller">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
40744078
def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group<f_Group>,

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ class SemaHLSL : public SemaBase {
141141
// Diagnose whether the input ID is uint/unit2/uint3 type.
142142
bool diagnoseInputIDType(QualType T, const ParsedAttr &AL);
143143

144-
bool CanPerformScalarCast(QualType SrcTy, QualType DestTy);
145-
bool ContainsBitField(QualType BaseTy);
146-
bool CanPerformElementwiseCast(Expr *Src, QualType DestType);
147144
ExprResult ActOnOutParamExpr(ParmVarDecl *Param, Expr *Arg);
148145

149146
QualType getInoutParameterType(QualType Ty);

clang/lib/AST/Expr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,6 @@ bool CastExpr::CastConsistency() const {
19561956
case CK_FixedPointToBoolean:
19571957
case CK_HLSLArrayRValue:
19581958
case CK_HLSLVectorTruncation:
1959-
case CK_HLSLElementwiseCast:
19601959
CheckNoBasePath:
19611960
assert(path_empty() && "Cast kind should not have a base path!");
19621961
break;

clang/lib/AST/ExprConstant.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15047,7 +15047,6 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
1504715047
case CK_NoOp:
1504815048
case CK_LValueToRValueBitCast:
1504915049
case CK_HLSLArrayRValue:
15050-
case CK_HLSLElementwiseCast:
1505115050
return ExprEvaluatorBaseTy::VisitCastExpr(E);
1505215051

1505315052
case CK_MemberPointerToBoolean:
@@ -15906,7 +15905,6 @@ bool ComplexExprEvaluator::VisitCastExpr(const CastExpr *E) {
1590615905
case CK_IntegralToFixedPoint:
1590715906
case CK_MatrixCast:
1590815907
case CK_HLSLVectorTruncation:
15909-
case CK_HLSLElementwiseCast:
1591015908
llvm_unreachable("invalid cast kind for complex value");
1591115909

1591215910
case CK_LValueToRValue:

clang/lib/Analysis/CFG.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,6 +2041,8 @@ void CFGBuilder::addImplicitDtorsForDestructor(const CXXDestructorDecl *DD) {
20412041
}
20422042

20432043
// First destroy member objects.
2044+
if (RD->isUnion())
2045+
return;
20442046
for (auto *FI : RD->fields()) {
20452047
// Check for constant size array. Set type to array element type.
20462048
QualType QT = FI->getType();

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
890890

891891
PipelineTuningOptions PTO;
892892
PTO.LoopUnrolling = CodeGenOpts.UnrollLoops;
893+
PTO.LoopInterchange = CodeGenOpts.InterchangeLoops;
893894
// For historical reasons, loop interleaving is set to mirror setting for loop
894895
// unrolling.
895896
PTO.LoopInterleaving = CodeGenOpts.UnrollLoops;
@@ -1314,6 +1315,7 @@ runThinLTOBackend(CompilerInstance &CI, ModuleSummaryIndex *CombinedIndex,
13141315
initTargetOptions(CI, Diags, Conf.Options);
13151316
Conf.SampleProfile = std::move(SampleProfile);
13161317
Conf.PTO.LoopUnrolling = CGOpts.UnrollLoops;
1318+
Conf.PTO.LoopInterchange = CGOpts.InterchangeLoops;
13171319
// For historical reasons, loop interleaving is set to mirror setting for loop
13181320
// unrolling.
13191321
Conf.PTO.LoopInterleaving = CGOpts.UnrollLoops;

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3567,6 +3567,10 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const EnumType *Ty) {
35673567
DBuilder.createEnumerator(Enum->getName(), Enum->getInitVal()));
35683568
}
35693569

3570+
std::optional<EnumExtensibilityAttr::Kind> EnumKind;
3571+
if (auto *Attr = ED->getAttr<EnumExtensibilityAttr>())
3572+
EnumKind = Attr->getExtensibility();
3573+
35703574
// Return a CompositeType for the enum itself.
35713575
llvm::DINodeArray EltArray = DBuilder.getOrCreateArray(Enumerators);
35723576

@@ -3576,7 +3580,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const EnumType *Ty) {
35763580
llvm::DIType *ClassTy = getOrCreateType(ED->getIntegerType(), DefUnit);
35773581
return DBuilder.createEnumerationType(
35783582
EnumContext, ED->getName(), DefUnit, Line, Size, Align, EltArray, ClassTy,
3579-
/*RunTimeLang=*/0, Identifier, ED->isScoped());
3583+
/*RunTimeLang=*/0, Identifier, ED->isScoped(), EnumKind);
35803584
}
35813585

35823586
llvm::DIMacro *CGDebugInfo::CreateMacro(llvm::DIMacroFile *Parent,

0 commit comments

Comments
 (0)