aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineVerifier.cpp
diff options
context:
space:
mode:
authorjyli0116 <yu.li@arm.com>2025-07-09 18:56:17 +0100
committerGitHub <noreply@github.com>2025-07-09 18:56:17 +0100
commit4c27279ec4c255b93a4cb3f044509121ebf01f10 (patch)
treec5a7a4d64d8be1d4734b05f0a3211bc016122573 /llvm/lib/CodeGen/MachineVerifier.cpp
parentcd9236d78833a3f312d0a38e53e3f12e9926bcf3 (diff)
downloadllvm-4c27279ec4c255b93a4cb3f044509121ebf01f10.zip
llvm-4c27279ec4c255b93a4cb3f044509121ebf01f10.tar.gz
llvm-4c27279ec4c255b93a4cb3f044509121ebf01f10.tar.bz2
[GlobalISel] Add Saturated Truncate Instructions (#147526)
Introduces saturated truncate instructions to Global ISel: G_TRUNC_SSAT_S, G_TRUNC_SSAT_U, G_TRUNC_USAT_U. These were previously introduced to SDAG to reduce redundant code. The patch only initially introduces the instruction, a later patch will follow to add combines and legalization for each instruction.
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineVerifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index 1099882..01703fe 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -1424,6 +1424,9 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
case TargetOpcode::G_ZEXT:
case TargetOpcode::G_ANYEXT:
case TargetOpcode::G_TRUNC:
+ case TargetOpcode::G_TRUNC_SSAT_S:
+ case TargetOpcode::G_TRUNC_SSAT_U:
+ case TargetOpcode::G_TRUNC_USAT_U:
case TargetOpcode::G_FPEXT:
case TargetOpcode::G_FPTRUNC: {
// Number of operands and presense of types is already checked (and
@@ -1450,6 +1453,9 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
report("Generic extend has destination type no larger than source", MI);
break;
case TargetOpcode::G_TRUNC:
+ case TargetOpcode::G_TRUNC_SSAT_S:
+ case TargetOpcode::G_TRUNC_SSAT_U:
+ case TargetOpcode::G_TRUNC_USAT_U:
case TargetOpcode::G_FPTRUNC:
if (DstSize >= SrcSize)
report("Generic truncate has destination type no smaller than source",