Skip to content

Commit 5255366

Browse files
authored
merge main into amd-staging (llvm#2229)
2 parents 63907cc + 035d55d commit 5255366

File tree

52 files changed

+592
-641
lines changed

Some content is hidden

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

52 files changed

+592
-641
lines changed

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
247247
Inst.clear();
248248
Inst.addOperand(MCOperand::createExpr(RISCVMCExpr::create(
249249
MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx),
250-
RISCVMCExpr::VK_CALL, *Ctx)));
250+
ELF::R_RISCV_CALL_PLT, *Ctx)));
251251
}
252252

253253
void createCall(MCInst &Inst, const MCSymbol *Target,
@@ -435,19 +435,19 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
435435
case ELF::R_RISCV_TLS_GD_HI20:
436436
// The GOT is reused so no need to create GOT relocations
437437
case ELF::R_RISCV_PCREL_HI20:
438-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_PCREL_HI, Ctx);
438+
return RISCVMCExpr::create(Expr, ELF::R_RISCV_PCREL_HI20, Ctx);
439439
case ELF::R_RISCV_PCREL_LO12_I:
440440
case ELF::R_RISCV_PCREL_LO12_S:
441441
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_PCREL_LO, Ctx);
442442
case ELF::R_RISCV_HI20:
443-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_HI, Ctx);
443+
return RISCVMCExpr::create(Expr, ELF::R_RISCV_HI20, Ctx);
444444
case ELF::R_RISCV_LO12_I:
445445
case ELF::R_RISCV_LO12_S:
446446
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_LO, Ctx);
447447
case ELF::R_RISCV_CALL:
448-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_CALL, Ctx);
448+
return RISCVMCExpr::create(Expr, ELF::R_RISCV_CALL_PLT, Ctx);
449449
case ELF::R_RISCV_CALL_PLT:
450-
return RISCVMCExpr::create(Expr, RISCVMCExpr::VK_CALL_PLT, Ctx);
450+
return RISCVMCExpr::create(Expr, ELF::R_RISCV_CALL_PLT, Ctx);
451451
}
452452
}
453453

@@ -472,8 +472,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
472472
switch (cast<RISCVMCExpr>(ImmExpr)->getSpecifier()) {
473473
default:
474474
return false;
475-
case RISCVMCExpr::VK_CALL:
476-
case RISCVMCExpr::VK_CALL_PLT:
475+
case ELF::R_RISCV_CALL_PLT:
477476
return true;
478477
}
479478
}

clang/lib/CodeGen/CGHLSLBuiltins.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -412,24 +412,28 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
412412
ArrayRef<Value *>{Op0, Op1}, nullptr, "hlsl.dot");
413413
}
414414
case Builtin::BI__builtin_hlsl_dot4add_i8packed: {
415-
Value *A = EmitScalarExpr(E->getArg(0));
416-
Value *B = EmitScalarExpr(E->getArg(1));
417-
Value *C = EmitScalarExpr(E->getArg(2));
415+
Value *X = EmitScalarExpr(E->getArg(0));
416+
Value *Y = EmitScalarExpr(E->getArg(1));
417+
Value *Acc = EmitScalarExpr(E->getArg(2));
418418

419419
Intrinsic::ID ID = CGM.getHLSLRuntime().getDot4AddI8PackedIntrinsic();
420+
// Note that the argument order disagrees between the builtin and the
421+
// intrinsic here.
420422
return Builder.CreateIntrinsic(
421-
/*ReturnType=*/C->getType(), ID, ArrayRef<Value *>{A, B, C}, nullptr,
422-
"hlsl.dot4add.i8packed");
423+
/*ReturnType=*/Acc->getType(), ID, ArrayRef<Value *>{Acc, X, Y},
424+
nullptr, "hlsl.dot4add.i8packed");
423425
}
424426
case Builtin::BI__builtin_hlsl_dot4add_u8packed: {
425-
Value *A = EmitScalarExpr(E->getArg(0));
426-
Value *B = EmitScalarExpr(E->getArg(1));
427-
Value *C = EmitScalarExpr(E->getArg(2));
427+
Value *X = EmitScalarExpr(E->getArg(0));
428+
Value *Y = EmitScalarExpr(E->getArg(1));
429+
Value *Acc = EmitScalarExpr(E->getArg(2));
428430

429431
Intrinsic::ID ID = CGM.getHLSLRuntime().getDot4AddU8PackedIntrinsic();
432+
// Note that the argument order disagrees between the builtin and the
433+
// intrinsic here.
430434
return Builder.CreateIntrinsic(
431-
/*ReturnType=*/C->getType(), ID, ArrayRef<Value *>{A, B, C}, nullptr,
432-
"hlsl.dot4add.u8packed");
435+
/*ReturnType=*/Acc->getType(), ID, ArrayRef<Value *>{Acc, X, Y},
436+
nullptr, "hlsl.dot4add.u8packed");
433437
}
434438
case Builtin::BI__builtin_hlsl_elementwise_firstbithigh: {
435439
Value *X = EmitScalarExpr(E->getArg(0));
Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
// RUN: %clang_cc1 -finclude-default-header -triple \
2-
// RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o - | \
3-
// RUN: FileCheck %s -DTARGET=dx
4-
// RUN: %clang_cc1 -finclude-default-header -triple \
5-
// RUN: spirv-pc-vulkan-compute %s -emit-llvm -disable-llvm-passes -o - | \
6-
// RUN: FileCheck %s -DTARGET=spv
1+
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.4-compute %s -emit-llvm -o - | FileCheck %s -DTARGET=dx
2+
// RUN: %clang_cc1 -finclude-default-header -triple spirv-pc-vulkan-compute %s -emit-llvm -o - | FileCheck %s -DTARGET=spv
73

84
// Test basic lowering to runtime function call.
95

106
// CHECK-LABEL: test
11-
int test(uint a, uint b, int c) {
12-
// CHECK: %[[RET:.*]] = call [[TY:i32]] @llvm.[[TARGET]].dot4add.i8packed([[TY]] %[[#]], [[TY]] %[[#]], [[TY]] %[[#]])
13-
// CHECK: ret [[TY]] %[[RET]]
14-
return dot4add_i8packed(a, b, c);
7+
int test(uint x, uint y, int acc) {
8+
// CHECK: [[X_ADDR:%.*]] = alloca i32, align 4
9+
// CHECK: [[Y_ADDR:%.*]] = alloca i32, align 4
10+
// CHECK: [[ACC_ADDR:%.*]] = alloca i32, align 4
11+
// CHECK: store i32 %x, ptr [[X_ADDR]], align 4
12+
// CHECK: store i32 %y, ptr [[Y_ADDR]], align 4
13+
// CHECK: store i32 %acc, ptr [[ACC_ADDR]], align 4
14+
// CHECK: [[X0:%.*]] = load i32, ptr [[X_ADDR]], align 4
15+
// CHECK: [[Y0:%.*]] = load i32, ptr [[Y_ADDR]], align 4
16+
// CHECK: [[ACC0:%.*]] = load i32, ptr [[ACC_ADDR]], align 4
17+
// CHECK: call i32 @llvm.[[TARGET]].dot4add.i8packed(i32 [[ACC0]], i32 [[X0]], i32 [[Y0]])
18+
return dot4add_i8packed(x, y, acc);
1519
}
1620

17-
// CHECK: declare [[TY]] @llvm.[[TARGET]].dot4add.i8packed([[TY]], [[TY]], [[TY]])
21+
[numthreads(1,1,1)]
22+
void main() {
23+
test(0, 0, 0);
24+
}
Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
2-
// RUN: %clang_cc1 -finclude-default-header -triple \
3-
// RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o - | \
4-
// RUN: FileCheck %s -DTARGET=dx
5-
// RUN: %clang_cc1 -finclude-default-header -triple \
6-
// RUN: spirv-pc-vulkan-compute %s -emit-llvm -disable-llvm-passes -o - | \
7-
// RUN: FileCheck %s -DTARGET=spv
1+
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.4-compute %s -emit-llvm -o - | FileCheck %s -DTARGET=dx
2+
// RUN: %clang_cc1 -finclude-default-header -triple spirv-pc-vulkan-compute %s -emit-llvm -o - | FileCheck %s -DTARGET=spv
83

94
// Test basic lowering to runtime function call.
105

11-
// CHECK-LABEL: define {{.*}}test
12-
uint test(uint a, uint b, uint c) {
13-
// CHECK: %[[RET:.*]] = call [[TY:i32]] @llvm.[[TARGET]].dot4add.u8packed([[TY]] %[[#]], [[TY]] %[[#]], [[TY]] %[[#]])
14-
// CHECK: ret [[TY]] %[[RET]]
15-
return dot4add_u8packed(a, b, c);
6+
// CHECK-LABEL: test
7+
int test(uint x, uint y, int acc) {
8+
// CHECK: [[X_ADDR:%.*]] = alloca i32, align 4
9+
// CHECK: [[Y_ADDR:%.*]] = alloca i32, align 4
10+
// CHECK: [[ACC_ADDR:%.*]] = alloca i32, align 4
11+
// CHECK: store i32 %x, ptr [[X_ADDR]], align 4
12+
// CHECK: store i32 %y, ptr [[Y_ADDR]], align 4
13+
// CHECK: store i32 %acc, ptr [[ACC_ADDR]], align 4
14+
// CHECK: [[X0:%.*]] = load i32, ptr [[X_ADDR]], align 4
15+
// CHECK: [[Y0:%.*]] = load i32, ptr [[Y_ADDR]], align 4
16+
// CHECK: [[ACC0:%.*]] = load i32, ptr [[ACC_ADDR]], align 4
17+
// CHECK: call i32 @llvm.[[TARGET]].dot4add.u8packed(i32 [[ACC0]], i32 [[X0]], i32 [[Y0]])
18+
return dot4add_u8packed(x, y, acc);
1619
}
1720

18-
// CHECK: declare [[TY]] @llvm.[[TARGET]].dot4add.u8packed([[TY]], [[TY]], [[TY]])
21+
[numthreads(1,1,1)]
22+
void main() {
23+
test(0, 0, 0);
24+
}

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,9 +3346,9 @@ bool CommandInterpreter::SaveTranscript(
33463346
CommandReturnObject &result, std::optional<std::string> output_file) {
33473347
if (output_file == std::nullopt || output_file->empty()) {
33483348
std::string now = llvm::to_string(std::chrono::system_clock::now());
3349-
std::replace(now.begin(), now.end(), ' ', '_');
3349+
llvm::replace(now, ' ', '_');
33503350
// Can't have file name with colons on Windows
3351-
std::replace(now.begin(), now.end(), ':', '-');
3351+
llvm::replace(now, ':', '-');
33523352
const std::string file_name = "lldb_session_" + now + ".log";
33533353

33543354
FileSpec save_location = GetSaveSessionDirectory();

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ TokenVerifier::TokenVerifier(std::string body) {
251251
// We only care about tokens and not their original source locations. If we
252252
// move the whole expression to only be in one line we can simplify the
253253
// following code that extracts the token contents.
254-
std::replace(body.begin(), body.end(), '\n', ' ');
255-
std::replace(body.begin(), body.end(), '\r', ' ');
254+
llvm::replace(body, '\n', ' ');
255+
llvm::replace(body, '\r', ' ');
256256

257257
FileSystemOptions file_opts;
258258
FileManager file_mgr(file_opts,

lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,9 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources(
237237
// ScriptInterpreter. For now, we just replace dots with
238238
// underscores, but if we ever support anything other than
239239
// Python we will need to rework this
240-
std::replace(module_basename.begin(), module_basename.end(), '.',
241-
'_');
242-
std::replace(module_basename.begin(), module_basename.end(), ' ',
243-
'_');
244-
std::replace(module_basename.begin(), module_basename.end(), '-',
245-
'_');
240+
llvm::replace(module_basename, '.', '_');
241+
llvm::replace(module_basename, ' ', '_');
242+
llvm::replace(module_basename, '-', '_');
246243
ScriptInterpreter *script_interpreter =
247244
target->GetDebugger().GetScriptInterpreter();
248245
if (script_interpreter &&

lldb/source/Utility/FileSpec.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void Denormalize(llvm::SmallVectorImpl<char> &path, FileSpec::Style style) {
6060
if (PathStyleIsPosix(style))
6161
return;
6262

63-
std::replace(path.begin(), path.end(), '/', '\\');
63+
llvm::replace(path, '/', '\\');
6464
}
6565

6666
} // end anonymous namespace
@@ -186,7 +186,7 @@ void FileSpec::SetFile(llvm::StringRef pathname, Style style) {
186186

187187
// Normalize back slashes to forward slashes
188188
if (m_style == Style::windows)
189-
std::replace(resolved.begin(), resolved.end(), '\\', '/');
189+
llvm::replace(resolved, '\\', '/');
190190

191191
if (resolved.empty()) {
192192
// If we have no path after normalization set the path to the current

lldb/utils/TableGen/LLDBOptionDefEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static void emitOptions(std::string Command, ArrayRef<const Record *> Records,
150150
std::vector<CommandOption> Options(Records.begin(), Records.end());
151151

152152
std::string ID = Command;
153-
std::replace(ID.begin(), ID.end(), ' ', '_');
153+
llvm::replace(ID, ' ', '_');
154154
// Generate the macro that the user needs to define before including the
155155
// *.inc file.
156156
std::string NeededMacro = "LLDB_OPTIONS_" + ID;

lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void emityProperties(std::string PropertyName,
131131
// Generate the macro that the user needs to define before including the
132132
// *.inc file.
133133
std::string NeededMacro = "LLDB_PROPERTIES_" + PropertyName;
134-
std::replace(NeededMacro.begin(), NeededMacro.end(), ' ', '_');
134+
llvm::replace(NeededMacro, ' ', '_');
135135

136136
// All options are in one file, so we need put them behind macros and ask the
137137
// user to define the macro for the options that are needed.
@@ -154,7 +154,7 @@ static void emitPropertyEnum(std::string PropertyName,
154154
// Generate the macro that the user needs to define before including the
155155
// *.inc file.
156156
std::string NeededMacro = "LLDB_PROPERTIES_" + PropertyName;
157-
std::replace(NeededMacro.begin(), NeededMacro.end(), ' ', '_');
157+
llvm::replace(NeededMacro, ' ', '_');
158158

159159
// All options are in one file, so we need put them behind macros and ask the
160160
// user to define the macro for the options that are needed.

llvm/include/llvm/ADT/SmallVector.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_ADT_SMALLVECTOR_H
1515
#define LLVM_ADT_SMALLVECTOR_H
1616

17+
#include "llvm/ADT/DenseMapInfo.h"
1718
#include "llvm/Support/Compiler.h"
1819
#include <algorithm>
1920
#include <cassert>
@@ -1319,6 +1320,26 @@ extern template class llvm::SmallVectorBase<uint32_t>;
13191320
extern template class llvm::SmallVectorBase<uint64_t>;
13201321
#endif
13211322

1323+
// Provide DenseMapInfo for SmallVector of a type which has info.
1324+
template <typename T, unsigned N> struct DenseMapInfo<llvm::SmallVector<T, N>> {
1325+
static SmallVector<T, N> getEmptyKey() {
1326+
return {DenseMapInfo<T>::getEmptyKey()};
1327+
}
1328+
1329+
static SmallVector<T, N> getTombstoneKey() {
1330+
return {DenseMapInfo<T>::getTombstoneKey()};
1331+
}
1332+
1333+
static unsigned getHashValue(const SmallVector<T, N> &V) {
1334+
return static_cast<unsigned>(hash_combine_range(V));
1335+
}
1336+
1337+
static bool isEqual(const SmallVector<T, N> &LHS,
1338+
const SmallVector<T, N> &RHS) {
1339+
return LHS == RHS;
1340+
}
1341+
};
1342+
13221343
} // end namespace llvm
13231344

13241345
namespace std {

llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ cl::opt<bool> llvm::DisableGISelLegalityCheck(
3434
cl::desc("Don't verify that MIR is fully legal between GlobalISel passes"),
3535
cl::Hidden);
3636

37+
cl::opt<bool> VerboseVerifyLegalizerInfo(
38+
"verbose-gisel-verify-legalizer-info",
39+
cl::desc("Print more information to dbgs about GlobalISel legalizer rules "
40+
"being verified"),
41+
cl::Hidden);
42+
3743
raw_ostream &llvm::operator<<(raw_ostream &OS, LegalizeAction Action) {
3844
switch (Action) {
3945
case Legal:
@@ -211,20 +217,28 @@ LegalizeActionStep LegalizeRuleSet::apply(const LegalityQuery &Query) const {
211217
bool LegalizeRuleSet::verifyTypeIdxsCoverage(unsigned NumTypeIdxs) const {
212218
#ifndef NDEBUG
213219
if (Rules.empty()) {
214-
LLVM_DEBUG(
215-
dbgs() << ".. type index coverage check SKIPPED: no rules defined\n");
220+
if (VerboseVerifyLegalizerInfo) {
221+
LLVM_DEBUG(dbgs() << ".. type index coverage check SKIPPED: "
222+
<< "no rules defined\n");
223+
}
216224
return true;
217225
}
218226
const int64_t FirstUncovered = TypeIdxsCovered.find_first_unset();
219227
if (FirstUncovered < 0) {
220-
LLVM_DEBUG(dbgs() << ".. type index coverage check SKIPPED:"
221-
" user-defined predicate detected\n");
228+
if (VerboseVerifyLegalizerInfo) {
229+
LLVM_DEBUG(dbgs() << ".. type index coverage check SKIPPED:"
230+
" user-defined predicate detected\n");
231+
}
222232
return true;
223233
}
224234
const bool AllCovered = (FirstUncovered >= NumTypeIdxs);
225-
if (NumTypeIdxs > 0)
226-
LLVM_DEBUG(dbgs() << ".. the first uncovered type index: " << FirstUncovered
227-
<< ", " << (AllCovered ? "OK" : "FAIL") << "\n");
235+
if (NumTypeIdxs > 0) {
236+
if (VerboseVerifyLegalizerInfo) {
237+
LLVM_DEBUG(dbgs() << ".. the first uncovered type index: "
238+
<< FirstUncovered << ", "
239+
<< (AllCovered ? "OK" : "FAIL") << "\n");
240+
}
241+
}
228242
return AllCovered;
229243
#else
230244
return true;
@@ -234,19 +248,25 @@ bool LegalizeRuleSet::verifyTypeIdxsCoverage(unsigned NumTypeIdxs) const {
234248
bool LegalizeRuleSet::verifyImmIdxsCoverage(unsigned NumImmIdxs) const {
235249
#ifndef NDEBUG
236250
if (Rules.empty()) {
237-
LLVM_DEBUG(
238-
dbgs() << ".. imm index coverage check SKIPPED: no rules defined\n");
251+
if (VerboseVerifyLegalizerInfo) {
252+
LLVM_DEBUG(dbgs() << ".. imm index coverage check SKIPPED: "
253+
<< "no rules defined\n");
254+
}
239255
return true;
240256
}
241257
const int64_t FirstUncovered = ImmIdxsCovered.find_first_unset();
242258
if (FirstUncovered < 0) {
243-
LLVM_DEBUG(dbgs() << ".. imm index coverage check SKIPPED:"
244-
" user-defined predicate detected\n");
259+
if (VerboseVerifyLegalizerInfo) {
260+
LLVM_DEBUG(dbgs() << ".. imm index coverage check SKIPPED:"
261+
" user-defined predicate detected\n");
262+
}
245263
return true;
246264
}
247265
const bool AllCovered = (FirstUncovered >= NumImmIdxs);
248-
LLVM_DEBUG(dbgs() << ".. the first uncovered imm index: " << FirstUncovered
249-
<< ", " << (AllCovered ? "OK" : "FAIL") << "\n");
266+
if (VerboseVerifyLegalizerInfo) {
267+
LLVM_DEBUG(dbgs() << ".. the first uncovered imm index: " << FirstUncovered
268+
<< ", " << (AllCovered ? "OK" : "FAIL") << "\n");
269+
}
250270
return AllCovered;
251271
#else
252272
return true;
@@ -274,8 +294,10 @@ unsigned LegalizerInfo::getOpcodeIdxForOpcode(unsigned Opcode) const {
274294
unsigned LegalizerInfo::getActionDefinitionsIdx(unsigned Opcode) const {
275295
unsigned OpcodeIdx = getOpcodeIdxForOpcode(Opcode);
276296
if (unsigned Alias = RulesForOpcode[OpcodeIdx].getAlias()) {
277-
LLVM_DEBUG(dbgs() << ".. opcode " << Opcode << " is aliased to " << Alias
278-
<< "\n");
297+
if (VerboseVerifyLegalizerInfo) {
298+
LLVM_DEBUG(dbgs() << ".. opcode " << Opcode << " is aliased to " << Alias
299+
<< "\n");
300+
}
279301
OpcodeIdx = getOpcodeIdxForOpcode(Alias);
280302
assert(RulesForOpcode[OpcodeIdx].getAlias() == 0 && "Cannot chain aliases");
281303
}
@@ -396,11 +418,13 @@ void LegalizerInfo::verify(const MCInstrInfo &MII) const {
396418
? std::max(OpInfo.getGenericImmIndex() + 1U, Acc)
397419
: Acc;
398420
});
399-
LLVM_DEBUG(dbgs() << MII.getName(Opcode) << " (opcode " << Opcode
400-
<< "): " << NumTypeIdxs << " type ind"
401-
<< (NumTypeIdxs == 1 ? "ex" : "ices") << ", "
402-
<< NumImmIdxs << " imm ind"
403-
<< (NumImmIdxs == 1 ? "ex" : "ices") << "\n");
421+
if (VerboseVerifyLegalizerInfo) {
422+
LLVM_DEBUG(dbgs() << MII.getName(Opcode) << " (opcode " << Opcode
423+
<< "): " << NumTypeIdxs << " type ind"
424+
<< (NumTypeIdxs == 1 ? "ex" : "ices") << ", "
425+
<< NumImmIdxs << " imm ind"
426+
<< (NumImmIdxs == 1 ? "ex" : "ices") << "\n");
427+
}
404428
const LegalizeRuleSet &RuleSet = getActionDefinitions(Opcode);
405429
if (!RuleSet.verifyTypeIdxsCoverage(NumTypeIdxs))
406430
FailedOpcodes.push_back(Opcode);
@@ -413,8 +437,9 @@ void LegalizerInfo::verify(const MCInstrInfo &MII) const {
413437
errs() << " " << MII.getName(Opcode);
414438
errs() << "\n";
415439

416-
report_fatal_error("ill-defined LegalizerInfo"
417-
", try -debug-only=legalizer-info for details");
440+
report_fatal_error("ill-defined LegalizerInfo, try "
441+
"-debug-only=legalizer-info and "
442+
"-verbose-gisel-verify-legalizer-info for details");
418443
}
419444
#endif
420445
}

0 commit comments

Comments
 (0)