[llvm] r182991 - X86: change MOV64ri64i32 into MOV32ri64

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri May 31 11:00:33 PDT 2013


On May 31, 2013, at 10:23 AM, Douglas Gregor <dgregor at apple.com> wrote:

> 
> On May 31, 2013, at 5:14 AM, Tim Northover <t.p.northover at gmail.com> wrote:
> 
>>> X86: change MOV64ri64i32 into MOV32ri64
>> 
>> Hmm, it seems this broke the gdb 7.5 bot:
>> http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/5399.
>> 
>> It looks like the test itself is dodgy: it consists of a few inline
>> asm blocks, marked to clobber %eax and so on. However, it expects the
>> compiler won't use those registers in *between* either.
> 
> This seems like a really nice invariant.
> 
>> Previously
>> this was true, but now on -O0 instead of:
>>    movl $data, %r9d
>> we produce:
>>    movl $data, %eax
>>    movl %eax, %r9d
>> 
>> The extra instruction goes away (as it should) at higher
>> optimisations, and I think it's perfectly valid, but the test doesn't
>> like it.
>> 
>> Can we XFAIL individual tests on this gdb7.5 bot, or do we usually do
>> something else? I can't believe this hasn't come up before.
> 
> We probably can, is the invariant this change breaks something that we want to break?

Yes, we don’t make any guarantees about what happens to registers *between* inline assembly blocks. Even local variables explicitly marked as ‘register int x asm(“eax”)’ are only guaranteed to be placed in %eax when they are used as inline assembly arguments.

http://gcc.gnu.org/onlinedocs/gcc/Local-Reg-Vars.html

/jakob





More information about the llvm-commits mailing list