[llvm] [GlobalISel] Catching inconsistencies in load memory, result, and range metadata type (PR #121247)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 23:50:07 PST 2025


================
@@ -1274,6 +1274,15 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
         if (TypeSize::isKnownGT(MMO.getSize().getValue(),
                                 ValTy.getSizeInBytes()))
           report("load memory size cannot exceed result size", MI);
+
+        if (MMO.getRanges()) {
+          ConstantInt *i =
+              mdconst::extract<ConstantInt>(MMO.getRanges()->getOperand(0));
+          if (i->getIntegerType()->getBitWidth() !=
+              ValTy.getScalarType().getSizeInBits()) {
----------------
arsenm wrote:

The change to use the memory type got lost 

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


More information about the llvm-commits mailing list