diff options
author | Dan Gohman <sunfish@google.com> | 2014-02-13 19:02:20 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@google.com> | 2014-02-14 11:38:16 -0800 |
commit | f3359807242e95f9e94bb35c0d90a73c794f1af0 (patch) | |
tree | fd0aec9771d0f1d1713e0abc77c0575349237b21 /test | |
parent | 3b35f56469fb3a5b15fc0fc77e51c9603b1f9c24 (diff) |
Preserve alignment information when splitting loads and stores.
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/NaCl/expand-i64.ll | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/Transforms/NaCl/expand-i64.ll b/test/Transforms/NaCl/expand-i64.ll index df4804d19b..fd468fc6d1 100644 --- a/test/Transforms/NaCl/expand-i64.ll +++ b/test/Transforms/NaCl/expand-i64.ll @@ -217,6 +217,21 @@ define i64 @load(i64 *%a) { ret i64 %c } +; CHECK: define i32 @aligned_load(i64* %a) { +; CHECK: %1 = ptrtoint i64* %a to i32 +; CHECK: %2 = inttoptr i32 %1 to i32* +; CHECK: %3 = load i32* %2, align 16 +; CHECK: %4 = add i32 %1, 4 +; CHECK: %5 = inttoptr i32 %4 to i32* +; CHECK: %6 = load i32* %5, align 4 +; CHECK: call void @setHigh32(i32 %6) +; CHECK: ret i32 %3 +; CHECK: } +define i64 @aligned_load(i64 *%a) { + %c = load i64* %a, align 16 + ret i64 %c +} + ; CHECK: define void @store(i64* %a, i32, i32) { ; CHECK: %3 = ptrtoint i64* %a to i32 ; CHECK: %4 = inttoptr i32 %3 to i32* @@ -231,6 +246,20 @@ define void @store(i64 *%a, i64 %b) { ret void } +; CHECK: define void @aligned_store(i64* %a, i32, i32) { +; CHECK: %3 = ptrtoint i64* %a to i32 +; CHECK: %4 = inttoptr i32 %3 to i32* +; CHECK: store i32 %0, i32* %4, align 16 +; CHECK: %5 = add i32 %3, 4 +; CHECK: %6 = inttoptr i32 %5 to i32* +; CHECK: store i32 %1, i32* %6, align 4 +; CHECK: ret void +; CHECK: } +define void @aligned_store(i64 *%a, i64 %b) { + store i64 %b, i64* %a, align 16 + ret void +} + ; CHECK: define i32 @call(i32, i32) { ; CHECK: %3 = call i32 @foo(i32 %0, i32 %1) ; CHECK: %4 = call i32 @getHigh32() |