[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 14:19:43 PDT 2011


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.

See test/CodeGen/X86/abi-isel.ll for examples of using FileCheck variables to avoid this problem.

/jakob





More information about the llvm-commits mailing list