[AVR] Add an assertion to ensure we don't emit LPM when it's unsupported

llvm-svn: 289030
This commit is contained in:
Dylan McKay 2016-12-08 08:34:13 +00:00
parent 4879815600
commit fac9ce5413
1 changed files with 2 additions and 0 deletions

View File

@ -366,6 +366,8 @@ template <> bool AVRDAGToDAGISel::select<ISD::LOAD>(SDNode *N) {
return selectIndexedLoad(N);
}
assert(Subtarget->hasLPM() && "cannot load from program memory on this mcu");
// This is a flash memory load, move the pointer into R31R30 and emit
// the lpm instruction.
MVT VT = LD->getMemoryVT().getSimpleVT();