Comments (8)
There are three issues in the test.
- The redundant tickets are show in the .repo.tickets metadata.
- The function hash calculation is wrong.
- The linkage type of global variable .str has been changed from private to external, which is wrong.
from llvm-prepo.
Issue 1: trimming the test, compile the following llvm IR code.
target triple = "x86_64-pc-linux-gnu-repo"
@.str = private unnamed_addr constant [13 x i8] c"Hello World\0A\00", align 1, !repo_ticket !0
define i32 @main() !repo_ticket !1 {
entry:
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0))
ret i32 0
}
declare i32 @printf(i8*, ...)
!repo.tickets = !{!0, !1}
!0 = !TicketNode(name: ".str", digest: [16 x i8] c"\D9Wq;\E9\B1\8Dh\E7\19\10\EE\A3!\EB\B7", linkage: private)
!1 = !TicketNode(name: "main", digest: [16 x i8] c"Z+i~nP8[\01\EE\BC\03ol\FCB", linkage: external)
using
opt test.ll -S -o test1.ll
The output test1.ll is shown below.
; ModuleID = 'repo_redundant_tickets.ll'
source_filename = "repo_redundant_tickets.ll"
target triple = "x86_64-pc-linux-gnu-repo"
@.str = external unnamed_addr constant [13 x i8], align 1, !repo_ticket !0
declare !repo_ticket !1 i32 @main()
declare i32 @printf(i8*, ...)
!repo.tickets = !{!0, !1, !0, !1}
!0 = !TicketNode(name: ".str", digest: [16 x i8] c"\D9Wq;\E9\B1\8Dh\E7\19\10\EE\A3!\EB\B7", linkage: private)
!1 = !TicketNode(name: "main", digest: [16 x i8] c"Z+i~nP8[\01\EE\BC\03ol\FCB", linkage: external)
The redundant metadata !0 and !1 are in the !repo.tickets metadata.
from llvm-prepo.
Fixed in my local branch.
Branch name: llvm-prepo-13
git commit: cc2ed542.
from llvm-prepo.
The second issue: the 'insertvalue' instruction hash is calculated incorrectly,
Compile the following llvm IR code.
target triple = "x86_64-pc-linux-gnu-repo"
@.str = private unnamed_addr constant [9 x i8] c"test.cpp\00", align 1, !repo_ticket !0
define internal void @__cxx_global_var_init() section ".text.startup" personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !repo_ticket !1 {
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
%exn = load i8*, i8** %exn.slot, align 8
%sel = load i32, i32* %ehselector.slot, align 4
%lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0
%lpad.val1 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1
resume { i8*, i32 } %lpad.val1
}
declare i32 @__gxx_personality_v0(...)
!0 = !TicketNode(name: ".str", digest: [16 x i8] c"8\8A\98\B1^\AA\F0\06\01F\8E\AE\8F\14\BDK", linkage: private)
!1 = !TicketNode(name: "__cxx_global_var_init", digest: [16 x i8] c"\C7\96\DE\14\8C\01\EB \0F<8h\11-\BC7", linkage: internal)
using
opt.exe test.ll -S -o test1.ll
when you run opt.exe command, the hash value of __cxx_global_var_init function is not stable (varies).
from llvm-prepo.
Fixed in my local branch.
Branch name: llvm-prepo-13
git commit: 04c35a7820ad6
from llvm-prepo.
During the repository pruning pass, we can not change the linkage type of global variable .str from private to external. If the linkage type is private, the symbol name will change from .str to .L.str. If we change the linkage type to external, the symbal name will keep the same that is '.str'. It is wrong.
Fixed in my local branch.
Branch name: llvm-prepo-13
git commit: 6d57163d1f87b
from llvm-prepo.
Fixed in git commit: f759454 and 9665035.
from llvm-prepo.
For clang project, the mangling component in the repo datalayout string need to change from '-m:e' to '-m:r'. We will put the clang project in the github.
from llvm-prepo.
Related Issues (20)
- Switch ticket files from UUID to digest of contents
- Assertion failed: Val && "isa<> used on a null pointer" HOT 2
- Ticket file digests are different between two time builds HOT 2
- Ticket file digests (the pstore_mcrepo/fragment.cpp) are different between two time builds HOT 2
- Optimizing the llvm-prepo compiler to reduce user project build time HOT 5
- llvm-prepo: Incorrect hash calculation for the ‘CallInst’ instruction. HOT 2
- Incorrect hash calculation for llvm.global_ctors HOT 2
- Undefined reference to 'str' HOT 1
- UNREACHABLE executed at /mnt/e/work/prepo/llvm/lib/IR/RepoHashCalculator.cpp:131! HOT 2
- Update this project to the upstream LLVM 8.0 HOT 1
- Incorrect fragment generation for same functions in the translation unit. HOT 2
- Accumulate the debug line information to the repo hash calculation.
- Use 'available_externally' linkage in the RepoPruning pass
- Fatal error: invalid linkage for intrinsic global variable
- Store the target triple in the compilation record HOT 2
- llvm-prepo test: the pstore unit and system tests HOT 1
- Incorrect hash calculation for a global object (GO) that calls another GO with an available_externally linkage type. HOT 1
- Automatically setup repo toolchain and build and run tests HOT 2
- The MC object writer and repo2obj treat a bss section as a special section HOT 1
- Clean up the debug_line branch and merge it back to the master branch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llvm-prepo.