lifetime.ll 604 B

1234567891011121314151617181920212223242526272829
  1. ; RUN: opt < %s -simplifycfg -S | FileCheck %s
  2. ; Test that a lifetime intrinsic isn't removed because that would change semantics
  3. ; CHECK: foo
  4. ; CHECK: entry:
  5. ; CHECK: bb0:
  6. ; CHECK: bb1:
  7. ; CHECK: ret
  8. define void @foo(i1 %x) {
  9. entry:
  10. %a = alloca i8
  11. call void @llvm.lifetime.start(i64 -1, i8* %a) nounwind
  12. br i1 %x, label %bb0, label %bb1
  13. bb0:
  14. call void @llvm.lifetime.end(i64 -1, i8* %a) nounwind
  15. br label %bb1
  16. bb1:
  17. call void @f()
  18. ret void
  19. }
  20. declare void @f()
  21. declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind
  22. declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind