Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 58cb02d

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:814db6c53fae into amd-gfx:1cc8749516de
Local branch amd-gfx 1cc8749 Update test vec-load-combine.ll Remote branch main 814db6c [CodeGen][NewPM] Port GCNPreRALongBranchReg to NPM. (llvm#125844)
2 parents 1cc8749 + 814db6c commit 58cb02d

File tree

312 files changed

+8953
-3146
lines changed

Some content is hidden

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

312 files changed

+8953
-3146
lines changed

clang/include/clang/Basic/TargetInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,7 @@ class TargetInfo : public TransferrableTargetInfo,
14711471
/// specification
14721472
virtual bool validateBranchProtection(StringRef Spec, StringRef Arch,
14731473
BranchProtectionInfo &BPI,
1474+
const LangOptions &LO,
14741475
StringRef &Err) const {
14751476
Err = "";
14761477
return false;

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6876,6 +6876,7 @@ defm backslash : OptInFC1FFlag<"backslash", "Specify that backslash in string in
68766876
defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of .NEQV.">;
68776877
defm logical_abbreviations : OptInFC1FFlag<"logical-abbreviations", "Enable logical abbreviations">;
68786878
defm implicit_none : OptInFC1FFlag<"implicit-none", "No implicit typing allowed unless overridden by IMPLICIT statements">;
6879+
defm implicit_none_ext : OptInFC1FFlag<"implicit-none-ext", "No implicit externals allowed">;
68796880
defm underscoring : OptInFC1FFlag<"underscoring", "Appends one trailing underscore to external names">;
68806881
defm ppc_native_vec_elem_order: BoolOptionWithoutMarshalling<"f", "ppc-native-vector-element-order",
68816882
PosFlag<SetTrue, [], [ClangOption], "Specifies PowerPC native vector element order (default)">,

clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ enum class ScanningOptimizations {
5555
HeaderSearch = 1,
5656

5757
/// Remove warnings from system modules.
58-
SystemWarnings = 2,
58+
SystemWarnings = (1 << 1),
5959

6060
/// Remove unused -ivfsoverlay arguments.
61-
VFS = 4,
61+
VFS = (1 << 2),
6262

6363
/// Canonicalize -D and -U options.
64-
Macros = 8,
64+
Macros = (1 << 3),
6565

66-
DSS_LAST_BITMASK_ENUM(Macros),
66+
/// Ignore the compiler's working directory if it is safe.
67+
IgnoreCWD = (1 << 4),
68+
69+
DSS_LAST_BITMASK_ENUM(IgnoreCWD),
6770
Default = All
6871
};
6972

clang/lib/AST/ASTContext.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,8 @@ void ASTContext::PrintStats() const {
10551055
void ASTContext::mergeDefinitionIntoModule(NamedDecl *ND, Module *M,
10561056
bool NotifyListeners) {
10571057
if (NotifyListeners)
1058-
if (auto *Listener = getASTMutationListener())
1058+
if (auto *Listener = getASTMutationListener();
1059+
Listener && !ND->isUnconditionallyVisible())
10591060
Listener->RedefinedHiddenDefinition(ND, M);
10601061

10611062
MergedDefModules[cast<NamedDecl>(ND->getCanonicalDecl())].push_back(M);

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4715,6 +4715,14 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
47154715
} else if (!this->visit(MC->getImplicitObjectArgument())) {
47164716
return false;
47174717
}
4718+
} else if (const auto *PD =
4719+
dyn_cast<CXXPseudoDestructorExpr>(E->getCallee())) {
4720+
const Expr *Base = PD->getBase();
4721+
if (!Base->isGLValue())
4722+
return this->discard(Base);
4723+
if (!this->visit(Base))
4724+
return false;
4725+
return this->emitKill(E);
47184726
} else if (!FuncDecl) {
47194727
const Expr *Callee = E->getCallee();
47204728
CalleeOffset = this->allocateLocalPrimitive(Callee, PT_FnPtr, true, false);

clang/lib/AST/ByteCode/Descriptor.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ struct alignas(void *) GlobalInlineDescriptor {
6161
};
6262
static_assert(sizeof(GlobalInlineDescriptor) == sizeof(void *), "");
6363

64+
enum class Lifetime : uint8_t {
65+
Started,
66+
Ended,
67+
};
68+
6469
/// Inline descriptor embedded in structures and arrays.
6570
///
6671
/// Such descriptors precede all composite array elements and structure fields.
@@ -100,12 +105,14 @@ struct InlineDescriptor {
100105
LLVM_PREFERRED_TYPE(bool)
101106
unsigned IsArrayElement : 1;
102107

108+
Lifetime LifeState;
109+
103110
const Descriptor *Desc;
104111

105112
InlineDescriptor(const Descriptor *D)
106113
: Offset(sizeof(InlineDescriptor)), IsConst(false), IsInitialized(false),
107114
IsBase(false), IsActive(false), IsFieldMutable(false),
108-
IsArrayElement(false), Desc(D) {}
115+
IsArrayElement(false), LifeState(Lifetime::Started), Desc(D) {}
109116

110117
void dump() const { dump(llvm::errs()); }
111118
void dump(llvm::raw_ostream &OS) const;

clang/lib/AST/ByteCode/Disasm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ LLVM_DUMP_METHOD void Descriptor::dump(llvm::raw_ostream &OS) const {
240240
else if (isRecord())
241241
OS << " record";
242242
else if (isPrimitive())
243-
OS << " primitive";
243+
OS << " primitive " << primTypeToString(getPrimType());
244244

245245
if (isZeroSizeArray())
246246
OS << " zero-size-array";

clang/lib/AST/ByteCode/Function.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ class Scope final {
5151
return llvm::make_range(Descriptors.begin(), Descriptors.end());
5252
}
5353

54+
llvm::iterator_range<LocalVectorTy::const_reverse_iterator>
55+
locals_reverse() const {
56+
return llvm::reverse(Descriptors);
57+
}
58+
5459
private:
5560
/// Object descriptors in this block.
5661
LocalVectorTy Descriptors;

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
561561
return false;
562562
}
563563

564+
static bool CheckLifetime(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
565+
AccessKinds AK) {
566+
if (Ptr.getLifetime() == Lifetime::Started)
567+
return true;
568+
569+
if (!S.checkingPotentialConstantExpression()) {
570+
S.FFDiag(S.Current->getSource(OpPC), diag::note_constexpr_access_uninit)
571+
<< AK << /*uninitialized=*/false << S.Current->getRange(OpPC);
572+
}
573+
return false;
574+
}
575+
564576
bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
565577
if (Ptr.isInitialized())
566578
return true;
@@ -605,6 +617,8 @@ bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
605617
return false;
606618
if (!CheckActive(S, OpPC, Ptr, AK))
607619
return false;
620+
if (!CheckLifetime(S, OpPC, Ptr, AK))
621+
return false;
608622
if (!CheckInitialized(S, OpPC, Ptr, AK))
609623
return false;
610624
if (!CheckTemporary(S, OpPC, Ptr, AK))
@@ -634,6 +648,8 @@ bool CheckFinalLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
634648
return false;
635649
if (!CheckActive(S, OpPC, Ptr, AK_Read))
636650
return false;
651+
if (!CheckLifetime(S, OpPC, Ptr, AK_Read))
652+
return false;
637653
if (!CheckInitialized(S, OpPC, Ptr, AK_Read))
638654
return false;
639655
if (!CheckTemporary(S, OpPC, Ptr, AK_Read))
@@ -650,6 +666,8 @@ bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
650666
return false;
651667
if (!CheckDummy(S, OpPC, Ptr, AK_Assign))
652668
return false;
669+
if (!CheckLifetime(S, OpPC, Ptr, AK_Assign))
670+
return false;
653671
if (!CheckExtern(S, OpPC, Ptr))
654672
return false;
655673
if (!CheckRange(S, OpPC, Ptr, AK_Assign))

clang/lib/AST/ByteCode/Interp.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,12 @@ bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
12541254
return true;
12551255
}
12561256

1257+
static inline bool Kill(InterpState &S, CodePtr OpPC) {
1258+
const auto &Ptr = S.Stk.pop<Pointer>();
1259+
Ptr.endLifetime();
1260+
return true;
1261+
}
1262+
12571263
/// 1) Pops the value from the stack.
12581264
/// 2) Writes the value to the local variable with the
12591265
/// given offset.

0 commit comments

Comments
 (0)