Skip to content

Commit 5b69508

Browse files
Updates LLVM usage to match [179d30f8c3fd](llvm/llvm-project@179d30f8c3fd) PiperOrigin-RevId: 748068900
1 parent 9585bea commit 5b69508

File tree

3 files changed

+152
-45
lines changed

3 files changed

+152
-45
lines changed

third_party/llvm/generated.patch

Lines changed: 126 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,132 @@
11
Auto generated patch. Do not edit or delete it, even if empty.
2-
diff -ruN --strip-trailing-cr a/libc/src/__support/FPUtil/aarch64/sqrt.h b/libc/src/__support/FPUtil/aarch64/sqrt.h
3-
--- a/libc/src/__support/FPUtil/aarch64/sqrt.h
4-
+++ b/libc/src/__support/FPUtil/aarch64/sqrt.h
5-
@@ -18,6 +18,8 @@
6-
#error "Invalid include"
7-
#endif
2+
diff -ruN --strip-trailing-cr a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
3+
--- a/clang/lib/Sema/SemaExprCXX.cpp
4+
+++ b/clang/lib/Sema/SemaExprCXX.cpp
5+
@@ -1929,8 +1929,9 @@
6+
}
7+
return true;
8+
}
9+
-
10+
- return S.CheckAllocationAccess(StartLoc, Range, NamingClass, Decl, Diagnose);
11+
+ Sema::AccessResult Accessible =
12+
+ S.CheckAllocationAccess(StartLoc, Range, NamingClass, Decl, Diagnose);
13+
+ return Accessible == Sema::AR_inaccessible;
14+
}
815

9-
+#include "src/__support/FPUtil/generic/sqrt.h"
10-
+
11-
namespace LIBC_NAMESPACE_DECL {
12-
namespace fputil {
13-
14-
diff -ruN --strip-trailing-cr a/libc/src/__support/FPUtil/arm/sqrt.h b/libc/src/__support/FPUtil/arm/sqrt.h
15-
--- a/libc/src/__support/FPUtil/arm/sqrt.h
16-
+++ b/libc/src/__support/FPUtil/arm/sqrt.h
17-
@@ -18,6 +18,8 @@
18-
#error "Invalid include"
19-
#endif
16+
/// Select the correct "usual" deallocation function to use from a selection of
17+
diff -ruN --strip-trailing-cr a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
18+
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
19+
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
20+
@@ -2226,10 +2226,7 @@
21+
E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>());
22+
E->AssociatedDeclAndRef.setInt(CurrentUnpackingBits->getNextBit());
23+
E->Index = CurrentUnpackingBits->getNextBits(/*Width=*/12);
24+
- if (CurrentUnpackingBits->getNextBit())
25+
- E->PackIndex = Record.readInt();
26+
- else
27+
- E->PackIndex = 0;
28+
+ E->PackIndex = Record.readUnsignedOrNone().toInternalRepresentation();
29+
E->Final = CurrentUnpackingBits->getNextBit();
30+
E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
31+
E->Replacement = Record.readSubExpr();
32+
@@ -2239,6 +2236,7 @@
33+
SubstNonTypeTemplateParmPackExpr *E) {
34+
VisitExpr(E);
35+
E->AssociatedDecl = readDeclAs<Decl>();
36+
+ E->Final = CurrentUnpackingBits->getNextBit();
37+
E->Index = Record.readInt();
38+
TemplateArgument ArgPack = Record.readTemplateArgument();
39+
if (ArgPack.getKind() != TemplateArgument::Pack)
40+
diff -ruN --strip-trailing-cr a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
41+
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
42+
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
43+
@@ -2228,9 +2228,7 @@
44+
Record.AddDeclRef(E->getAssociatedDecl());
45+
CurrentPackingBits.addBit(E->isReferenceParameter());
46+
CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12);
47+
- CurrentPackingBits.addBit((bool)E->getPackIndex());
48+
- if (auto PackIndex = E->getPackIndex())
49+
- Record.push_back(*PackIndex + 1);
50+
+ Record.writeUnsignedOrNone(E->getPackIndex());
51+
CurrentPackingBits.addBit(E->getFinal());
2052

21-
+#include "src/__support/FPUtil/generic/sqrt.h"
53+
Record.AddSourceLocation(E->getNameLoc());
54+
@@ -2242,6 +2240,7 @@
55+
SubstNonTypeTemplateParmPackExpr *E) {
56+
VisitExpr(E);
57+
Record.AddDeclRef(E->getAssociatedDecl());
58+
+ CurrentPackingBits.addBit(E->getFinal());
59+
Record.push_back(E->getIndex());
60+
Record.AddTemplateArgument(E->getArgumentPack());
61+
Record.AddSourceLocation(E->getParameterPackLocation());
62+
diff -ruN --strip-trailing-cr a/clang/test/CodeGenCXX/bug135668.cpp b/clang/test/CodeGenCXX/bug135668.cpp
63+
--- a/clang/test/CodeGenCXX/bug135668.cpp
64+
+++ b/clang/test/CodeGenCXX/bug135668.cpp
65+
@@ -0,0 +1,38 @@
66+
+// RUN: %clang_cc1 %s -triple arm64-apple-macosx -emit-llvm -fcxx-exceptions -fexceptions -std=c++23 -o - | FileCheck %s
2267
+
23-
namespace LIBC_NAMESPACE_DECL {
24-
namespace fputil {
25-
26-
diff -ruN --strip-trailing-cr a/libc/src/__support/FPUtil/riscv/sqrt.h b/libc/src/__support/FPUtil/riscv/sqrt.h
27-
--- a/libc/src/__support/FPUtil/riscv/sqrt.h
28-
+++ b/libc/src/__support/FPUtil/riscv/sqrt.h
29-
@@ -18,6 +18,8 @@
30-
#error "Invalid include"
31-
#endif
32-
33-
+#include "src/__support/FPUtil/generic/sqrt.h"
68+
+class TestClass {
69+
+ public:
70+
+ TestClass();
71+
+ int field = 0;
72+
+ friend class Foo;
73+
+ static void * operator new(unsigned long size);
74+
+ private:
75+
+ static void operator delete(void *p);
76+
+ };
3477
+
35-
namespace LIBC_NAMESPACE_DECL {
36-
namespace fputil {
37-
38-
diff -ruN --strip-trailing-cr a/libc/src/__support/FPUtil/x86_64/sqrt.h b/libc/src/__support/FPUtil/x86_64/sqrt.h
39-
--- a/libc/src/__support/FPUtil/x86_64/sqrt.h
40-
+++ b/libc/src/__support/FPUtil/x86_64/sqrt.h
41-
@@ -18,6 +18,8 @@
42-
#error "sqrtss / sqrtsd need SSE2"
43-
#endif
44-
45-
+#include "src/__support/FPUtil/generic/sqrt.h"
78+
+class Foo {
79+
+public:
80+
+ int test_method();
81+
+};
4682
+
47-
namespace LIBC_NAMESPACE_DECL {
48-
namespace fputil {
49-
83+
+int Foo::test_method() {
84+
+ TestClass *obj = new TestClass() ;
85+
+ return obj->field;
86+
+}
87+
+
88+
+// CHECK-LABEL: define noundef i32 @_ZN3Foo11test_methodEv
89+
+// CHECK: [[THIS_ADDR:%.*]] = alloca ptr, align 8
90+
+// CHECK: [[OBJ:%.*]] = alloca ptr, align 8
91+
+// CHECK: store ptr %this, ptr [[THIS_ADDR]], align 8
92+
+// CHECK: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
93+
+// CHECK: [[ALLOCATION:%.*]] = call noundef ptr @_ZN9TestClassnwEm(i64 noundef 4)
94+
+// CHECK: [[INITIALIZEDOBJ:%.*]] = invoke noundef ptr @_ZN9TestClassC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ALLOCATION]])
95+
+// CHECK-NEXT: to label %[[INVOKE_CONT:.*]] unwind label %[[LPAD:.*]]
96+
+// CHECK: [[INVOKE_CONT]]:
97+
+// CHECK: store ptr [[ALLOCATION]], ptr [[OBJ]], align 8
98+
+// CHECK: [[OBJPTR:%.*]] = load ptr, ptr [[OBJ]], align 8
99+
+// CHECK: [[FIELDPTR:%.*]] = getelementptr inbounds nuw %class.TestClass, ptr [[OBJPTR]], i32 0, i32 0
100+
+// CHECK: [[FIELD:%.*]] = load i32, ptr [[FIELDPTR]], align 4
101+
+// CHECK: ret i32 [[FIELD]]
102+
+// CHECK: [[LPAD]]:
103+
+// CHECK: call void @_ZN9TestClassdlEPv(ptr noundef [[ALLOCATION]]) #3
104+
diff -ruN --strip-trailing-cr a/clang/test/SemaCXX/bug135668.cpp b/clang/test/SemaCXX/bug135668.cpp
105+
--- a/clang/test/SemaCXX/bug135668.cpp
106+
+++ b/clang/test/SemaCXX/bug135668.cpp
107+
@@ -0,0 +1,25 @@
108+
+// RUN: %clang_cc1 -triple arm64-apple-macosx -Wall -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions
109+
+// expected-no-diagnostics
110+
+
111+
+// This test makes sure that we don't erroneously consider an accessible operator
112+
+// delete to be inaccessible, and then discard the entire new expression.
113+
+
114+
+class TestClass {
115+
+public:
116+
+ TestClass();
117+
+ int field = 0;
118+
+ friend class Foo;
119+
+ static void * operator new(unsigned long size);
120+
+private:
121+
+ static void operator delete(void *p);
122+
+};
123+
+
124+
+class Foo {
125+
+public:
126+
+ int test_method();
127+
+};
128+
+
129+
+int Foo::test_method() {
130+
+ TestClass *obj = new TestClass() ;
131+
+ return obj->field;
132+
+}

third_party/llvm/workspace.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive")
44

55
def repo(name):
66
"""Imports LLVM."""
7-
LLVM_COMMIT = "98feb05825a179c56f965d936b948a95d2a6b888"
8-
LLVM_SHA256 = "5b8d3c97a0340042380153919fb75fa50669c7266e32ce2cf42f62ad943eddb8"
7+
LLVM_COMMIT = "179d30f8c3fddd3c85056fd2b8e877a4a8513158"
8+
LLVM_SHA256 = "39f33d0ba77ca40d254c767519a0f3f5692c2caa271f413e7245ab63d0787bd5"
99

1010
tf_http_archive(
1111
name = name,

third_party/stablehlo/temporary.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,30 @@ diff --ruN a/stablehlo/BUILD.bazel b/stablehlo/BUILD.bazel
607607
tblgen = "@llvm-project//mlir:mlir-tblgen",
608608
td_file = "stablehlo/dialect/VhloOps.td",
609609
deps = [
610+
diff --ruN a/stablehlo/stablehlo/conversions/tosa/tests/binary.mlir b/stablehlo/stablehlo/conversions/tosa/tests/binary.mlir
611+
--- stablehlo/stablehlo/conversions/tosa/tests/binary.mlir
612+
+++ stablehlo/stablehlo/conversions/tosa/tests/binary.mlir
613+
@@ -45,7 +45,7 @@
614+
615+
// CHECK-LABEL: @divide
616+
func.func @divide(%arg0 : tensor<10xi32>, %arg1 : tensor<10xi32>) -> tensor<10xi32> {
617+
- // CHECK: tosa.int_div
618+
+ // CHECK: tosa.intdiv
619+
%0 = "stablehlo.divide"(%arg0, %arg1) : (tensor<10xi32>, tensor<10xi32>) -> tensor<10xi32>
620+
return %0 : tensor<10xi32>
621+
}
622+
diff --ruN a/stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll b/stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll
623+
--- stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll
624+
+++ stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll
625+
@@ -156,7 +156,7 @@
626+
Pattern =>
627+
replace op<stablehlo.divide>(input0 : Value<_: Tosa_Int32Tensor>,
628+
input1 : Value<_: Tosa_Int32Tensor>)
629+
- with op<tosa.int_div>(input0, input1);
630+
+ with op<tosa.intdiv>(input0, input1);
631+
Pattern =>
632+
replace op<stablehlo.maximum>(input0 : Value<_: Tosa_Tensor>,
633+
input1 : Value<_: Tosa_Tensor>)
610634
diff --ruN a/stablehlo/stablehlo/tests/BUILD.bazel b/stablehlo/stablehlo/tests/BUILD.bazel
611635
--- stablehlo/stablehlo/tests/BUILD.bazel
612636
+++ stablehlo/stablehlo/tests/BUILD.bazel

0 commit comments

Comments
 (0)