diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-07-28 16:58:27 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-07-28 16:58:27 +0000 |
commit | 46c05fc861c49b82e049aefd9799bc39edb2b768 (patch) | |
tree | 70cebf0c6a616f5ed41118e1f9a7e388bf32d2ea /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 07994ec39b5242be73c420b5edc581536ad150cd (diff) | |
download | bcm5719-llvm-46c05fc861c49b82e049aefd9799bc39edb2b768.tar.gz bcm5719-llvm-46c05fc861c49b82e049aefd9799bc39edb2b768.zip |
[GlobalISel] Remove types on selected insts instead of using LLT().
LLT() has a particular meaning: it's one invalid type. But we really
want selected instructions to have no type whatsoever.
Also verify that types don't linger after ISel, and enable the verifier
on the AArch64 select test.
llvm-svn: 277001
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 23a89f865c1..8f8013adc98 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -879,6 +879,16 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { } } + // Check types. + const unsigned NumTypes = MI->getNumTypes(); + if (isPreISelGenericOpcode(MCID.getOpcode())) { + if (NumTypes == 0) + report("Generic instruction must have a type", MI); + } else { + if (NumTypes != 0) + report("Non-generic instruction cannot have a type", MI); + } + StringRef ErrorInfo; if (!TII->verifyInstruction(*MI, ErrorInfo)) report(ErrorInfo.data(), MI); |