-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #937: infer alignment of some memory ops during preprocessing
This allows more efficient memory encodings
- Loading branch information
1 parent
a6205b6
commit 612737a
Showing
5 changed files
with
173 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; TEST-ARGS: -dbg | ||
|
||
define void @src() { | ||
%p = alloca i64, align 4 | ||
store i32 0, ptr %p, align 1 | ||
%p2 = call ptr @llvm.ptrmask(ptr %p, i64 -8) | ||
store i32 0, ptr %p2, align 4 | ||
ret void | ||
} | ||
|
||
define void @tgt() { | ||
%p = alloca i64, align 4 | ||
store i32 0, ptr %p, align 4 | ||
%p2 = call ptr @llvm.ptrmask(ptr %p, i64 -8) | ||
store i32 0, ptr %p2, align 8 | ||
ret void | ||
} | ||
|
||
declare ptr @llvm.ptrmask(ptr, i64) | ||
|
||
; CHECK: bits_byte: 32 |
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,37 @@ | ||
; TEST-ARGS: -dbg | ||
|
||
define void @src() { | ||
entry: | ||
%p = alloca i64, align 4 | ||
br label %loop | ||
|
||
loop: | ||
%p2 = phi ptr [ %p, %entry ], [ %p3, %loop ] | ||
store i16 0, ptr %p2, align 1 | ||
%p3 = getelementptr i8, ptr %p2, i64 2 | ||
%cond = call i1 @cond() | ||
br i1 %cond, label %loop, label %exit | ||
|
||
exit: | ||
ret void | ||
} | ||
|
||
define void @tgt() { | ||
entry: | ||
%p = alloca i64, align 4 | ||
br label %loop | ||
|
||
loop: | ||
%p2 = phi ptr [ %p, %entry ], [ %p3, %loop ] | ||
store i16 0, ptr %p2, align 2 | ||
%p3 = getelementptr i8, ptr %p2, i64 2 | ||
%cond = call i1 @cond() | ||
br i1 %cond, label %loop, label %exit | ||
|
||
exit: | ||
ret void | ||
} | ||
|
||
declare i1 @cond() | ||
|
||
; CHECK: bits_byte: 16 |
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