diff --git a/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp b/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp --- a/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp +++ b/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp @@ -888,7 +888,7 @@ template <> bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { - llvm_unreachable("byte ELPMPi is unimplemented"); + llvm_unreachable("8-bit ELPMPi is unimplemented"); } template <> diff --git a/llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp b/llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp --- a/llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp +++ b/llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp @@ -188,18 +188,13 @@ unsigned Opcode = 0; int Offs = cast(LD->getOffset())->getSExtValue(); - switch (VT.SimpleTy) { - case MVT::i8: - if (Offs == 1) - Opcode = Bank > 0 ? AVR::ELPMBRdZPi : AVR::LPMRdZPi; - break; - case MVT::i16: - if (Offs == 2) - Opcode = Bank > 0 ? AVR::ELPMWRdZPi : AVR::LPMWRdZPi; - break; - default: - break; - } + if (VT.SimpleTy == MVT::i8 && Offs == 1 && Bank == 0) + Opcode = AVR::LPMRdZPi; + + // TODO: Implements the expansion of the following pseudo instructions. + // LPMWRdZPi: type == MVT::i16, offset == 2, Bank == 0. + // ELPMBRdZPi: type == MVT::i8, offset == 1, Bank > 0. + // ELPMWRdZPi: type == MVT::i16, offset == 2, Bank > 0. return Opcode; }