Home | History | Annotate | Download | only in X86
      1 ; RUN: opt < %s -S -codegenprepare -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
      2 
      3 define i64 @test.after(i8 addrspace(1)* readonly align 8) {
      4 ; CHECK-LABEL: test.after
      5 ; CHECK: sunkaddr
      6 entry:
      7   %.0 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 8
      8   %addr = bitcast i8 addrspace(1)* %.0 to i32 addrspace(1)*
      9   br label %header
     10 
     11 header:
     12   %addr.in.loop = phi i32 addrspace(1)* [ %addr, %entry ], [ %addr.after, %header ]
     13   %local_2_ = phi i64 [ 0, %entry ], [ %.9, %header ]
     14   %.7 = load i32, i32 addrspace(1)* %addr.in.loop, align 8
     15   fence acquire
     16   %.1 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 8
     17   %addr.after = bitcast i8 addrspace(1)* %.1 to i32 addrspace(1)*
     18   %.8 = sext i32 %.7 to i64
     19   %.9 = add i64 %local_2_, %.8
     20   %not. = icmp sgt i64 %.9, 999
     21   br i1 %not., label %exit, label %header
     22 
     23 exit:
     24   ret i64 %.9
     25 }
     26