[ARM][Thumb2InstrInfo]: "XXXOffsetOpcode" may return PHI as default opcode


while inserting a new instruction handling a frame index, I noticed that
the static
functions "positiveOffsetOpcode", "negativeOffsetOpcode" and
(lib/Target/ARM/Thumb2InstrInfo.cpp) may return "0" (PHI generic
instruction) as default

Briefly. the static method is invoked during re-writing of frame indeces
emission phase), and is used to determine the right load/store
instruction to handle the
offset. This is done via switch statement in the "XXXOffsetOpcode"
static functions.

However, if none of the cases in the "switch" matches, the default
opcode is 0; that is,
the generic PHI instruction.

PHI instructions do not make sense in the Prologue/Epilogue emission
phase, and I think it
would be more appropriate to default the "switch" to a
"llvm_unreachable" statement.

Let me know your thoughts about it, and if it is worth to issue a patch.

Best regards,

-- Lorenzo