atomic.ll 703 B

1234567891011121314151617181920212223
  1. ; RUN: opt -basicaa -functionattrs -S < %s | FileCheck %s
  2. ; Atomic load/store to local doesn't affect whether a function is
  3. ; readnone/readonly.
  4. define i32 @test1(i32 %x) uwtable ssp {
  5. ; CHECK: define i32 @test1(i32 %x) #0 {
  6. entry:
  7. %x.addr = alloca i32, align 4
  8. store atomic i32 %x, i32* %x.addr seq_cst, align 4
  9. %r = load atomic i32, i32* %x.addr seq_cst, align 4
  10. ret i32 %r
  11. }
  12. ; A function with an Acquire load is not readonly.
  13. define i32 @test2(i32* %x) uwtable ssp {
  14. ; CHECK: define i32 @test2(i32* nocapture readonly %x) #1 {
  15. entry:
  16. %r = load atomic i32, i32* %x seq_cst, align 4
  17. ret i32 %r
  18. }
  19. ; CHECK: attributes #0 = { readnone ssp uwtable }
  20. ; CHECK: attributes #1 = { ssp uwtable }