260 lines · plain
1; RUN: opt < %s -passes=loop-interchange --pass-remarks-missed=loop-interchange -disable-output 2>&1 | FileCheck %s2; RUN: opt < %s -passes=loop-interchange --pass-remarks-missed=loop-interchange -loop-interchange-max-meminstr-count=753; -disable-output 2>&1 | FileCheck --check-prefix=CHECK-INSTR-COUNT %s4target triple = "aarch64-unknown-linux-gnu"5 6@A = dso_local local_unnamed_addr global [2048 x [2048 x i32]] zeroinitializer, align 47@B = dso_local local_unnamed_addr global [2048 x [2048 x i32]] zeroinitializer, align 48@C = dso_local local_unnamed_addr global [2048 x [2048 x i32]] zeroinitializer, align 49 10; CHECK: Number of loads/stores exceeded, the supported maximum11; can be increased with option -loop-interchange-maxmeminstr-count.12; CHECK-INSTR-COUNT-NOT: Number of loads/stores exceeded, the supported maximum13; can be increased with option -loop-interchange-maxmeminstr-count.14define dso_local noundef i32 @many_load_stores() {15 br label %116 171: ; preds = %9, %018 %2 = phi i32 [ 0, %0 ], [ %10, %9 ]19 %3 = icmp slt i32 %2, 204820 br i1 %3, label %5, label %421 224: ; preds = %123 ret i32 024 255: ; preds = %126 br label %627 286: ; preds = %11, %529 %7 = phi i32 [ 0, %5 ], [ %208, %11 ]30 %8 = icmp slt i32 %7, 8531 br i1 %8, label %11, label %932 339: ; preds = %634 %10 = add nsw i32 %2, 135 br label %136 3711: ; preds = %638 %12 = sext i32 %2 to i6439 %13 = getelementptr inbounds [2048 x [2048 x i32]], [2048 x [2048 x i32]]* @B, i64 0, i64 %1240 %14 = sext i32 %7 to i6441 %15 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %1442 %16 = load i32, i32* %15, align 443 %17 = getelementptr inbounds [2048 x [2048 x i32]], [2048 x [2048 x i32]]* @C, i64 0, i64 %1244 %18 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %1445 %19 = load i32, i32* %18, align 446 %20 = add nsw i32 %16, %1947 %21 = getelementptr inbounds [2048 x [2048 x i32]], [2048 x [2048 x i32]]* @A, i64 0, i64 %1248 %22 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %1449 store i32 %20, i32* %22, align 450 %23 = add nsw i32 %7, 151 %24 = sext i32 %23 to i6452 %25 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %2453 %26 = load i32, i32* %25, align 454 %27 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %2455 %28 = load i32, i32* %27, align 456 %29 = add nsw i32 %26, %2857 %30 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %2458 store i32 %29, i32* %30, align 459 %31 = add nsw i32 %23, 160 %32 = sext i32 %31 to i6461 %33 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %3262 %34 = load i32, i32* %33, align 463 %35 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %3264 %36 = load i32, i32* %35, align 465 %37 = add nsw i32 %34, %3666 %38 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %3267 store i32 %37, i32* %38, align 468 %39 = add nsw i32 %31, 169 %40 = sext i32 %39 to i6470 %41 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %4071 %42 = load i32, i32* %41, align 472 %43 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %4073 %44 = load i32, i32* %43, align 474 %45 = add nsw i32 %42, %4475 %46 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %4076 store i32 %45, i32* %46, align 477 %47 = add nsw i32 %39, 178 %48 = sext i32 %47 to i6479 %49 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %4880 %50 = load i32, i32* %49, align 481 %51 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %4882 %52 = load i32, i32* %51, align 483 %53 = add nsw i32 %50, %5284 %54 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %4885 store i32 %53, i32* %54, align 486 %55 = add nsw i32 %47, 187 %56 = sext i32 %55 to i6488 %57 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %5689 %58 = load i32, i32* %57, align 490 %59 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %5691 %60 = load i32, i32* %59, align 492 %61 = add nsw i32 %58, %6093 %62 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %5694 store i32 %61, i32* %62, align 495 %63 = add nsw i32 %55, 196 %64 = sext i32 %63 to i6497 %65 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %6498 %66 = load i32, i32* %65, align 499 %67 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %64100 %68 = load i32, i32* %67, align 4101 %69 = add nsw i32 %66, %68102 %70 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %64103 store i32 %69, i32* %70, align 4104 %71 = add nsw i32 %63, 1105 %72 = sext i32 %71 to i64106 %73 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %72107 %74 = load i32, i32* %73, align 4108 %75 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %72109 %76 = load i32, i32* %75, align 4110 %77 = add nsw i32 %74, %76111 %78 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %72112 store i32 %77, i32* %78, align 4113 %79 = add nsw i32 %71, 1114 %80 = sext i32 %79 to i64115 %81 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %80116 %82 = load i32, i32* %81, align 4117 %83 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %80118 %84 = load i32, i32* %83, align 4119 %85 = add nsw i32 %82, %84120 %86 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %80121 store i32 %85, i32* %86, align 4122 %87 = add nsw i32 %79, 1123 %88 = sext i32 %87 to i64124 %89 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %88125 %90 = load i32, i32* %89, align 4126 %91 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %88127 %92 = load i32, i32* %91, align 4128 %93 = add nsw i32 %90, %92129 %94 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %88130 store i32 %93, i32* %94, align 4131 %95 = add nsw i32 %87, 1132 %96 = sext i32 %95 to i64133 %97 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %96134 %98 = load i32, i32* %97, align 4135 %99 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %96136 %100 = load i32, i32* %99, align 4137 %101 = add nsw i32 %98, %100138 %102 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %96139 store i32 %101, i32* %102, align 4140 %103 = add nsw i32 %95, 1141 %104 = sext i32 %103 to i64142 %105 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %104143 %106 = load i32, i32* %105, align 4144 %107 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %104145 %108 = load i32, i32* %107, align 4146 %109 = add nsw i32 %106, %108147 %110 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %104148 store i32 %109, i32* %110, align 4149 %111 = add nsw i32 %103, 1150 %112 = sext i32 %111 to i64151 %113 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %112152 %114 = load i32, i32* %113, align 4153 %115 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %112154 %116 = load i32, i32* %115, align 4155 %117 = add nsw i32 %114, %116156 %118 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %112157 store i32 %117, i32* %118, align 4158 %119 = add nsw i32 %111, 1159 %120 = sext i32 %119 to i64160 %121 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %120161 %122 = load i32, i32* %121, align 4162 %123 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %120163 %124 = load i32, i32* %123, align 4164 %125 = add nsw i32 %122, %124165 %126 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %120166 store i32 %125, i32* %126, align 4167 %127 = add nsw i32 %119, 1168 %128 = sext i32 %127 to i64169 %129 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %128170 %130 = load i32, i32* %129, align 4171 %131 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %128172 %132 = load i32, i32* %131, align 4173 %133 = add nsw i32 %130, %132174 %134 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %128175 store i32 %133, i32* %134, align 4176 %135 = add nsw i32 %127, 1177 %136 = sext i32 %135 to i64178 %137 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %136179 %138 = load i32, i32* %137, align 4180 %139 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %136181 %140 = load i32, i32* %139, align 4182 %141 = add nsw i32 %138, %140183 %142 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %136184 store i32 %141, i32* %142, align 4185 %143 = add nsw i32 %135, 1186 %144 = sext i32 %143 to i64187 %145 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %144188 %146 = load i32, i32* %145, align 4189 %147 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %144190 %148 = load i32, i32* %147, align 4191 %149 = add nsw i32 %146, %148192 %150 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %144193 store i32 %149, i32* %150, align 4194 %151 = add nsw i32 %143, 1195 %152 = sext i32 %151 to i64196 %153 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %152197 %154 = load i32, i32* %153, align 4198 %155 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %152199 %156 = load i32, i32* %155, align 4200 %157 = add nsw i32 %154, %156201 %158 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %152202 store i32 %157, i32* %158, align 4203 %159 = add nsw i32 %151, 1204 %160 = sext i32 %159 to i64205 %161 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %160206 %162 = load i32, i32* %161, align 4207 %163 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %160208 %164 = load i32, i32* %163, align 4209 %165 = add nsw i32 %162, %164210 %166 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %160211 store i32 %165, i32* %166, align 4212 %167 = add nsw i32 %159, 1213 %168 = sext i32 %167 to i64214 %169 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %168215 %170 = load i32, i32* %169, align 4216 %171 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %168217 %172 = load i32, i32* %171, align 4218 %173 = add nsw i32 %170, %172219 %174 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %168220 store i32 %173, i32* %174, align 4221 %175 = add nsw i32 %167, 1222 %176 = sext i32 %175 to i64223 %177 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %176224 %178 = load i32, i32* %177, align 4225 %179 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %176226 %180 = load i32, i32* %179, align 4227 %181 = add nsw i32 %178, %180228 %182 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %176229 store i32 %181, i32* %182, align 4230 %183 = add nsw i32 %175, 1231 %184 = sext i32 %183 to i64232 %185 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %184233 %186 = load i32, i32* %185, align 4234 %187 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %184235 %188 = load i32, i32* %187, align 4236 %189 = add nsw i32 %186, %188237 %190 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %184238 store i32 %189, i32* %190, align 4239 %191 = add nsw i32 %183, 1240 %192 = sext i32 %191 to i64241 %193 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %192242 %194 = load i32, i32* %193, align 4243 %195 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %192244 %196 = load i32, i32* %195, align 4245 %197 = add nsw i32 %194, %196246 %198 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %192247 store i32 %197, i32* %198, align 4248 %199 = add nsw i32 %191, 1249 %200 = sext i32 %199 to i64250 %201 = getelementptr inbounds [2048 x i32], [2048 x i32]* %13, i64 0, i64 %200251 %202 = load i32, i32* %201, align 4252 %203 = getelementptr inbounds [2048 x i32], [2048 x i32]* %17, i64 0, i64 %200253 %204 = load i32, i32* %203, align 4254 %205 = add nsw i32 %202, %204255 %206 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %200256 store i32 %205, i32* %206, align 4257 %207 = add nsw i32 %199, 1258 %208 = add nsw i32 %207, 24259 br label %6260}