| Michael Zolotukhin | 1816d03 | 2016-04-29 03:31:25 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s  -scev-aa -loop-vectorize -print-alias-sets -S  -o - 2>&1 | FileCheck %s | 
|  | 2 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | 
| Michael Zolotukhin | 1816d03 | 2016-04-29 03:31:25 +0000 | [diff] [blame] | 3 |  | 
|  | 4 | ; PR25281 | 
|  | 5 | ; Just check that we don't crash on this test. | 
|  | 6 | ; CHECK-LABEL: @foo | 
|  | 7 | define void @foo(float** noalias nocapture readonly %in, i32* noalias nocapture readonly %isCompressed, float* noalias nocapture readonly %out) { | 
|  | 8 | entry_block: | 
|  | 9 | %tmp = getelementptr float*, float** %in, i32 0 | 
|  | 10 | %in_0 = load float*, float** %tmp, !alias.scope !0 | 
|  | 11 | %tmp1 = getelementptr i32, i32* %isCompressed, i32 0 | 
|  | 12 | %isCompressed_0 = load i32, i32* %tmp1, !alias.scope !1 | 
|  | 13 | %tmp2 = getelementptr float*, float** %in, i32 1 | 
|  | 14 | %in_1 = load float*, float** %tmp2, !alias.scope !2 | 
|  | 15 | %tmp3 = getelementptr i32, i32* %isCompressed, i32 1 | 
|  | 16 | %isCompressed_1 = load i32, i32* %tmp3, !alias.scope !3 | 
|  | 17 | br label %for_each_frames | 
|  | 18 |  | 
|  | 19 | for_each_frames: | 
|  | 20 | %frameIndex = phi i32 [ 0, %entry_block ], [ %nextFrameIndex, %for_each_frames_end ] | 
|  | 21 | %nextFrameIndex = add nuw nsw i32 %frameIndex, 2 | 
|  | 22 | br label %for_each_channel | 
|  | 23 |  | 
|  | 24 | for_each_channel: | 
|  | 25 | %channelIndex = phi i32 [ 0, %for_each_frames ], [ %nextChannelIndex, %for_each_channel ] | 
|  | 26 | %nextChannelIndex = add nuw nsw i32 %channelIndex, 1 | 
|  | 27 | %tmp4 = add i32 %frameIndex, %channelIndex | 
|  | 28 | %tmp5 = xor i32 %isCompressed_0, 1 | 
|  | 29 | %tmp6 = mul i32 %frameIndex, %tmp5 | 
|  | 30 | %offset0 = add i32 %tmp6, %channelIndex | 
|  | 31 | %tmp7 = getelementptr float, float* %in_0, i32 %offset0 | 
|  | 32 | %in_0_index = load float, float* %tmp7, align 4, !alias.scope !4 | 
|  | 33 | %tmp8 = xor i32 %isCompressed_1, 1 | 
|  | 34 | %tmp9 = mul i32 %frameIndex, %tmp8 | 
|  | 35 | %offset1 = add i32 %tmp9, %channelIndex | 
|  | 36 | %tmp10 = getelementptr float, float* %in_1, i32 %offset1 | 
|  | 37 | %in_1_index = load float, float* %tmp10, align 4, !alias.scope !5 | 
|  | 38 | %tmp11 = fadd float %in_0_index, %in_1_index | 
|  | 39 | %tmp12 = getelementptr float, float* %out, i32 %tmp4 | 
|  | 40 | store float %tmp11, float* %tmp12, align 4, !alias.noalias !6 | 
|  | 41 | %tmp13 = icmp eq i32 %nextChannelIndex, 2 | 
|  | 42 | br i1 %tmp13, label %for_each_frames_end, label %for_each_channel | 
|  | 43 |  | 
|  | 44 | for_each_frames_end: | 
|  | 45 | %tmp14 = icmp eq i32 %nextFrameIndex, 512 | 
|  | 46 | br i1 %tmp14, label %return, label %for_each_frames | 
|  | 47 |  | 
|  | 48 | return: | 
|  | 49 | ret void | 
|  | 50 | } | 
|  | 51 |  | 
|  | 52 | !0 = distinct !{!0} | 
|  | 53 | !1 = distinct !{!1, !0} | 
|  | 54 | !2 = distinct !{!2, !0} | 
|  | 55 | !3 = distinct !{!3, !0} | 
|  | 56 | !4 = distinct !{!4, !0} | 
|  | 57 | !5 = distinct !{!5, !0} | 
|  | 58 | !6 = !{!2, !3, !4, !5, !1} |