diff options
author | Amara Emerson <aemerson@apple.com> | 2019-04-17 22:21:05 +0000 |
---|---|---|
committer | Amara Emerson <aemerson@apple.com> | 2019-04-17 22:21:05 +0000 |
commit | d51adf056863da28ce0188654c90a5f14cf6baf1 (patch) | |
tree | 6f8b143c22726ab9b9e803938d5d0084b52c2020 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | a4bd340bf5015169a7dcdff013f018a9338610c1 (diff) | |
download | bcm5719-llvm-d51adf056863da28ce0188654c90a5f14cf6baf1.tar.gz bcm5719-llvm-d51adf056863da28ce0188654c90a5f14cf6baf1.zip |
Add a getSizeInBits() accessor to MachineMemOperand. NFC.
Cleans up a bunch of places where we do getSize() * 8.
Differential Revision: https://reviews.llvm.org/D60799
llvm-svn: 358617
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 4d388708308..b1964d68111 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -1022,13 +1022,13 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) { const MachineMemOperand &MMO = **MI->memoperands_begin(); if (MI->getOpcode() == TargetOpcode::G_ZEXTLOAD || MI->getOpcode() == TargetOpcode::G_SEXTLOAD) { - if (MMO.getSize() * 8 >= ValTy.getSizeInBits()) + if (MMO.getSizeInBits() >= ValTy.getSizeInBits()) report("Generic extload must have a narrower memory type", MI); } else if (MI->getOpcode() == TargetOpcode::G_LOAD) { - if (MMO.getSize() > (ValTy.getSizeInBits() + 7) / 8) + if (MMO.getSize() > ValTy.getSizeInBytes()) report("load memory size cannot exceed result size", MI); } else if (MI->getOpcode() == TargetOpcode::G_STORE) { - if ((ValTy.getSizeInBits() + 7) / 8 < MMO.getSize()) + if (ValTy.getSizeInBytes() < MMO.getSize()) report("store memory size cannot exceed value size", MI); } } |