[llvm] MachineVerifier: Fix check for range type (PR #124894)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 01:56:32 PST 2025


================
@@ -1285,8 +1285,12 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
         if (MMO.getRanges()) {
           ConstantInt *i =
               mdconst::extract<ConstantInt>(MMO.getRanges()->getOperand(0));
-          if (i->getIntegerType()->getBitWidth() !=
-              ValTy.getScalarType().getSizeInBits()) {
+          const LLT RangeTy = LLT::scalar(i->getIntegerType()->getBitWidth());
+          const LLT MemTy = MMO.getMemoryType();
+          if (MemTy.getScalarType() != RangeTy ||
+              ValTy.isScalar() != MemTy.isScalar() ||
+              (ValTy.isVector() &&
+               ValTy.getNumElements() != MemTy.getNumElements())) {
----------------
arsenm wrote:

There are many violations of the memory type that would need to be fixed 

https://github.com/llvm/llvm-project/pull/124894


More information about the llvm-commits mailing list