[llvm] Fix some typos in machine verifier comments and trace output (PR #160049)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 29 02:39:11 PDT 2025
https://github.com/danstadelmann updated https://github.com/llvm/llvm-project/pull/160049
>From 901a9b3bfb34895a6c80799c874b3d28b447f3a4 Mon Sep 17 00:00:00 2001
From: Daniel Stadelmann <dstadelmann at thermoplan.ch>
Date: Mon, 22 Sep 2025 10:12:32 +0200
Subject: [PATCH 1/2] Fix some typos in machine verifier comments and trace
output
Signed-off-by: Daniel Stadelmann <dasta_7 at hotmail.com>
---
llvm/lib/CodeGen/MachineVerifier.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index e911ce8a75828..70f0c711d5f6f 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -1549,7 +1549,7 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
report("G_BUILD_VECTOR result element type must match source type", MI);
if (DstTy.getNumElements() != MI->getNumOperands() - 1)
- report("G_BUILD_VECTOR must have an operand for each elemement", MI);
+ report("G_BUILD_VECTOR must have an operand for each element", MI);
for (const MachineOperand &MO : llvm::drop_begin(MI->operands(), 2))
if (MRI->getType(MI->getOperand(1).getReg()) != MRI->getType(MO.getReg()))
@@ -2398,7 +2398,7 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) {
// The next two checks allow COPY between physical and virtual registers,
// when the virtual register has a scalable size and the physical register
- // has a fixed size. These checks allow COPY between *potentialy* mismatched
+ // has a fixed size. These checks allow COPY between *potentially* mismatched
// sizes. However, once RegisterBankSelection occurs, MachineVerifier should
// be able to resolve a fixed size for the scalable vector, and at that
// point this function will know for sure whether the sizes are mismatched
@@ -3213,13 +3213,13 @@ struct VRegFilter {
private:
static constexpr unsigned SparseUniverseMax = 10 * 1024 * 8;
- // VRegs indexed within SparseUniverseMax are tracked by Sparse, those beyound
- // are tracked by Dense. The only purpose of the threashold and the Dense set
+ // VRegs indexed within SparseUniverseMax are tracked by Sparse, those beyond
+ // are tracked by Dense. The only purpose of the threshold and the Dense set
// is to have a reasonably growing memory usage in pathological cases (large
// number of very sparse VRegFilter instances live at the same time). In
// practice even in the worst-by-execution time cases having all elements
// tracked by Sparse (very large SparseUniverseMax scenario) tends to be more
- // space efficient than if tracked by Dense. The threashold is set to keep the
+ // space efficient than if tracked by Dense. The threshold is set to keep the
// worst-case memory usage within 2x of figures determined empirically for
// "all Dense" scenario in such worst-by-execution-time cases.
BitVector Sparse;
@@ -3459,7 +3459,7 @@ void MachineVerifier::visitMachineFunctionAfter() {
// Check live-in list of each MBB. If a register is live into MBB, check
// that the register is in regsLiveOut of each predecessor block. Since
- // this must come from a definition in the predecesssor or its live-in
+ // this must come from a definition in the predecessor or its live-in
// list, this will catch a live-through case where the predecessor does not
// have the register in its live-in list. This currently only checks
// registers that have no aliases, are not allocatable and are not
>From c353c76ff3676fbc4965f30de230ed191a959120 Mon Sep 17 00:00:00 2001
From: Daniel Stadelmann <dstadelmann at thermoplan.ch>
Date: Mon, 29 Sep 2025 10:55:25 +0200
Subject: [PATCH 2/2] fixup! Fix some typos in machine verifier comments and
trace output
---
llvm/lib/CodeGen/MachineVerifier.cpp | 10 +++++-----
llvm/test/MachineVerifier/test_g_build_vector.mir | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index 70f0c711d5f6f..115485509c4a5 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -2398,11 +2398,11 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) {
// The next two checks allow COPY between physical and virtual registers,
// when the virtual register has a scalable size and the physical register
- // has a fixed size. These checks allow COPY between *potentially* mismatched
- // sizes. However, once RegisterBankSelection occurs, MachineVerifier should
- // be able to resolve a fixed size for the scalable vector, and at that
- // point this function will know for sure whether the sizes are mismatched
- // and correctly report a size mismatch.
+ // has a fixed size. These checks allow COPY between *potentially*
+ // mismatched sizes. However, once RegisterBankSelection occurs,
+ // MachineVerifier should be able to resolve a fixed size for the scalable
+ // vector, and at that point this function will know for sure whether the
+ // sizes are mismatched and correctly report a size mismatch.
if (SrcReg.isPhysical() && DstReg.isVirtual() && DstSize.isScalable() &&
!SrcSize.isScalable())
break;
diff --git a/llvm/test/MachineVerifier/test_g_build_vector.mir b/llvm/test/MachineVerifier/test_g_build_vector.mir
index 50b98017a49a7..9857306737108 100644
--- a/llvm/test/MachineVerifier/test_g_build_vector.mir
+++ b/llvm/test/MachineVerifier/test_g_build_vector.mir
@@ -16,17 +16,17 @@ body: |
; CHECK: Bad machine code: G_BUILD_VECTOR must produce a vector from scalar operands
%3:_(<2 x s32>) = G_BUILD_VECTOR %2
- ; CHECK: Bad machine code: G_BUILD_VECTOR must have an operand for each elemement
+ ; CHECK: Bad machine code: G_BUILD_VECTOR must have an operand for each element
%4:_(<2 x s32>) = G_BUILD_VECTOR %0, %0, %0, %0
; CHECK: Bad machine code: G_BUILD_VECTOR result element type must match source type
- ; CHECK: Bad machine code: G_BUILD_VECTOR must have an operand for each elemement
+ ; CHECK: Bad machine code: G_BUILD_VECTOR must have an operand for each element
%5:_(<4 x s16>) = G_BUILD_VECTOR %0, %0
%6:_(s16) = IMPLICIT_DEF
; CHECK: Bad machine code: G_BUILD_VECTOR result element type must match source type
- ; CHECK: Bad machine code: G_BUILD_VECTOR must have an operand for each elemement
+ ; CHECK: Bad machine code: G_BUILD_VECTOR must have an operand for each element
%7:_(<2 x s32>) = G_BUILD_VECTOR %6, %6, %6, %6
%8:_(p0) = IMPLICIT_DEF
More information about the llvm-commits
mailing list