-
Notifications
You must be signed in to change notification settings - Fork 149
Patched #1242 #1293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Patched #1242 #1293
Changes from all commits
0dadb5b
2d33163
27be9f1
6d82f87
eee1999
030b7e4
2069c9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1207,7 +1207,10 @@ static expr mk_store(expr mem, const expr &offset, const expr &val) { | |
|
|
||
| TypedByte Memory::raw_load(bool local, unsigned bid, const expr &offset) const { | ||
| auto &block = (local ? local_block_val : non_local_block_val)[bid]; | ||
| return { Byte(*this, ::raw_load(block.val, offset)), DataType(block.type) }; | ||
| expr alive = isBlockAlive(expr::mkUInt(bid, Pointer::bitsShortBid()), local); | ||
| return { Byte(*this, mkIf_fold(alive, ::raw_load(block.val, offset), | ||
| Byte::mkPoisonByte(*this)())), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. align |
||
| DataType(block.type) }; | ||
| } | ||
|
|
||
| vector<TypedByte> | ||
|
|
@@ -1234,7 +1237,10 @@ Memory::load(const Pointer &ptr, unsigned bytes, set<expr> &undef, | |
| assert(idx < blk_size); | ||
| uint64_t max_idx = blk_size - bytes + idx; | ||
| expr off = blk_offset + expr::mkUInt(idx, offset); | ||
| loaded[i].first.add(::raw_load(blk.val, off, max_idx), cond); | ||
| expr is_alive = isBlockAlive(expr::mkUInt(bid, Pointer::bitsShortBid()), local); | ||
| loaded[i].first.add(mkIf_fold(is_alive, ::raw_load(blk.val, off, max_idx), | ||
| poison), | ||
| cond); | ||
| loaded[i].second |= blk.type; | ||
| } | ||
| undef.insert(blk.undef.begin(), blk.undef.end()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -539,7 +539,9 @@ Pointer::isDereferenceable(const expr &bytes0, uint64_t align, | |
| expr bytes = bytes0.zextOrTrunc(bits_for_offset); | ||
|
|
||
| auto block_constraints = [&](const Pointer &p) { | ||
| expr ret = p.isBlockAlive(); | ||
| expr ret = expr::mkIf(p.isStackAllocated(), | ||
| (iswrite || is_asm) ? p.isBlockAlive() : true, | ||
| p.isBlockAlive()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. simplify to |
||
| if (iswrite) | ||
| ret &= p.isWritable() && !p.isNoWrite(); | ||
| else if (!ignore_accessability) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,32 @@ | ||
| @glb = global ptr null | ||
| declare ptr @f(ptr %p) | ||
|
|
||
| declare void @llvm.lifetime.start(i64, ptr captures(none)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why these changes? |
||
| declare void @llvm.lifetime.end(i64, ptr captures(none)) | ||
|
|
||
| define i8 @src() { | ||
| %p = alloca i8 | ||
| call void @llvm.lifetime.start(i64 1, ptr %p) | ||
| store i8 1, ptr %p | ||
|
|
||
| %q = load ptr, ptr @glb | ||
| %q2 = call ptr @f(ptr %q) ; cannot be %p | ||
| store i8 2, ptr %q2 | ||
|
|
||
| %v = load i8, ptr %p | ||
| call void @llvm.lifetime.end(i64 1, ptr %p) | ||
| ret i8 %v | ||
| } | ||
|
|
||
| define i8 @tgt() { | ||
| %p = alloca i8 | ||
| call void @llvm.lifetime.start(i64 1, ptr %p) | ||
| store i8 1, ptr %p | ||
|
|
||
| %q = load ptr, ptr @glb | ||
| %q2 = call ptr @f(ptr %q) ; cannot be %p | ||
| store i8 2, ptr %q2 | ||
|
|
||
| call void @llvm.lifetime.end(i64 1, ptr %p) | ||
| ret i8 1 | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| define void @src(ptr %0, i1 %1) { | ||
| %3 = alloca i64, align 8 | ||
| call void @llvm.lifetime.start(i64 8, ptr %3) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why these changes? |
||
| store ptr null, ptr %0, align 8 | ||
| call void @fn() | ||
| br i1 %1, label %4, label %5 | ||
|
|
||
| 4: | ||
| call void @llvm.lifetime.end(i64 8, ptr %3) | ||
| ret void | ||
|
|
||
| 5: | ||
| store i64 0, ptr %3, align 8 | ||
| call void @llvm.lifetime.end(i64 8, ptr %3) | ||
| ret void | ||
| } | ||
|
|
||
|
|
@@ -19,3 +22,5 @@ define void @tgt(ptr %0, i1 %1) { | |
| } | ||
|
|
||
| declare void @fn() | ||
| declare void @llvm.lifetime.start(i64, ptr captures(none)) | ||
| declare void @llvm.lifetime.end(i64, ptr captures(none)) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ; ERROR: Source is more defined than target | ||
|
|
||
| define i8 @src() { | ||
| %p = alloca i8 | ||
| call void @llvm.lifetime.start.p0(ptr %p) | ||
| call void @llvm.lifetime.end.p0(ptr %p) | ||
| %v = load i8, ptr %p | ||
| ret i8 %v | ||
| } | ||
|
|
||
| define i8 @tgt() { | ||
| unreachable | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?