OLD | NEW |
| (Empty) |
1 ; RUN: llc < %s | |
2 | |
3 ; In theory, the @llvm.lifetime intrinsics shouldn't contradict each other, but | |
4 ; in practice they apparently do sometimes. When they do, we should probably be | |
5 ; conservative. | |
6 | |
7 target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64
:64:64-p:32:32:32-v128:32:128-n32-S128" | |
8 target triple = "asmjs-unknown-emscripten" | |
9 | |
10 ; Don't merge these two allocas, even though lifetime markers may initially | |
11 ; appear to indicate that it's safe, because they also indicate that it's | |
12 ; unsafe. | |
13 | |
14 ; CHECK: foo | |
15 ; CHECK: HEAP8[$p] = 0; | |
16 ; CHECK: HEAP8[$q] = 1; | |
17 define void @foo() nounwind { | |
18 entry: | |
19 %p = alloca i8 | |
20 %q = alloca i8 | |
21 br label %loop | |
22 | |
23 loop: | |
24 call void @llvm.lifetime.end(i64 1, i8* %q) | |
25 store volatile i8 0, i8* %p | |
26 store volatile i8 1, i8* %q | |
27 call void @llvm.lifetime.start(i64 1, i8* %p) | |
28 br i1 undef, label %loop, label %end | |
29 | |
30 end: ; preds = %red | |
31 ret void | |
32 } | |
33 | |
34 declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind | |
35 declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind | |
OLD | NEW |