Skip to content

Commit 8c213d5

Browse files
authored
Merge branch 'llvm:main' into mra/make-mmiwp-take-mmi-reference
2 parents 42c5c73 + eb70253 commit 8c213d5

File tree

331 files changed

+13101
-2425
lines changed

Some content is hidden

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

331 files changed

+13101
-2425
lines changed

.ci/monolithic-linux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ targets="${2}"
5353
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
5454

5555
echo "--- cmake"
56+
export PIP_BREAK_SYSTEM_PACKAGES=1
5657
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
5758
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
5859
pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ RUN choco install -y handle
108108
109109
RUN pip3 install pywin32 buildbot-worker==2.8.4
110110
111-
ARG RUNNER_VERSION=2.322.0
111+
ARG RUNNER_VERSION=2.323.0
112112
ENV RUNNER_VERSION=$RUNNER_VERSION
113113
114114
RUN powershell -Command \

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ WORKDIR /home/gha
9595

9696
FROM ci-container as ci-container-agent
9797

98-
ENV GITHUB_RUNNER_VERSION=2.322.0
98+
ENV GITHUB_RUNNER_VERSION=2.323.0
9999

100100
RUN mkdir actions-runner && \
101101
cd actions-runner && \

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,20 @@ jobs:
197197
os: macos-15
198198
- config: apple-configuration
199199
os: macos-15
200+
# TODO: These jobs are intended to test back-deployment (building against ToT libc++ but running against an
201+
# older system-provided libc++.dylib). Doing this properly would require building the test suite on a
202+
# recent macOS using a recent Clang (hence recent Xcode), and then running the actual test suite on an
203+
# older mac. We could do that by e.g. sharing artifacts between the two jobs.
204+
#
205+
# However, our Lit configuration currently doesn't provide a good way to do that in a batch, so our only
206+
# alternative is to actually build on the same host that we're going to run on. Sadly, that doesn't work
207+
# since older macOSes don't support newer Xcodes. For now, we run the "backdeployment" jobs on recent
208+
# macOS versions as a way to avoid rotting that configuration, but it doesn't provide a lot of additional
209+
# coverage.
200210
- config: apple-system
201-
os: macos-13
211+
os: macos-15
202212
- config: apple-system-hardened
203-
os: macos-13
213+
os: macos-15
204214
runs-on: ${{ matrix.os }}
205215
steps:
206216
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

clang/include/clang/Basic/DiagnosticIDs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace clang {
3939
DIAG_SIZE_FRONTEND = 200,
4040
DIAG_SIZE_SERIALIZATION = 120,
4141
DIAG_SIZE_LEX = 500,
42-
DIAG_SIZE_PARSE = 700,
42+
DIAG_SIZE_PARSE = 800,
4343
DIAG_SIZE_AST = 300,
4444
DIAG_SIZE_COMMENT = 100,
4545
DIAG_SIZE_CROSSTU = 100,

clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
121121
return cir::BoolAttr::get(getContext(), getBoolTy(), state);
122122
}
123123

124+
mlir::Value createNot(mlir::Value value) {
125+
return create<cir::UnaryOp>(value.getLoc(), value.getType(),
126+
cir::UnaryOpKind::Not, value);
127+
}
128+
124129
/// Create a do-while operation.
125130
cir::DoWhileOp createDoWhile(
126131
mlir::Location loc,
@@ -146,6 +151,16 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
146151
return create<cir::ForOp>(loc, condBuilder, bodyBuilder, stepBuilder);
147152
}
148153

154+
/// Create a break operation.
155+
cir::BreakOp createBreak(mlir::Location loc) {
156+
return create<cir::BreakOp>(loc);
157+
}
158+
159+
/// Create a continue operation.
160+
cir::ContinueOp createContinue(mlir::Location loc) {
161+
return create<cir::ContinueOp>(loc);
162+
}
163+
149164
mlir::TypedAttr getConstPtrAttr(mlir::Type type, int64_t value) {
150165
auto valueAttr = mlir::IntegerAttr::get(
151166
mlir::IntegerType::get(type.getContext(), 64), value);

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -518,20 +518,20 @@ def ConditionOp : CIR_Op<"condition", [
518518
`cir.bool` operand and, depending on its value, may branch to different
519519
regions:
520520

521-
- When in the `cond` region of a `cir.loop`, it continues the loop
521+
- When in the `cond` region of a loop, it continues the loop
522522
if true, or exits it if false.
523523
- When in the `ready` region of a `cir.await`, it branches to the `resume`
524524
region when true, and to the `suspend` region when false.
525525

526526
Example:
527527

528528
```mlir
529-
cir.loop for(cond : {
530-
cir.condition(%arg0) // Branches to `step` region or exits.
531-
}, step : {
532-
[...]
533-
}) {
534-
[...]
529+
cir.for cond {
530+
cir.condition(%val) // Branches to `step` region or exits.
531+
} body {
532+
cir.yield
533+
} step {
534+
cir.yield
535535
}
536536

537537
cir.await(user, ready : {
@@ -610,6 +610,36 @@ def YieldOp : CIR_Op<"yield", [ReturnLike, Terminator,
610610
];
611611
}
612612

613+
//===----------------------------------------------------------------------===//
614+
// BreakOp
615+
//===----------------------------------------------------------------------===//
616+
617+
def BreakOp : CIR_Op<"break", [Terminator]> {
618+
let summary = "C/C++ `break` statement equivalent";
619+
let description = [{
620+
The `cir.break` operation is used to cease the execution of the current loop
621+
or switch operation and transfer control to the parent operation. It is only
622+
allowed within a breakable operations (loops and switches).
623+
}];
624+
let assemblyFormat = "attr-dict";
625+
let hasVerifier = 1;
626+
}
627+
628+
//===----------------------------------------------------------------------===//
629+
// ContinueOp
630+
//===----------------------------------------------------------------------===//
631+
632+
def ContinueOp : CIR_Op<"continue", [Terminator]> {
633+
let summary = "C/C++ `continue` statement equivalent";
634+
let description = [{
635+
The `cir.continue` operation is used to end execution of the current
636+
iteration of a loop and resume execution beginning at the next iteration.
637+
It is only allowed within loop regions.
638+
}];
639+
let assemblyFormat = "attr-dict";
640+
let hasVerifier = 1;
641+
}
642+
613643
//===----------------------------------------------------------------------===//
614644
// ScopeOp
615645
//===----------------------------------------------------------------------===//

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,10 @@ struct MissingFeatures {
122122

123123
// Future CIR operations
124124
static bool awaitOp() { return false; }
125-
static bool breakOp() { return false; }
126125
static bool callOp() { return false; }
127126
static bool complexCreateOp() { return false; }
128127
static bool complexImagOp() { return false; }
129128
static bool complexRealOp() { return false; }
130-
static bool continueOp() { return false; }
131129
static bool ifOp() { return false; }
132130
static bool labelOp() { return false; }
133131
static bool ptrDiffOp() { return false; }

clang/lib/Basic/SourceManager.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,11 @@
2424
#include "llvm/ADT/StringRef.h"
2525
#include "llvm/ADT/StringSwitch.h"
2626
#include "llvm/Support/Allocator.h"
27-
#include "llvm/Support/AutoConvert.h"
2827
#include "llvm/Support/Capacity.h"
2928
#include "llvm/Support/Compiler.h"
3029
#include "llvm/Support/Endian.h"
3130
#include "llvm/Support/ErrorHandling.h"
32-
#include "llvm/Support/FileSystem.h"
33-
#include "llvm/Support/MathExtras.h"
3431
#include "llvm/Support/MemoryBuffer.h"
35-
#include "llvm/Support/Path.h"
3632
#include "llvm/Support/raw_ostream.h"
3733
#include <algorithm>
3834
#include <cassert>

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
488488
return emitUnaryOp(e, cir::UnaryOpKind::Not, op);
489489
}
490490

491+
mlir::Value VisitUnaryLNot(const UnaryOperator *e);
492+
491493
/// Emit a conversion from the specified type to the specified destination
492494
/// type, both of which are CIR scalar types.
493495
/// TODO: do we need ScalarConversionOpts here? Should be done in another
@@ -1315,7 +1317,7 @@ mlir::Value ScalarExprEmitter::VisitCastExpr(CastExpr *ce) {
13151317
"fixed point casts");
13161318
return {};
13171319
}
1318-
cgf.getCIRGenModule().errorNYI(subExpr->getSourceRange(), "fp options");
1320+
assert(!cir::MissingFeatures::cgFPOptionsRAII());
13191321
return emitScalarConversion(Visit(subExpr), subExpr->getType(), destTy,
13201322
ce->getExprLoc());
13211323
}
@@ -1353,6 +1355,33 @@ mlir::Value CIRGenFunction::emitScalarConversion(mlir::Value src,
13531355
.emitScalarConversion(src, srcTy, dstTy, loc);
13541356
}
13551357

1358+
mlir::Value ScalarExprEmitter::VisitUnaryLNot(const UnaryOperator *e) {
1359+
// Perform vector logical not on comparison with zero vector.
1360+
if (e->getType()->isVectorType() &&
1361+
e->getType()->castAs<VectorType>()->getVectorKind() ==
1362+
VectorKind::Generic) {
1363+
assert(!cir::MissingFeatures::vectorType());
1364+
cgf.cgm.errorNYI(e->getSourceRange(), "vector logical not");
1365+
return {};
1366+
}
1367+
1368+
// Compare operand to zero.
1369+
mlir::Value boolVal = cgf.evaluateExprAsBool(e->getSubExpr());
1370+
1371+
// Invert value.
1372+
boolVal = builder.createNot(boolVal);
1373+
1374+
// ZExt result to the expr type.
1375+
mlir::Type dstTy = cgf.convertType(e->getType());
1376+
if (mlir::isa<cir::IntType>(dstTy))
1377+
return builder.createBoolToInt(boolVal, dstTy);
1378+
if (mlir::isa<cir::BoolType>(dstTy))
1379+
return boolVal;
1380+
1381+
cgf.cgm.errorNYI("destination type for logical-not unary operator is NYI");
1382+
return {};
1383+
}
1384+
13561385
/// Return the size or alignment of the type of argument of the sizeof
13571386
/// expression as an integer.
13581387
mlir::Value ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr(

0 commit comments

Comments
 (0)