[LLVMdev] ARM Jump table pcrelative relaxation in clang / llc

Renato Golin renato.golin at linaro.org
Mon Jul 6 05:39:14 PDT 2015


On 6 July 2015 at 07:18, Eric Bentura <ebentura at gmail.com> wrote:
> We've fairly recently fixed a bug that looks very similar (r238680,
> which was well after 3.6)
>
> If I wanted to back port that to 3.5 where should I look at? Where in the
> ARM backend the decision to relax an instruction is taken?

Hi Eric,

First, I'd make sure if Tim's fix works for you. If you can't forward
port your pass to trunk, try to backport Tim's patch into your tree.


> This is passing even with -filetype=obj. The transformation I apply are in
> the optimizer so I must build the new bc to create the object file.

This is good news, means that the problem is probably not in the
asm/obj emitters. The difference in behaviour between llc and clang
are normally due to target description issues, as Tim mentioned.

I'd encourage you to check on llc's object file and see how the jump
table is being lowered. It's possible that the lack of a few flags
clang passes to the back-end made that instruction not be selected
during ISel.

Essentially, "clang -target armv5t" is *not* the same as "llc -mtriple armv5t".

I'm guessing you're hitting the same bug Tim found earlier...

cheers,
--renato



More information about the llvm-dev mailing list