[AVR] Don't adjust for instruction size
authorAyke van Laethem <aykevanlaethem@gmail.com>
Sun, 19 Apr 2020 18:58:36 +0000 (20:58 +0200)
committerAyke van Laethem <aykevanlaethem@gmail.com>
Tue, 23 Jun 2020 00:15:42 +0000 (02:15 +0200)
commitff4817ec2adb1e716051c286bcdc5ef4d1b32dd3
tree6550cbb85d56754c9d9df2a28ac09231e3c17b38
parentd332ec9209ac0a54fc4f1e5e4edc7948fcc4d6af
[AVR] Don't adjust for instruction size

I'm not entirely sure why this was ever needed, but when I remove both
adjustments all tests still pass.

This fixes a bug where a long branch (using the `jmp` instead of the
`rjmp` instruction) was incorrectly adjusted by 2 because it jumps to an
absolute address instead of a PC-relative address. I could have added
AVR::fixup_call to the list of exceptions, but it seemed more sensible
to me to just remove this code.

Differential Revision: https://reviews.llvm.org/D78459
llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
llvm/test/CodeGen/AVR/jmp-long.ll [new file with mode: 0644]