[llvm-commits] [llvm] r170016 - /llvm/trunk/test/CodeGen/PowerPC/tls-ld-obj.ll

Bill Schmidt wschmidt at linux.vnet.ibm.com
Wed Dec 12 14:42:27 PST 2012


On Wed, 2012-12-12 at 14:07 -0800, Chandler Carruth wrote:
> On Wed, Dec 12, 2012 at 12:29 PM, Bill Schmidt
> <wschmidt at linux.vnet.ibm.com> wrote:
>         Author: wschmidt
>         Date: Wed Dec 12 14:29:20 2012
>         New Revision: 170016
>         
>         URL: http://llvm.org/viewvc/llvm-project?rev=170016&view=rev
>         Log:
>         The ordering of two relocations on the same instruction is
>         apparently not
>         predictable when compiled on at least one non-PowerPC host.
>          Source of
>         nondeterminism not apparent.  Restrict the test to build on
>         PowerPC hosts
>         for now while looking into the issue further.
> 
> 
> Ow, and thanks for finding this!!! Please let folks know if we can
> help track this down. Non-determinism is scary.

Yes, agreed!  I'd be happy to hear about any ideas.  I'm inferring the
reordering as the issue by the offsets in the failure log from
http://bb.pgr.jp/builders/cmake-clang-i686-msvc10/builds/458, which
shows this:

Command 2 Stderr:
E:\bb-win7\cmake-clang-i686-msvc10\llvm-project\llvm\test\CodeGen\PowerPC\tls-ld-obj.ll:35:15: error: CHECK-NEXT: is not on the line after the previous match
; CHECK-NEXT: 'r_sym', 0x[[SYM1]]
              ^
<stdin>:78:3: note: 'next' match was here
 ('r_sym', 0x00000007)
  ^
<stdin>:71:14: note: previous match was here
 (('r_offset', 0x0000000000000010)
             ^

It's off by 7 lines, indicating a different relocation was issued first.
The processing of the fixups that eventually generate the relocations is
definitely deterministic, so it must be somewhere deeper in the
integrated assembly stuff that builds the object file.  I don't know
anything about that code, so any hints would be welcome.

When we've seen nondeterminism in the past (like in the Dwarf debug
output), it's been attributable to using a DenseMap and iterating over
it, which is known to be nondeterministic.  My guess is it's something
similar here.

Bill

>  
>         
>         Modified:
>             llvm/trunk/test/CodeGen/PowerPC/tls-ld-obj.ll
>         
>         Modified: llvm/trunk/test/CodeGen/PowerPC/tls-ld-obj.ll
>         URL:
>         http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/tls-ld-obj.ll?rev=170016&r1=170015&r2=170016&view=diff
>         ==============================================================================
>         --- llvm/trunk/test/CodeGen/PowerPC/tls-ld-obj.ll (original)
>         +++ llvm/trunk/test/CodeGen/PowerPC/tls-ld-obj.ll Wed Dec 12
>         14:29:20 2012
>         @@ -4,6 +4,10 @@
>          ; Test correct relocation generation for thread-local storage
>         using
>          ; the local dynamic model.
>         
>         +; Relocations 2 and 3 seem to come out in unpredictable order
>         on some
>         +; architectures, so restrict this for now.
>         +; REQUIRES: ppc64-registered-target
>         +
>          target datalayout =
>         "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
>          target triple = "powerpc64-unknown-linux-gnu"
>         
>         @@ -17,9 +21,10 @@
>            ret i32 %0
>          }
>         
>         -; Verify generation of R_PPC64_GOT_TLSGD16_HA,
>         R_PPC64_GOT_TLSGD16_LO,
>         -; and R_PPC64_TLSGD for accessing external variable a, and
>         R_PPC64_REL24
>         -; for the call to __tls_get_addr.
>         +; Verify generation of R_PPC64_GOT_TLSLD16_HA,
>         R_PPC64_GOT_TLSLD16_LO,
>         +; R_PPC64_TLSLD, R_PPC64_DTPREL16_HA, and R_PPC64_DTPREL16_LO
>         for
>         +; accessing external variable a, and R_PPC64_REL24 for the
>         call to
>         +; __tls_get_addr.
>          ;
>          ; CHECK:       '.rela.text'
>          ; CHECK:       Relocation 0
>         
>         
>         _______________________________________________
>         llvm-commits mailing list
>         llvm-commits at cs.uiuc.edu
>         http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 





More information about the llvm-commits mailing list