diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2025-01-30 10:56:12 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-30 10:56:12 +0700 |
commit | 60174804611a2543c757d274b293c139412ab41c (patch) | |
tree | beaf723796b403356d68dc33977c2de13bf6694b /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 97a1f494a6778df24cfca817a30b73b1f0a7228a (diff) | |
download | llvm-60174804611a2543c757d274b293c139412ab41c.zip llvm-60174804611a2543c757d274b293c139412ab41c.tar.gz llvm-60174804611a2543c757d274b293c139412ab41c.tar.bz2 |
MachineVerifier: Fix check for range type (#124894)
We need to permit scalar extending loads with range annotations.
Fix expensive_checks failures after 11db7fb09b36e656a801117d6a2492133e9c2e46
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index becf41b0a..db65eba 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -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())) { report("range is incompatible with the result type", MI); } } |