brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · d9fd302 Raw
37 lines · plain
1; RUN: opt -passes=instcombine -S %s | FileCheck %s2 3target datalayout = "e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"4target triple = "i386-apple-darwin9.6"5 6define void @foo(i32) {7; CHECK-LABEL: @foo(8; CHECK: alloca9; CHECK: align 1610	%2 = alloca [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], align 16		; <ptr> [#uses=1]11	%3 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], ptr %2, i32 0, i32 0		; <ptr> [#uses=1]12	%4 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>, ptr %3, i32 0, i32 0		; <ptr> [#uses=1]13	%5 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }, ptr %4, i32 0, i32 0		; <ptr> [#uses=1]14	%6 = getelementptr { [8 x i16] }, ptr %5, i32 0, i32 0		; <ptr> [#uses=1]15	%7 = getelementptr [8 x i16], ptr %6, i32 0, i32 0		; <ptr> [#uses=1]16	store i16 0, ptr %7, align 1617    call void @bar(ptr %7)18	ret void19}20 21declare void @bar(ptr)22 23define void @foo_as1(i32 %a, ptr addrspace(1) %b) {24; CHECK-LABEL: @foo_as1(25; CHECK: align 1626  %1 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], ptr addrspace(1) %b, i32 0, i32 0        ; <ptr> [#uses=1]27  %2 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>, ptr addrspace(1) %1, i32 0, i32 0      ; <ptr> [#uses=1]28  %3 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }, ptr addrspace(1) %2, i32 0, i32 0        ; <ptr> [#uses=1]29  %4 = getelementptr { [8 x i16] }, ptr addrspace(1) %3, i32 0, i32 0     ; <ptr> [#uses=1]30  %5 = getelementptr [8 x i16], ptr addrspace(1) %4, i32 0, i32 0     ; <ptr> [#uses=1]31  store i16 0, ptr addrspace(1) %5, align 1632  call void @bar_as1(ptr addrspace(1) %5)33  ret void34}35 36declare void @bar_as1(ptr addrspace(1))37