diff options
author | Michael Maitland <michaeltmaitland@gmail.com> | 2024-04-01 08:46:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-01 08:46:22 -0400 |
commit | da9f06c9b1179423302e3e7ccb27431ced44e548 (patch) | |
tree | ecec6f06bc5e5ab8f6a989d12387c3e8d6554eba /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 4213f4a9ae0ef70e02da9f40653b4e04eea00c74 (diff) | |
download | llvm-da9f06c9b1179423302e3e7ccb27431ced44e548.zip llvm-da9f06c9b1179423302e3e7ccb27431ced44e548.tar.gz llvm-da9f06c9b1179423302e3e7ccb27431ced44e548.tar.bz2 |
[GISEL] G_SPLAT_VECTOR can take a splat that is larger than the vector element (#86974)
This is what SelectionDAG does. We'd like to reuse SelectionDAG
patterns.
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index e4e05ce..fd7ea284 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -1768,16 +1768,23 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) { LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); LLT SrcTy = MRI->getType(MI->getOperand(1).getReg()); - if (!DstTy.isScalableVector()) + if (!DstTy.isScalableVector()) { report("Destination type must be a scalable vector", MI); + break; + } - if (!SrcTy.isScalar()) + if (!SrcTy.isScalar()) { report("Source type must be a scalar", MI); + break; + } - if (DstTy.getScalarType() != SrcTy) - report("Element type of the destination must be the same type as the " - "source type", + if (TypeSize::isKnownGT(DstTy.getElementType().getSizeInBits(), + SrcTy.getSizeInBits())) { + report("Element type of the destination must be the same size or smaller " + "than the source type", MI); + break; + } break; } |