Skip to content

Commit 4a21bf4

Browse files
committed
Revert "merge main into amd-staging (llvm#684)"
This reverts commit 6185b02.
1 parent 6185b02 commit 4a21bf4

File tree

10 files changed

+13
-134
lines changed

10 files changed

+13
-134
lines changed

libc/include/__llvm-libc-common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef _LLVM_LIBC_COMMON_H
10-
#define _LLVM_LIBC_COMMON_H
9+
#ifndef LLVM_LIBC_COMMON_H
10+
#define LLVM_LIBC_COMMON_H
1111

1212
#define __LLVM_LIBC__ 1
1313

@@ -87,4 +87,4 @@
8787

8888
#endif // __cplusplus
8989

90-
#endif // _LLVM_LIBC_COMMON_H
90+
#endif // LLVM_LIBC_COMMON_H

libc/include/malloc.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,10 @@ macros:
99
- macro_name: M_PURGE_ALL
1010
macro_header: malloc-macros.h
1111
functions:
12-
- name: malloc_usable_size
13-
standards:
14-
- gnu
15-
return_type: size_t
16-
arguments:
17-
- type: void *
1812
- name: mallopt
1913
standards:
2014
- gnu
2115
return_type: int
2216
arguments:
2317
- type: int
2418
- type: int
25-
- name: pvalloc
26-
standards:
27-
- bsd
28-
- gnu
29-
return_type: void *
30-
arguments:
31-
- type: size_t

libc/include/stdlib-malloc.yaml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
# This file has declarations that appear both in <stdlib.h> and in <malloc.h>.
2-
# These include the subset of GNU extensions that Scudo supports.
3-
#
4-
# Note: glibc's <stdlib.h> and <malloc.h> both also have `reallocarray`,
5-
# which Scudo does not support and is omitted here. (Each of those glibc
6-
# headers also has related functions the other lacks, but those should be
7-
# covered separately in stdlib.yaml and malloc.yaml instead.)
82

93
functions:
104
- name: aligned_alloc
@@ -33,31 +27,18 @@ functions:
3327
return_type: void *
3428
arguments:
3529
- type: size_t
36-
- name: memalign
37-
standards:
38-
- gnu
39-
return_type: void *
40-
arguments:
41-
- type: size_t
42-
- type: size_t
4330
- name: realloc
4431
standards:
4532
- stdc
4633
return_type: void *
4734
arguments:
4835
- type: void *
4936
- type: size_t
37+
5038
# Note: glibc's <stdlib.h> and <malloc.h> both have these, which are
5139
# currently missing here:
5240
# - name: reallocarray
5341
# - name: memalign
5442
# - name: valloc
5543
# Each of those glibc headers also has related functions the other lacks.
5644
# Only the common subset is mentioned here for future consideration.
57-
- name: valloc
58-
standards:
59-
- bsd
60-
- gnu
61-
return_type: void *
62-
arguments:
63-
- type: size_t

libc/include/stdlib.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,6 @@ functions:
127127
arguments:
128128
- type: long long
129129
- type: long long
130-
- name: posix_memalign
131-
standards:
132-
- posix
133-
return_type: int
134-
arguments:
135-
- type: void **
136-
- type: size_t
137-
- type: size_t
138130
- name: qsort
139131
standards:
140132
- stdc

libc/utils/hdrgen/header.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def includes(self):
124124
}
125125

126126
def header_guard(self):
127-
return "_LLVM_LIBC_" + "_".join(
127+
return "LLVM_LIBC_" + "_".join(
128128
word.upper() for word in NONIDENTIFIER.split(self.name) if word
129129
)
130130

libc/utils/hdrgen/tests/expected_output/subdir/test.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===---------------------------------------------------------------------===//
88

9-
#ifndef _LLVM_LIBC_SUBDIR_TEST_H
10-
#define _LLVM_LIBC_SUBDIR_TEST_H
9+
#ifndef LLVM_LIBC_SUBDIR_TEST_H
10+
#define LLVM_LIBC_SUBDIR_TEST_H
1111

1212
#include "../__llvm-libc-common.h"
1313
#include "../llvm-libc-types/type_a.h"
@@ -23,4 +23,4 @@ int *ptrfunc(void) __NOEXCEPT;
2323

2424
__END_C_DECLS
2525

26-
#endif // _LLVM_LIBC_SUBDIR_TEST_H
26+
#endif // LLVM_LIBC_SUBDIR_TEST_H

libcxx/src/iostream.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
1818

1919
template <class StreamT, class BufferT>
2020
union stream_data {
21-
constexpr stream_data() {}
22-
constexpr ~stream_data() {}
21+
stream_data() {}
22+
~stream_data() {}
2323
struct {
2424
// The stream has to be the first element, since that's referenced by the stream declarations in <iostream>
2525
StreamT stream;
@@ -38,19 +38,13 @@ union stream_data {
3838
#define CHAR_MANGLING_wchar_t "_W"
3939
#define CHAR_MANGLING(CharT) CHAR_MANGLING_##CharT
4040

41-
#ifdef _LIBCPP_COMPILER_CLANG_BASED
42-
# define STRING_DATA_CONSTINIT constinit
43-
#else
44-
# define STRING_DATA_CONSTINIT
45-
#endif
46-
4741
#ifdef _LIBCPP_ABI_MICROSOFT
4842
# define STREAM(StreamT, BufferT, CharT, var) \
49-
STRING_DATA_CONSTINIT stream_data<StreamT<CharT>, BufferT<CharT>> var __asm__( \
43+
stream_data<StreamT<CharT>, BufferT<CharT>> var __asm__( \
5044
"?" #var "@" ABI_NAMESPACE_STR "@std@@3V?$" #StreamT \
5145
"@" CHAR_MANGLING(CharT) "U?$char_traits@" CHAR_MANGLING(CharT) "@" ABI_NAMESPACE_STR "@std@@@12@A")
5246
#else
53-
# define STREAM(StreamT, BufferT, CharT, var) STRING_DATA_CONSTINIT stream_data<StreamT<CharT>, BufferT<CharT>> var
47+
# define STREAM(StreamT, BufferT, CharT, var) stream_data<StreamT<CharT>, BufferT<CharT>> var
5448
#endif
5549

5650
// These definitions and the declarations in <iostream> technically cause ODR violations, since they have different

libcxx/test/std/input.output/iostreams.base/ios.base/ios.types/ios_Init/ios_Init.global.pass.cpp

Lines changed: 0 additions & 20 deletions
This file was deleted.

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ class DGNode {
117117
virtual ~DGNode();
118118
/// \Returns the number of unscheduled successors.
119119
unsigned getNumUnscheduledSuccs() const { return UnscheduledSuccs; }
120-
// TODO: Make this private?
121120
void decrUnscheduledSuccs() {
122121
assert(UnscheduledSuccs > 0 && "Counting error!");
123122
--UnscheduledSuccs;
@@ -215,8 +214,6 @@ class MemDGNode final : public DGNode {
215214
MemDGNode *NextMemN = nullptr;
216215
/// Memory predecessors.
217216
DenseSet<MemDGNode *> MemPreds;
218-
/// Memory successors.
219-
DenseSet<MemDGNode *> MemSuccs;
220217
friend class PredIterator; // For MemPreds.
221218
/// Creates both edges: this<->N.
222219
void setNextNode(MemDGNode *N) {
@@ -268,20 +265,10 @@ class MemDGNode final : public DGNode {
268265
[[maybe_unused]] auto Inserted = MemPreds.insert(PredN).second;
269266
assert(Inserted && "PredN already exists!");
270267
assert(PredN != this && "Trying to add a dependency to self!");
271-
PredN->MemSuccs.insert(this);
272268
if (!Scheduled) {
273269
++PredN->UnscheduledSuccs;
274270
}
275271
}
276-
/// Removes the memory dependency PredN->this. This also updates the
277-
/// UnscheduledSuccs counter of PredN if this node has not been scheduled.
278-
void removeMemPred(MemDGNode *PredN) {
279-
MemPreds.erase(PredN);
280-
PredN->MemSuccs.erase(this);
281-
if (!Scheduled) {
282-
PredN->decrUnscheduledSuccs();
283-
}
284-
}
285272
/// \Returns true if there is a memory dependency N->this.
286273
bool hasMemPred(DGNode *N) const {
287274
if (auto *MN = dyn_cast<MemDGNode>(N))
@@ -292,10 +279,6 @@ class MemDGNode final : public DGNode {
292279
iterator_range<DenseSet<MemDGNode *>::const_iterator> memPreds() const {
293280
return make_range(MemPreds.begin(), MemPreds.end());
294281
}
295-
/// \Returns all memory dependency successors.
296-
iterator_range<DenseSet<MemDGNode *>::const_iterator> memSuccs() const {
297-
return make_range(MemSuccs.begin(), MemSuccs.end());
298-
}
299282
#ifndef NDEBUG
300283
virtual void print(raw_ostream &OS, bool PrintDeps = true) const override;
301284
#endif // NDEBUG

llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,6 @@ define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
250250
EXPECT_THAT(N1->memPreds(), testing::ElementsAre(N0));
251251
EXPECT_TRUE(N2->preds(DAG).empty());
252252

253-
// Check memSuccs().
254-
EXPECT_THAT(N0->memSuccs(), testing::ElementsAre(N1));
255-
256253
// Check UnscheduledSuccs.
257254
EXPECT_EQ(N0->getNumUnscheduledSuccs(), 1u); // N1
258255
EXPECT_EQ(N1->getNumUnscheduledSuccs(), 0u);
@@ -271,41 +268,6 @@ define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
271268
EXPECT_TRUE(N0->scheduled());
272269
}
273270

274-
TEST_F(DependencyGraphTest, AddRemoveMemPred) {
275-
parseIR(C, R"IR(
276-
define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
277-
store i8 %v0, ptr %ptr
278-
store i8 %v1, ptr %ptr
279-
ret void
280-
}
281-
)IR");
282-
llvm::Function *LLVMF = &*M->getFunction("foo");
283-
sandboxir::Context Ctx(C);
284-
auto *F = Ctx.createFunction(LLVMF);
285-
auto *BB = &*F->begin();
286-
auto It = BB->begin();
287-
auto *S0 = cast<sandboxir::StoreInst>(&*It++);
288-
auto *S1 = cast<sandboxir::StoreInst>(&*It++);
289-
290-
sandboxir::DependencyGraph DAG(getAA(*LLVMF), Ctx);
291-
DAG.extend({&*BB->begin(), BB->getTerminator()});
292-
auto *N0 = cast<sandboxir::MemDGNode>(DAG.getNode(S0));
293-
auto *N1 = cast<sandboxir::MemDGNode>(DAG.getNode(S1));
294-
295-
// Check removeMemPred().
296-
EXPECT_FALSE(N0->memSuccs().empty());
297-
EXPECT_EQ(N0->getNumUnscheduledSuccs(), 1u);
298-
N1->removeMemPred(N0);
299-
EXPECT_TRUE(N1->memPreds().empty());
300-
EXPECT_EQ(N0->getNumUnscheduledSuccs(), 0u);
301-
302-
// Check addMemPred().
303-
N1->addMemPred(N0);
304-
EXPECT_THAT(N1->memPreds(), testing::UnorderedElementsAre(N0));
305-
EXPECT_THAT(N0->memSuccs(), testing::UnorderedElementsAre(N1));
306-
EXPECT_THAT(N0->getNumUnscheduledSuccs(), 1u);
307-
}
308-
309271
TEST_F(DependencyGraphTest, Preds) {
310272
parseIR(C, R"IR(
311273
declare ptr @bar(i8)
@@ -571,7 +533,7 @@ define void @foo(ptr noalias %ptr0, ptr noalias %ptr1) {
571533
EXPECT_TRUE(RetN->preds(DAG).empty());
572534
}
573535

574-
TEST_F(DependencyGraphTest, VolatileStores) {
536+
TEST_F(DependencyGraphTest, VolatileSotres) {
575537
parseIR(C, R"IR(
576538
define void @foo(ptr noalias %ptr0, ptr noalias %ptr1, i8 %v) {
577539
store volatile i8 %v, ptr %ptr0

0 commit comments

Comments
 (0)