[llvm-commits] [llvm] r134268 - in /llvm/trunk: lib/Analysis/IVUsers.cpp test/CodeGen/X86/lsr-nonaffine.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Jul 5 19:30:52 PDT 2011


On Jul 5, 2011, at 2:19 PM, Jakob Stoklund Olesen wrote:

> 
> On Jul 5, 2011, at 2:08 PM, Francois Pichet wrote:
> 
>> On Fri, Jul 1, 2011 at 11:52 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
>>> Unit tests should only mention explicit registers when a specific register
>>> is required for correctness.
>>> Otherwise, use FileCheck variables.
>>> One of these days, I am going to add -regalloc=random…
>>> /jakob
>>> 
>> 
>> Interesting! I know close to nothing about register allocation
>> algorithms but I am curious to know where does that nondeterminism
>> comes from?
> 
> It's not a non-determinism, Windows has different callee-saved registers, and therefore a different allocation order.
> 
> However, there are many equally good solutions to the register allocation problem, and unit tests should not depend on what the register allocator happens to pick (deterministically) today.
> 
> Takumi's fix of this test is not correct, a small change to the register allocator will break it again.

I discussed this with Dan, and it turns out that this function has only one optimal register allocation. All the registers are either ingoing arguments or the return value.

In that case, it is perfectly fine to check for specific registers, and Takumi's fix for the Windows ABI was also OK.

Dan has changed the test to use a fixed triple, so the Windows ABI should no longer be an issue.

/jakob





More information about the llvm-commits mailing list