[AVR] Add an assertion to ensure we don't emit LPM when it's unsupported
authorDylan McKay <dylanmckay34@gmail.com>
Thu, 8 Dec 2016 08:34:13 +0000 (08:34 +0000)
committerDylan McKay <dylanmckay34@gmail.com>
Thu, 8 Dec 2016 08:34:13 +0000 (08:34 +0000)
llvm-svn: 289030

llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp

index d190a60..098ee61 100644 (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();