brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.1 KiB · f42101f Raw
178 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 62; RUN: opt < %s -O3 -S                   | FileCheck %s3; RUN: opt < %s -passes="default<O3>" -S | FileCheck %s4 5; LoopFullUnrollPass will not preform non-full unrolling,6; yet until we unroll at least 2x,7; the loads/stores into `%i3 = alloca %t0, align 4`8; happen at non-constant indexes.9 10target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"11target triple = "x86_64-pc-linux-gnu"12 13%t0 = type { [2 x i32] }14 15$_ZNSt5arrayIiLm2EEixEm = comdat any16 17$_ZNSt14__array_traitsIiLm2EE6_S_refERA2_Kim = comdat any18 19@global = private unnamed_addr constant %t0 { [2 x i32] [i32 24, i32 42] }, align 420 21; Function Attrs: mustprogress nounwind uwtable22define dso_local void @foo(i32 noundef %arg, ptr noundef nonnull align 4 dereferenceable(8) %arg1) #0 {23; CHECK-LABEL: define dso_local void @foo(24; CHECK-SAME: i32 noundef [[ARG:%.*]], ptr noundef nonnull writeonly align 4 captures(none) dereferenceable(8) [[ARG1:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {25; CHECK-NEXT:  [[BB:.*]]:26; CHECK-NEXT:    [[I9:%.*]] = sdiv i32 [[ARG]], 12827; CHECK-NEXT:    [[I10:%.*]] = shl nsw i32 [[I9]], 728; CHECK-NEXT:    [[ARG_OFF:%.*]] = add i32 [[ARG]], 12729; CHECK-NEXT:    [[TMP0:%.*]] = icmp ult i32 [[ARG_OFF]], 25530; CHECK-NEXT:    br i1 [[TMP0]], label %[[BB12:.*]], label %[[BB13:.*]]31; CHECK:       [[BB12_LOOPEXIT:.*]]:32; CHECK-NEXT:    [[I3_SROA_8_0_INSERT_EXT:%.*]] = zext i32 [[I21_3:%.*]] to i6433; CHECK-NEXT:    [[I3_SROA_8_0_INSERT_SHIFT:%.*]] = shl nuw i64 [[I3_SROA_8_0_INSERT_EXT]], 3234; CHECK-NEXT:    [[I3_SROA_0_0_INSERT_EXT:%.*]] = zext i32 [[I21_2:%.*]] to i6435; CHECK-NEXT:    [[I3_SROA_0_0_INSERT_INSERT:%.*]] = or disjoint i64 [[I3_SROA_8_0_INSERT_SHIFT]], [[I3_SROA_0_0_INSERT_EXT]]36; CHECK-NEXT:    br label %[[BB12]]37; CHECK:       [[BB12]]:38; CHECK-NEXT:    [[TMP1:%.*]] = phi i64 [ [[I3_SROA_0_0_INSERT_INSERT]], %[[BB12_LOOPEXIT]] ], [ 180388626456, %[[BB]] ]39; CHECK-NEXT:    store i64 [[TMP1]], ptr [[ARG1]], align 4, !tbaa [[CHAR_TBAA5:![0-9]+]]40; CHECK-NEXT:    ret void41; CHECK:       [[BB13]]:42; CHECK-NEXT:    [[I3_SROA_8_0:%.*]] = phi i32 [ [[I21_3]], %[[BB13]] ], [ 42, %[[BB]] ]43; CHECK-NEXT:    [[I3_SROA_0_0:%.*]] = phi i32 [ [[I21_2]], %[[BB13]] ], [ 24, %[[BB]] ]44; CHECK-NEXT:    [[I4_05:%.*]] = phi i32 [ [[I24_3:%.*]], %[[BB13]] ], [ 0, %[[BB]] ]45; CHECK-NEXT:    [[I21:%.*]] = mul nsw i32 [[I3_SROA_0_0]], [[I4_05]]46; CHECK-NEXT:    [[I24:%.*]] = or disjoint i32 [[I4_05]], 147; CHECK-NEXT:    [[I21_1:%.*]] = mul nsw i32 [[I3_SROA_8_0]], [[I24]]48; CHECK-NEXT:    [[I24_1:%.*]] = or disjoint i32 [[I4_05]], 249; CHECK-NEXT:    [[I21_2]] = mul nsw i32 [[I21]], [[I24_1]]50; CHECK-NEXT:    [[I24_2:%.*]] = or disjoint i32 [[I4_05]], 351; CHECK-NEXT:    [[I21_3]] = mul nsw i32 [[I21_1]], [[I24_2]]52; CHECK-NEXT:    [[I24_3]] = add nuw nsw i32 [[I4_05]], 453; CHECK-NEXT:    [[I11_NOT_3:%.*]] = icmp eq i32 [[I24_3]], [[I10]]54; CHECK-NEXT:    br i1 [[I11_NOT_3]], label %[[BB12_LOOPEXIT]], label %[[BB13]], !llvm.loop [[LOOP8:![0-9]+]]55;56bb:57  %i = alloca i32, align 458  %i2 = alloca ptr, align 859  %i3 = alloca %t0, align 460  %i4 = alloca i32, align 461  %i5 = alloca ptr, align 862  store i32 %arg, ptr %i, align 4, !tbaa !563  store ptr %arg1, ptr %i2, align 8, !tbaa !964  call void @llvm.lifetime.start.p0(ptr %i3) #365  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %i3, ptr align 4 @global, i64 8, i1 false)66  call void @llvm.lifetime.start.p0(ptr %i4) #367  store i32 0, ptr %i4, align 4, !tbaa !568  br label %bb669 70bb6:                                              ; preds = %bb22, %bb71  %i7 = load i32, ptr %i4, align 4, !tbaa !572  %i8 = load i32, ptr %i, align 4, !tbaa !573  %i9 = sdiv i32 %i8, 12874  %i10 = mul nsw i32 128, %i975  %i11 = icmp ne i32 %i7, %i1076  br i1 %i11, label %bb13, label %bb1277 78bb12:                                             ; preds = %bb679  call void @llvm.lifetime.end.p0(ptr %i4) #380  br label %bb2581 82bb13:                                             ; preds = %bb683  call void @llvm.lifetime.start.p0(ptr %i5) #384  %i14 = load i32, ptr %i4, align 4, !tbaa !585  %i15 = srem i32 %i14, 286  %i16 = sext i32 %i15 to i6487  %i17 = call noundef nonnull align 4 dereferenceable(4) ptr @wibble(ptr noundef nonnull align 4 dereferenceable(8) %i3, i64 noundef %i16) #388  store ptr %i17, ptr %i5, align 8, !tbaa !989  %i18 = load i32, ptr %i4, align 4, !tbaa !590  %i19 = load ptr, ptr %i5, align 8, !tbaa !991  %i20 = load i32, ptr %i19, align 4, !tbaa !592  %i21 = mul nsw i32 %i20, %i1893  store i32 %i21, ptr %i19, align 4, !tbaa !594  call void @llvm.lifetime.end.p0(ptr %i5) #395  br label %bb2296 97bb22:                                             ; preds = %bb1398  %i23 = load i32, ptr %i4, align 4, !tbaa !599  %i24 = add nsw i32 %i23, 1100  store i32 %i24, ptr %i4, align 4, !tbaa !5101  br label %bb6, !llvm.loop !11102 103bb25:                                             ; preds = %bb12104  %i26 = load ptr, ptr %i2, align 8, !tbaa !9105  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %i26, ptr align 4 %i3, i64 8, i1 false), !tbaa.struct !13106  call void @llvm.lifetime.end.p0(ptr %i3) #3107  ret void108}109 110; Function Attrs: argmemonly nocallback nofree nosync nounwind willreturn111declare void @llvm.lifetime.start.p0(ptr nocapture) #1112 113; Function Attrs: argmemonly nocallback nofree nounwind willreturn114declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2115 116; Function Attrs: mustprogress nounwind uwtable117define linkonce_odr dso_local noundef nonnull align 4 dereferenceable(4) ptr @wibble(ptr noundef nonnull align 4 dereferenceable(8) %arg, i64 noundef %arg1) #0 comdat($_ZNSt5arrayIiLm2EEixEm) align 2 {118bb:119  %i = alloca ptr, align 8120  %i2 = alloca i64, align 8121  store ptr %arg, ptr %i, align 8, !tbaa !9122  store i64 %arg1, ptr %i2, align 8, !tbaa !15123  %i3 = load ptr, ptr %i, align 8124  %i5 = load i64, ptr %i2, align 8, !tbaa !15125  %i6 = call noundef nonnull align 4 dereferenceable(4) ptr @widget(ptr noundef nonnull align 4 dereferenceable(8) %i3, i64 noundef %i5) #3126  ret ptr %i6127}128 129; Function Attrs: argmemonly nocallback nofree nosync nounwind willreturn130declare void @llvm.lifetime.end.p0(ptr nocapture) #1131 132; Function Attrs: mustprogress nounwind uwtable133define linkonce_odr dso_local noundef nonnull align 4 dereferenceable(4) ptr @widget(ptr noundef nonnull align 4 dereferenceable(8) %arg, i64 noundef %arg1) #0 comdat($_ZNSt14__array_traitsIiLm2EE6_S_refERA2_Kim) align 2 {134bb:135  %i = alloca ptr, align 8136  %i2 = alloca i64, align 8137  store ptr %arg, ptr %i, align 8, !tbaa !9138  store i64 %arg1, ptr %i2, align 8, !tbaa !15139  %i3 = load ptr, ptr %i, align 8, !tbaa !9140  %i4 = load i64, ptr %i2, align 8, !tbaa !15141  %i5 = getelementptr inbounds [2 x i32], ptr %i3, i64 0, i64 %i4142  ret ptr %i5143}144 145attributes #0 = { mustprogress nounwind uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }146attributes #1 = { argmemonly nocallback nofree nosync nounwind willreturn }147attributes #2 = { argmemonly nocallback nofree nounwind willreturn }148attributes #3 = { nounwind }149 150!llvm.module.flags = !{!0, !1, !2, !3}151!llvm.ident = !{!4}152 153!0 = !{i32 1, !"wchar_size", i32 4}154!1 = !{i32 8, !"PIC Level", i32 2}155!2 = !{i32 7, !"PIE Level", i32 2}156!3 = !{i32 7, !"uwtable", i32 2}157!4 = !{!"Debian clang version 16.0.0-++20221024100939+996267d20ea0-1~exp1~20221024221046.844"}158!5 = !{!6, !6, i64 0}159!6 = !{!"int", !7, i64 0}160!7 = !{!"omnipotent char", !8, i64 0}161!8 = !{!"Simple C++ TBAA"}162!9 = !{!10, !10, i64 0}163!10 = !{!"any pointer", !7, i64 0}164!11 = distinct !{!11, !12}165!12 = !{!"llvm.loop.mustprogress"}166!13 = !{i64 0, i64 8, !14}167!14 = !{!7, !7, i64 0}168!15 = !{!16, !16, i64 0}169!16 = !{!"long", !7, i64 0}170;.171; CHECK: [[CHAR_TBAA5]] = !{[[META6:![0-9]+]], [[META6]], i64 0}172; CHECK: [[META6]] = !{!"omnipotent char", [[META7:![0-9]+]], i64 0}173; CHECK: [[META7]] = !{!"Simple C++ TBAA"}174; CHECK: [[LOOP8]] = distinct !{[[LOOP8]], [[META9:![0-9]+]], [[META10:![0-9]+]]}175; CHECK: [[META9]] = !{!"llvm.loop.mustprogress"}176; CHECK: [[META10]] = !{!"llvm.loop.isvectorized", i32 1}177;.178