diff options
author | Tim Northover <tnorthover@apple.com> | 2017-02-17 18:50:15 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2017-02-17 18:50:15 +0000 |
commit | 88634996c7eee18a5e4517069db052815530e4b9 (patch) | |
tree | 53c9e64c9fd2cf082b788824fcb95b2338c4aa2f /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | ab0f3b43e3212fae8ce04c75f0d341f6400ce121 (diff) | |
download | llvm-88634996c7eee18a5e4517069db052815530e4b9.zip llvm-88634996c7eee18a5e4517069db052815530e4b9.tar.gz llvm-88634996c7eee18a5e4517069db052815530e4b9.tar.bz2 |
GlobalISel: verify that generic loads & stores have a mem operand.
The mem operand is used by GlobalISel to convey atomic constraints so dropping
it is invalid.
llvm-svn: 295476
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 74709dc..15694cb 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -908,6 +908,14 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { } } + // Generic loads and stores must have a single MachineMemOperand + // describing that access. + if ((MI->getOpcode() == TargetOpcode::G_LOAD || + MI->getOpcode() == TargetOpcode::G_STORE) && + !MI->hasOneMemOperand()) + report("Generic instruction accessing memory must have one mem operand", + MI); + StringRef ErrorInfo; if (!TII->verifyInstruction(*MI, ErrorInfo)) report(ErrorInfo.data(), MI); |