[llvm-dev] Getting differences with ldr/str instructions

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu May 16 03:35:34 PDT 2019


Hi Ramakota,

On Thu, 16 May 2019 at 11:04, Ramakota Reddy via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Could any one please give your suggestions to fix this problem.

This can happen if the operands on the MachineInstr you create are
incorrect. The code to print instructions and to encode instructions
can treat the operands in slightly different ways so that with invalid
input you can get a MachineInstr that prints properly, but assembles
improperly.

In this case it looks like what you're describing might happen if the
SignExtend operand was 0 and the DoShift operand was 14 (instead of a
boolean 0 or 1). I have no idea how that situation could arise without
seeing your code though.

So you should probably double check wherever you create these load
instructions to make sure you're encoding the value properly (being
aware that the encoding might differ between the ADD and the LDR).

Cheers.

Tim.


More information about the llvm-dev mailing list