The patch implements microMIPSr6 LH, LHE, LHU and LHUE instructions.
There was a problem with previous implementation of this instructions (D9824) and because of that commit rL254897 was reverted.
After commit of previous patch, test-suite failed with error message in the form of:
fatal error: error in backend: Cannot select: t124: i32,ch = load<LD2[%d](tbaa=<0x94acc48>), sext from i16> t0, t2, undef:i32
There was problem with selecting lh and lhu instructions in LLVM backend.
For that reason I decided to revert commit rL254897 and make this patch which besides implementation of instructions and standard regression tests also includes CodeGen tests (lh_lhu.ll).
This class needs to inherit from MMArch, so that this instruction ends up in the Std2MicroMips mapping table from direct object emission.
You can verify the mapping by looking at the Std2MicroMips function in $BUILDDIR/lib/Target/Mips/MipsGenDAGISel.inc and/or the records from llvm-tblgen for the string Arch = in the defs of the instructions.
You'll also have to remove the line "list<Pattern> = []" from the definition of MMArch, otherwise the DAG pattern doesn't get set properly and the instruction cannot be selected in the common case.
Removing that line from the MMArch definition will cause test failures as the selection mechanism be arranged and some 16bit instructions will not be chosen. Some of the test failures are fixed in D19906.