ignore-lifetime.ll 713 B

1234567891011121314151617181920212223242526
  1. ; RUN: opt -mem2reg -S -o - < %s | FileCheck %s
  2. declare void @llvm.lifetime.start(i64 %size, i8* nocapture %ptr)
  3. declare void @llvm.lifetime.end(i64 %size, i8* nocapture %ptr)
  4. define void @test1() {
  5. ; CHECK: test1
  6. ; CHECK-NOT: alloca
  7. %A = alloca i32
  8. %B = bitcast i32* %A to i8*
  9. call void @llvm.lifetime.start(i64 2, i8* %B)
  10. store i32 1, i32* %A
  11. call void @llvm.lifetime.end(i64 2, i8* %B)
  12. ret void
  13. }
  14. define void @test2() {
  15. ; CHECK: test2
  16. ; CHECK-NOT: alloca
  17. %A = alloca {i8, i16}
  18. %B = getelementptr {i8, i16}, {i8, i16}* %A, i32 0, i32 0
  19. call void @llvm.lifetime.start(i64 2, i8* %B)
  20. store {i8, i16} zeroinitializer, {i8, i16}* %A
  21. call void @llvm.lifetime.end(i64 2, i8* %B)
  22. ret void
  23. }