[llvm-dev] [ARM][Thumb2InstrInfo]: "XXXOffsetOpcode" may return PHI as default opcode
Lorenzo Casalino via llvm-dev
llvm-dev at lists.llvm.org
Sun Oct 6 15:01:05 PDT 2019
while inserting a new instruction handling a frame index, I noticed that
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"
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
Let me know your thoughts about it, and if it is worth to issue a patch.
More information about the llvm-dev