-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
memset doesn't extend the deref check to a multiple of alignment
According to LangRef, although this is incompatible with load/store semantics
- Loading branch information
1 parent
a95b207
commit 74bd584
Showing
5 changed files
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
define void @src(ptr %P) { | ||
%arrayidx = getelementptr inbounds i32, ptr %P, i64 1 | ||
store i32 0, ptr %arrayidx, align 4 | ||
%add.ptr = getelementptr inbounds i32, ptr %P, i64 2 | ||
tail call void @llvm.memset.p0.i64(ptr %add.ptr, i8 0, i64 11, i1 false) | ||
ret void | ||
} | ||
|
||
define void @tgt(ptr %P) { | ||
%arrayidx = getelementptr inbounds i8, ptr %P, i64 4 | ||
tail call void @llvm.memset.p0.i64(ptr align(4) %arrayidx, i8 0, i64 15, i1 false) | ||
ret void | ||
} | ||
|
||
declare void @llvm.memset.p0.i64(ptr, i8, i64, i1) |