Skip to content

Commit 9f17858

Browse files
authored
Merge branch 'main' into scev-match-undef-poison
2 parents 7742c15 + d5551e1 commit 9f17858

File tree

384 files changed

+15066
-4187
lines changed

Some content is hidden

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

384 files changed

+15066
-4187
lines changed

.ci/generate_test_report_lib.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ def _parse_ninja_log(ninja_log: list[str]) -> list[tuple[str, str]]:
6262
# aligned with the failure.
6363
failing_action = ninja_log[index].split("FAILED: ")[1]
6464
failure_log = []
65+
66+
# Parse the lines above the FAILED: string if the line does not come
67+
# immediately after a progress indicator to ensure that we capture the
68+
# entire failure message.
69+
if not ninja_log[index - 1].startswith("["):
70+
before_index = index - 1
71+
while before_index > 0 and not ninja_log[before_index].startswith("["):
72+
failure_log.append(ninja_log[before_index])
73+
before_index = before_index - 1
74+
failure_log.reverse()
75+
76+
# Parse the failure information, which comes after the FAILED: tag.
6577
while (
6678
index < len(ninja_log)
6779
and not ninja_log[index].startswith("[")

.ci/generate_test_report_lib_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def test_ninja_log_mismatched_failed(self):
181181
"tools/check-langley",
182182
dedent(
183183
"""\
184+
ModuleNotFoundError: No module named 'mount_langley'
184185
FAILED: tools/check-langley
185186
Wow! This system is really broken!"""
186187
),

.github/CODEOWNERS

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
/mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp @MaheshRavishankar @nicolasvasilache
9494
/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp @dcaballe @MaheshRavishankar @nicolasvasilache
9595
/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp @MaheshRavishankar @nicolasvasilache
96-
/mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp @hanhanW @nicolasvasilache
97-
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @dcaballe @hanhanW @nicolasvasilache
98-
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @hanhanW @nicolasvasilache @Groverkss
96+
/mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp @nicolasvasilache
97+
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @dcaballe @nicolasvasilache
98+
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @nicolasvasilache @Groverkss
9999

100100
# MemRef Dialect in MLIR.
101101
/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp @MaheshRavishankar @nicolasvasilache
@@ -112,16 +112,16 @@
112112
/mlir/include/mlir/Dialect/Vector @banach-space @dcaballe @nicolasvasilache @Groverkss
113113
/mlir/include/mlir/Dialect/Vector/IR @kuhar
114114
/mlir/lib/Dialect/Vector @banach-space @dcaballe @nicolasvasilache @Groverkss
115-
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @hanhanW @nicolasvasilache
115+
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @nicolasvasilache
116116
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @banach-space @dcaballe @MaheshRavishankar @nicolasvasilache
117-
/mlir/**/*EmulateNarrowType* @dcaballe @hanhanW
117+
/mlir/**/*EmulateNarrowType* @dcaballe
118118

119119
# Presburger library in MLIR
120120
/mlir/**/*Presburger* @Groverkss @Superty
121121

122122
# Tensor Dialect in MLIR.
123-
/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp @hanhanW @nicolasvasilache
124-
/mlir/lib/Dialect/Tensor/Transforms/* @hanhanW @nicolasvasilache
123+
/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp @nicolasvasilache
124+
/mlir/lib/Dialect/Tensor/Transforms/* @nicolasvasilache
125125

126126
# Transform Dialect in MLIR.
127127
/mlir/include/mlir/Dialect/Transform/* @ftynse @nicolasvasilache @rolfmorel

.github/workflows/premerge.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ jobs:
6363
fetch-depth: 2
6464
- name: Build and Test
6565
timeout-minutes: 120
66-
continue-on-error: ${{ runner.arch == 'ARM64' }}
6766
env:
6867
GITHUB_TOKEN: ${{ github.token }}
6968
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,9 +1408,7 @@ Error BinaryFunction::disassemble() {
14081408
// A recursive call. Calls to internal blocks are handled by
14091409
// ValidateInternalCalls pass.
14101410
TargetSymbol = getSymbol();
1411-
}
1412-
1413-
if (!TargetSymbol) {
1411+
} else {
14141412
// Create either local label or external symbol.
14151413
if (containsAddress(TargetAddress)) {
14161414
TargetSymbol = getOrCreateLocalLabel(TargetAddress);

clang-tools-extra/clang-doc/BitcodeReader.cpp

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88

99
#include "BitcodeReader.h"
1010
#include "llvm/Support/Error.h"
11+
#include "llvm/Support/ErrorHandling.h"
1112
#include "llvm/Support/TimeProfiler.h"
1213
#include "llvm/Support/raw_ostream.h"
1314
#include <optional>
1415

1516
namespace clang {
1617
namespace doc {
1718

19+
static llvm::ExitOnError ExitOnErr("clang-doc error: ");
20+
1821
using Record = llvm::SmallVector<uint64_t, 1024>;
1922

2023
// This implements decode for SmallString.
@@ -716,8 +719,8 @@ llvm::Error addReference(FriendInfo *Friend, Reference &&R, FieldId F) {
716719

717720
template <typename T, typename ChildInfoType>
718721
static void addChild(T I, ChildInfoType &&R) {
719-
llvm::errs() << "invalid child type for info";
720-
exit(1);
722+
ExitOnErr(llvm::createStringError(llvm::inconvertibleErrorCode(),
723+
"invalid child type for info"));
721724
}
722725

723726
// Namespace children:
@@ -766,8 +769,9 @@ template <> void addChild(BaseRecordInfo *I, FunctionInfo &&R) {
766769
// parameters) or TemplateSpecializationInfo (for the specialization's
767770
// parameters).
768771
template <typename T> static void addTemplateParam(T I, TemplateParamInfo &&P) {
769-
llvm::errs() << "invalid container for template parameter";
770-
exit(1);
772+
ExitOnErr(
773+
llvm::createStringError(llvm::inconvertibleErrorCode(),
774+
"invalid container for template parameter"));
771775
}
772776
template <> void addTemplateParam(TemplateInfo *I, TemplateParamInfo &&P) {
773777
I->Params.emplace_back(std::move(P));
@@ -779,8 +783,8 @@ void addTemplateParam(TemplateSpecializationInfo *I, TemplateParamInfo &&P) {
779783

780784
// Template info. These apply to either records or functions.
781785
template <typename T> static void addTemplate(T I, TemplateInfo &&P) {
782-
llvm::errs() << "invalid container for template info";
783-
exit(1);
786+
ExitOnErr(llvm::createStringError(llvm::inconvertibleErrorCode(),
787+
"invalid container for template info"));
784788
}
785789
template <> void addTemplate(RecordInfo *I, TemplateInfo &&P) {
786790
I->Template.emplace(std::move(P));
@@ -798,8 +802,9 @@ template <> void addTemplate(FriendInfo *I, TemplateInfo &&P) {
798802
// Template specializations go only into template records.
799803
template <typename T>
800804
static void addTemplateSpecialization(T I, TemplateSpecializationInfo &&TSI) {
801-
llvm::errs() << "invalid container for template specialization info";
802-
exit(1);
805+
ExitOnErr(llvm::createStringError(
806+
llvm::inconvertibleErrorCode(),
807+
"invalid container for template specialization info"));
803808
}
804809
template <>
805810
void addTemplateSpecialization(TemplateInfo *I,
@@ -808,8 +813,8 @@ void addTemplateSpecialization(TemplateInfo *I,
808813
}
809814

810815
template <typename T> static void addConstraint(T I, ConstraintInfo &&C) {
811-
llvm::errs() << "invalid container for constraint info";
812-
exit(1);
816+
ExitOnErr(llvm::createStringError(llvm::inconvertibleErrorCode(),
817+
"invalid container for constraint info"));
813818
}
814819
template <> void addConstraint(TemplateInfo *I, ConstraintInfo &&C) {
815820
I->Constraints.emplace_back(std::move(C));
@@ -846,9 +851,11 @@ llvm::Error ClangDocBitcodeReader::readBlock(unsigned ID, T I) {
846851

847852
while (true) {
848853
unsigned BlockOrCode = 0;
849-
Cursor Res = skipUntilRecordOrBlock(BlockOrCode);
854+
llvm::Expected<Cursor> C = skipUntilRecordOrBlock(BlockOrCode);
855+
if (!C)
856+
return C.takeError();
850857

851-
switch (Res) {
858+
switch (*C) {
852859
case Cursor::BadBlock:
853860
return llvm::createStringError(llvm::inconvertibleErrorCode(),
854861
"bad block found");
@@ -984,45 +991,39 @@ llvm::Error ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) {
984991
}
985992
}
986993

987-
ClangDocBitcodeReader::Cursor
994+
llvm::Expected<ClangDocBitcodeReader::Cursor>
988995
ClangDocBitcodeReader::skipUntilRecordOrBlock(unsigned &BlockOrRecordID) {
989996
llvm::TimeTraceScope("Reducing infos", "skipUntilRecordOrBlock");
990997
BlockOrRecordID = 0;
991998

992999
while (!Stream.AtEndOfStream()) {
993-
Expected<unsigned> MaybeCode = Stream.ReadCode();
994-
if (!MaybeCode) {
995-
// FIXME this drops the error on the floor.
996-
consumeError(MaybeCode.takeError());
997-
return Cursor::BadBlock;
998-
}
1000+
Expected<unsigned> Code = Stream.ReadCode();
1001+
if (!Code)
1002+
return Code.takeError();
9991003

1000-
unsigned Code = MaybeCode.get();
1001-
if (Code >= static_cast<unsigned>(llvm::bitc::FIRST_APPLICATION_ABBREV)) {
1002-
BlockOrRecordID = Code;
1004+
if (*Code >= static_cast<unsigned>(llvm::bitc::FIRST_APPLICATION_ABBREV)) {
1005+
BlockOrRecordID = *Code;
10031006
return Cursor::Record;
10041007
}
1005-
switch (static_cast<llvm::bitc::FixedAbbrevIDs>(Code)) {
1008+
switch (static_cast<llvm::bitc::FixedAbbrevIDs>(*Code)) {
10061009
case llvm::bitc::ENTER_SUBBLOCK:
10071010
if (Expected<unsigned> MaybeID = Stream.ReadSubBlockID())
10081011
BlockOrRecordID = MaybeID.get();
1009-
else {
1010-
// FIXME this drops the error on the floor.
1011-
consumeError(MaybeID.takeError());
1012-
}
1012+
else
1013+
return MaybeID.takeError();
10131014
return Cursor::BlockBegin;
10141015
case llvm::bitc::END_BLOCK:
10151016
if (Stream.ReadBlockEnd())
1016-
return Cursor::BadBlock;
1017+
return llvm::createStringError(llvm::inconvertibleErrorCode(),
1018+
"error at end of block");
10171019
return Cursor::BlockEnd;
10181020
case llvm::bitc::DEFINE_ABBREV:
1019-
if (llvm::Error Err = Stream.ReadAbbrevRecord()) {
1020-
// FIXME this drops the error on the floor.
1021-
consumeError(std::move(Err));
1022-
}
1021+
if (llvm::Error Err = Stream.ReadAbbrevRecord())
1022+
return std::move(Err);
10231023
continue;
10241024
case llvm::bitc::UNABBREV_RECORD:
1025-
return Cursor::BadBlock;
1025+
return llvm::createStringError(llvm::inconvertibleErrorCode(),
1026+
"found unabbreviated record");
10261027
case llvm::bitc::FIRST_APPLICATION_ABBREV:
10271028
llvm_unreachable("Unexpected abbrev id.");
10281029
}
@@ -1148,10 +1149,8 @@ ClangDocBitcodeReader::readBitcode() {
11481149
return std::move(Err);
11491150
continue;
11501151
default:
1151-
if (llvm::Error Err = Stream.SkipBlock()) {
1152-
// FIXME this drops the error on the floor.
1153-
consumeError(std::move(Err));
1154-
}
1152+
if (llvm::Error Err = Stream.SkipBlock())
1153+
return std::move(Err);
11551154
continue;
11561155
}
11571156
}

clang-tools-extra/clang-doc/BitcodeReader.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace doc {
2727
// Class to read bitstream into an InfoSet collection
2828
class ClangDocBitcodeReader {
2929
public:
30-
ClangDocBitcodeReader(llvm::BitstreamCursor &Stream) : Stream(Stream) {}
30+
ClangDocBitcodeReader(llvm::BitstreamCursor &Stream, DiagnosticsEngine &Diags)
31+
: Stream(Stream), Diags(Diags) {}
3132

3233
// Main entry point, calls readBlock to read each block in the given stream.
3334
llvm::Expected<std::vector<std::unique_ptr<Info>>> readBitcode();
@@ -57,7 +58,7 @@ class ClangDocBitcodeReader {
5758

5859
// Helper function to step through blocks to find and dispatch the next record
5960
// or block to be read.
60-
Cursor skipUntilRecordOrBlock(unsigned &BlockOrRecordID);
61+
llvm::Expected<Cursor> skipUntilRecordOrBlock(unsigned &BlockOrRecordID);
6162

6263
// Helper function to set up the appropriate type of Info.
6364
llvm::Expected<std::unique_ptr<Info>> readBlockToInfo(unsigned ID);
@@ -72,6 +73,7 @@ class ClangDocBitcodeReader {
7273
llvm::BitstreamCursor &Stream;
7374
std::optional<llvm::BitstreamBlockInfo> BlockInfo;
7475
FieldId CurrentReferenceField;
76+
DiagnosticsEngine &Diags;
7577
};
7678

7779
} // namespace doc

clang-tools-extra/clang-doc/BitcodeWriter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,9 @@ bool ClangDocBitcodeWriter::dispatchInfoForWrite(Info *I) {
769769
emitBlock(*static_cast<FriendInfo *>(I));
770770
break;
771771
case InfoType::IT_default:
772-
llvm::errs() << "Unexpected info, unable to write.\n";
772+
unsigned ID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
773+
"Unexpected info, unable to write.");
774+
Diags.Report(ID);
773775
return true;
774776
}
775777
return false;

clang-tools-extra/clang-doc/BitcodeWriter.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H
1717

1818
#include "Representation.h"
19+
#include "clang/Basic/Diagnostic.h"
1920
#include "llvm/ADT/DenseMap.h"
2021
#include "llvm/Bitstream/BitstreamWriter.h"
2122
#include <vector>
@@ -175,7 +176,8 @@ enum class FieldId {
175176

176177
class ClangDocBitcodeWriter {
177178
public:
178-
ClangDocBitcodeWriter(llvm::BitstreamWriter &Stream) : Stream(Stream) {
179+
ClangDocBitcodeWriter(llvm::BitstreamWriter &Stream, DiagnosticsEngine &Diags)
180+
: Stream(Stream), Diags(Diags) {
179181
emitHeader();
180182
emitBlockInfoBlock();
181183
emitVersionBlock();
@@ -260,6 +262,7 @@ class ClangDocBitcodeWriter {
260262
SmallVector<uint32_t, BitCodeConstants::RecordSize> Record;
261263
llvm::BitstreamWriter &Stream;
262264
AbbreviationMap Abbrevs;
265+
DiagnosticsEngine &Diags;
263266
};
264267

265268
} // namespace doc

clang-tools-extra/clang-doc/Generators.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ Error MustacheGenerator::generateDocumentation(
127127

128128
auto File = MemoryBuffer::getFile(Path);
129129
if (EC = File.getError(); EC) {
130-
// TODO: Buffer errors to report later, look into using Clang
131-
// diagnostics.
132-
llvm::errs() << "Failed to open file: " << Path << " " << EC.message()
133-
<< '\n';
130+
unsigned ID = CDCtx.Diags.getCustomDiagID(DiagnosticsEngine::Warning,
131+
"Failed to open file: %0 %1");
132+
CDCtx.Diags.Report(ID) << Path << EC.message();
133+
JSONIter.increment(EC);
134+
continue;
134135
}
135136

136137
auto Parsed = json::parse((*File)->getBuffer());

0 commit comments

Comments
 (0)