Skip to content

Commit 62e5489

Browse files
authored
Merge branch 'llvm:main' into main
2 parents ee9ece1 + 11ab23c commit 62e5489

File tree

94 files changed

+976
-465
lines changed

Some content is hidden

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

94 files changed

+976
-465
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
HeaderFilterRegex: ''
12
Checks: >
23
-*,
34
clang-diagnostic-*,
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
!world
1+
v1
2+
f world
3+
c 0

clang/test/CodeGen/basic-block-sections.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ int another(int a) {
3030
//
3131
// BB_WORLD: .section .text.world,"ax",@progbits{{$}}
3232
// BB_WORLD: world:
33-
// BB_WORLD: .section .text.world,"ax",@progbits,unique
34-
// BB_WORLD: world.__part.1:
33+
// BB_ALL: .section .text.world,"ax",@progbits,unique
34+
// BB_ALL: world.__part.1:
35+
// BB_LIST: .section .text.split.world,"ax",@progbits
36+
// BB_LIST: world.cold:
3537
// BB_ALL: .section .text.another,"ax",@progbits
3638
// BB_ALL: another.__part.1:
3739
// BB_LIST-NOT: .section .text.another,"ax",@progbits

compiler-rt/lib/scudo/standalone/combined.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ class Allocator {
171171
Primary.Options.set(OptionBit::DeallocTypeMismatch);
172172
if (getFlags()->delete_size_mismatch)
173173
Primary.Options.set(OptionBit::DeleteSizeMismatch);
174-
if (allocatorSupportsMemoryTagging<AllocatorConfig>() &&
175-
systemSupportsMemoryTagging())
174+
if (systemSupportsMemoryTagging())
176175
Primary.Options.set(OptionBit::UseMemoryTagging);
177176

178177
QuarantineMaxChunkSize =

compiler-rt/lib/scudo/standalone/memtag.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ inline bool systemSupportsMemoryTagging() {
6666
#ifndef HWCAP2_MTE
6767
#define HWCAP2_MTE (1 << 18)
6868
#endif
69-
return getauxval(AT_HWCAP2) & HWCAP2_MTE;
69+
static bool SupportsMemoryTagging = getauxval(AT_HWCAP2) & HWCAP2_MTE;
70+
return SupportsMemoryTagging;
7071
}
7172

7273
inline bool systemDetectsMemoryTagFaultsTestOnly() {
@@ -261,9 +262,7 @@ inline uptr loadTag(uptr Ptr) {
261262

262263
#else
263264

264-
inline NORETURN bool systemSupportsMemoryTagging() {
265-
UNREACHABLE("memory tagging not supported");
266-
}
265+
inline bool systemSupportsMemoryTagging() { return false; }
267266

268267
inline NORETURN bool systemDetectsMemoryTagFaultsTestOnly() {
269268
UNREACHABLE("memory tagging not supported");

compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ TEST(MemtagBasicDeathTest, Unsupported) {
2828
EXPECT_DEATH(untagPointer((uptr)0), "not supported");
2929
EXPECT_DEATH(extractTag((uptr)0), "not supported");
3030

31-
EXPECT_DEATH(systemSupportsMemoryTagging(), "not supported");
3231
EXPECT_DEATH(systemDetectsMemoryTagFaultsTestOnly(), "not supported");
3332
EXPECT_DEATH(enableSystemMemoryTaggingTestOnly(), "not supported");
3433

compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
const scudo::uptr PageSize = scudo::getPageSizeCached();
2828

2929
template <typename Config> static scudo::Options getOptionsForConfig() {
30-
if (!Config::getMaySupportMemoryTagging() ||
31-
!scudo::archSupportsMemoryTagging() ||
32-
!scudo::systemSupportsMemoryTagging())
30+
if (!scudo::systemSupportsMemoryTagging())
3331
return {};
3432
scudo::AtomicOptions AO;
3533
AO.set(scudo::OptionBit::UseMemoryTagging);

compiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ TEST_F(ScudoWrappersCppTest, ThreadedNew) {
187187
// TODO: Investigate why libc sometimes crashes with tag missmatch in
188188
// __pthread_clockjoin_ex.
189189
std::unique_ptr<scudo::ScopedDisableMemoryTagChecks> NoTags;
190-
if (!SCUDO_ANDROID && scudo::archSupportsMemoryTagging() &&
191-
scudo::systemSupportsMemoryTagging())
190+
if (!SCUDO_ANDROID && scudo::systemSupportsMemoryTagging())
192191
NoTags = std::make_unique<scudo::ScopedDisableMemoryTagChecks>();
193192

194193
Ready = false;

flang/include/flang/Optimizer/Builder/CUFCommon.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static constexpr llvm::StringRef cudaSharedMemSuffix = "__shared_mem";
1818

1919
namespace fir {
2020
class FirOpBuilder;
21+
class KindMapping;
2122
} // namespace fir
2223

2324
namespace cuf {
@@ -34,6 +35,10 @@ bool isRegisteredDeviceAttr(std::optional<cuf::DataAttribute> attr);
3435

3536
void genPointerSync(const mlir::Value box, fir::FirOpBuilder &builder);
3637

38+
int computeElementByteSize(mlir::Location loc, mlir::Type type,
39+
fir::KindMapping &kindMap,
40+
bool emitErrorOnFailure = true);
41+
3742
} // namespace cuf
3843

3944
#endif // FORTRAN_OPTIMIZER_TRANSFORMS_CUFCOMMON_H_

flang/include/flang/Optimizer/Dialect/FIROps.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ def AnyRefOfConstantSizeAggregateType : TypeConstraint<
8080
// Memory SSA operations
8181
//===----------------------------------------------------------------------===//
8282

83-
def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
84-
MemoryEffects<[MemAlloc<AutomaticAllocationScopeResource>]>]> {
83+
def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments]> {
8584
let summary = "allocate storage for a temporary on the stack given a type";
8685
let description = [{
8786
This primitive operation is used to allocate an object on the stack. A
@@ -162,7 +161,9 @@ def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
162161
Variadic<AnyIntegerType>:$shape
163162
);
164163

165-
let results = (outs fir_ReferenceType);
164+
let results =
165+
(outs Res<fir_ReferenceType,
166+
"", [MemAlloc<AutomaticAllocationScopeResource>]>:$res);
166167

167168
let hasCustomAssemblyFormat = 1;
168169
let hasVerifier = 1;
@@ -212,8 +213,7 @@ def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
212213
}];
213214
}
214215

215-
def fir_AllocMemOp : fir_Op<"allocmem",
216-
[MemoryEffects<[MemAlloc<DefaultResource>]>, AttrSizedOperandSegments]> {
216+
def fir_AllocMemOp : fir_Op<"allocmem", [AttrSizedOperandSegments]> {
217217
let summary = "allocate storage on the heap for an object of a given type";
218218

219219
let description = [{
@@ -235,7 +235,7 @@ def fir_AllocMemOp : fir_Op<"allocmem",
235235
Variadic<AnyIntegerType>:$typeparams,
236236
Variadic<AnyIntegerType>:$shape
237237
);
238-
let results = (outs fir_HeapType);
238+
let results = (outs Res<fir_HeapType, "", [MemAlloc<DefaultResource>]>:$res);
239239

240240
let hasCustomAssemblyFormat = 1;
241241
let hasVerifier = 1;

0 commit comments

Comments
 (0)