[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
Mon Jan 6 08:30:48 PST 2025
================
@@ -1274,6 +1274,24 @@ 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()) {
+ auto operandBits = [](const MDOperand &o) -> unsigned {
+ ConstantInt *i = mdconst::dyn_extract<ConstantInt>(o);
+ if (!i->isNegative())
+ return i->getValue().getActiveBits();
+ APInt reversed(i->getValue());
----------------
arsenm wrote:
You shouldn't need to consider anything about the value of the range, only the type
https://github.com/llvm/llvm-project/pull/121247
More information about the llvm-commits
mailing list