brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 765b59c Raw
53 lines · plain
1; A store or load cannot alias a global if the accessed amount is larger then2; the global.3 4; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn -S | FileCheck %s5target datalayout = "E-p:64:64:64-p1:16:16:16-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"6 7@B = global i16 88 9; CHECK-LABEL: @test1(10define i16 @test1(ptr %P) {11        %X = load i16, ptr @B12        store i32 7, ptr %P13        %Y = load i16, ptr @B14        %Z = sub i16 %Y, %X15        ret i16 %Z16; CHECK: ret i16 017}18 19@B_as1 = addrspace(1) global i16 820 21define i16 @test1_as1(ptr addrspace(1) %P) {22; CHECK-LABEL: @test1_as1(23; CHECK: ret i16 024  %X = load i16, ptr addrspace(1) @B_as125  store i32 7, ptr addrspace(1) %P26  %Y = load i16, ptr addrspace(1) @B_as127  %Z = sub i16 %Y, %X28  ret i16 %Z29}30 31; Cannot know anything about the size of this global.32; rdar://881341533@window = external global [0 x i8]34 35; CHECK-LABEL: @test2(36define i8 @test2(i32 %tmp79, i32 %w.2, i32 %indvar89) nounwind {37  %tmp92 = add i32 %tmp79, %indvar8938  %arrayidx412 = getelementptr [0 x i8], ptr @window, i32 0, i32 %tmp9239  %tmp93 = add i32 %w.2, %indvar8940  %arrayidx416 = getelementptr [0 x i8], ptr @window, i32 0, i32 %tmp9341 42  %A = load i8, ptr %arrayidx412, align 143  store i8 4, ptr %arrayidx416, align 144 45  %B = load i8, ptr %arrayidx412, align 146  %C = sub i8 %A, %B47  ret i8 %C48 49; CHECK: %B = load i850; CHECK: ret i8 %C51}52 53