Skip to content
This repository was archived by the owner on Apr 4, 2022. It is now read-only.

The different order of the compilation members results in the different compilation file. #56

Open
MaggieYingYi opened this issue Oct 17, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@MaggieYingYi
Copy link

This is spin-off from the #22 (comment).

@MaggieYingYi
Copy link
Author

Considering the test.ll.

–test.ll-
target triple = "x86_64-pc-linux-gnu-repo"
define internal i32 @C() {
entry:
  ret i32 1
}
define internal i32 @B() {
entry:
  %call = call i32 @C()
  ret i32 %call
}
define i32 @A() !repo_ticket !0 {
entry:
  %call = call i32 @B()
  ret i32 %call
}
!repo.tickets = !{!0}
!0 = !TicketNode(name: "A", digest: [16 x i8]  c"\82k\8AM\E0$d\05v\B1\AC\D8\ACdG\DB", linkage: external, pruned: false)

Compile 'test.ll' (first time) and dump the compilation of 'test.o':

$ rm clang.db
$ llc -mtriple="x86_64-pc-linux-gnu-repo" -filetype=obj test.ll -o test.o
$ repo-ticket-dump test.o
ac680130edeaf37725b621456709f5cb
$ pstore-dump --compilation=ac680130edeaf37725b621456709f5cb clang.db
---
- file         :
      path : clang.db
      size : 4194304
  compilations :
      - digest      : ac680130edeaf37725b621456709f5cb
        compilation :
            members :
                - digest  : db4764acd8acb176056424e04d8a6b82
                  fext    : { addr: 368, size: 104 }
                  name    : A
                  linkage : external
                - digest  : 1a907d11b14d9f2a556c4bd21d0f2334
                  fext    : { addr: 288, size: 46 }
                  name    : C
                  linkage : internal
                - digest  : e21c03c3bbb88b18c5c861c2109294f4
                  fext    : { addr: 512, size: 104 }
                  name    : B
                  linkage : internal
            path    : \\\\?\\C:\\MyWork\\repo_bug\\issue22\\case2
            triple  : x86_64-pc-linux-gnu-repo
...

Compile 'test.ll' (second time) again and dump the compilation of 'test.2.o':

$ clang -O3 -c --target=x86_64-pc-linux-gnu-repo -x ir test.ll -o test.2.o
$ repo-ticket-dump test.2.o
c1d3004a91283a7884a67261b34fb516 
$ pstore-dump --compilation=c1d3004a91283a7884a67261b34fb516 clang.db
---
- file         :
      path : clang.db
      size : 4194304
  compilations :
      - digest      : c1d3004a91283a7884a67261b34fb516
        compilation :
            members :
                - digest  : db4764acd8acb176056424e04d8a6b82
                  fext    : { addr: 368, size: 104 }
                  name    : A
                  linkage : external
                - digest  : e21c03c3bbb88b18c5c861c2109294f4
                  fext    : { addr: 512, size: 104 }
                  name    : B
                  linkage : internal
                - digest  : 1a907d11b14d9f2a556c4bd21d0f2334
                  fext    : { addr: 288, size: 46 }
                  name    : C
                  linkage : internal
            path    : \\\\?\\C:\\MyWork\\repo_bug\\issue22\\case2
            triple  : x86_64-pc-linux-gnu-repo
...

We could see: two compilation files (test.o and test.2.o) contains the same compilation members with the same digest, name and linkage but in the different order. The different order of the compilation members caused the different compilation file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants