429 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s3 4%struct.1 = type { i32, i64, i8 }5%struct.2 = type { i32, [20 x i64], i8 }6 7define i1 @test.ult.true.due.to.first.dimension(ptr %start, ptr %high) {8; CHECK-LABEL: @test.ult.true.due.to.first.dimension(9; CHECK-NEXT: entry:10; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 6, i32 011; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr12; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]13; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]14; CHECK: if.then:15; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 5, i32 016; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr17; CHECK-NEXT: ret i1 true18; CHECK: if.end:19; CHECK-NEXT: ret i1 true20;21entry:22 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 6, i32 023 %add.ptr.cast = bitcast ptr %add.ptr to ptr24 %c.1 = icmp ule ptr %add.ptr.cast, %high25 br i1 %c.1, label %if.then, label %if.end26 27if.then:28 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 5, i32 029 %start.0.cast = bitcast ptr %start.0 to ptr30 %c.0 = icmp ult ptr %start.0.cast, %high31 ret i1 %c.032 33if.end:34 ret i1 true35}36 37define i1 @test.ult.true.due.to.first.dimension.var.index.0(ptr %start, ptr %high, i32 %idx) {38; CHECK-LABEL: @test.ult.true.due.to.first.dimension.var.index.0(39; CHECK-NEXT: entry:40; CHECK-NEXT: [[IDX_EXT_PLUS_1:%.*]] = add nuw nsw i32 [[IDX:%.*]], 141; CHECK-NEXT: [[IDX_EXT_PLUS_1_EXT:%.*]] = zext i32 [[IDX_EXT_PLUS_1]] to i6442; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 [[IDX_EXT_PLUS_1_EXT]], i32 043; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr44; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]45; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]46; CHECK: if.then:47; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i6448; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 [[IDX_EXT]], i32 049; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr50; CHECK-NEXT: ret i1 true51; CHECK: if.end:52; CHECK-NEXT: ret i1 true53;54entry:55 %idx.ext.plus.1 = add nuw nsw i32 %idx, 156 %idx.ext.plus.1.ext = zext i32 %idx.ext.plus.1 to i6457 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext.plus.1.ext, i32 058 %add.ptr.cast = bitcast ptr %add.ptr to ptr59 %c.1 = icmp ule ptr %add.ptr.cast, %high60 br i1 %c.1, label %if.then, label %if.end61 62if.then:63 %idx.ext = zext i32 %idx to i6464 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext, i32 065 %start.0.cast = bitcast ptr %start.0 to ptr66 %c.0 = icmp ult ptr %start.0.cast, %high67 ret i1 %c.068 69if.end:70 ret i1 true71}72 73define i1 @test.ult.true.due.to.first.dimension.var.index.1(ptr %start, ptr %high, i32 %idx) {74; CHECK-LABEL: @test.ult.true.due.to.first.dimension.var.index.1(75; CHECK-NEXT: entry:76; CHECK-NEXT: [[IDX_EXT_PLUS_1:%.*]] = add nuw nsw i32 [[IDX:%.*]], 177; CHECK-NEXT: [[IDX_EXT_PLUS_1_EXT:%.*]] = zext i32 [[IDX_EXT_PLUS_1]] to i6478; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 [[IDX_EXT_PLUS_1_EXT]], i32 079; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr80; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]81; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]82; CHECK: if.then:83; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i6484; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 [[IDX_EXT]], i32 185; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr86; CHECK-NEXT: ret i1 true87; CHECK: if.end:88; CHECK-NEXT: ret i1 true89;90entry:91 %idx.ext.plus.1 = add nuw nsw i32 %idx, 192 %idx.ext.plus.1.ext = zext i32 %idx.ext.plus.1 to i6493 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext.plus.1.ext, i32 094 %add.ptr.cast = bitcast ptr %add.ptr to ptr95 %c.1 = icmp ule ptr %add.ptr.cast, %high96 br i1 %c.1, label %if.then, label %if.end97 98if.then:99 %idx.ext = zext i32 %idx to i64100 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext, i32 1101 %start.0.cast = bitcast ptr %start.0 to ptr102 %c.0 = icmp ult ptr %start.0.cast, %high103 ret i1 %c.0104 105if.end:106 ret i1 true107}108 109define i1 @test.ult.true.due.to.first.dimension.var.index.2(ptr %start, ptr %high, i32 %idx) {110; CHECK-LABEL: @test.ult.true.due.to.first.dimension.var.index.2(111; CHECK-NEXT: entry:112; CHECK-NEXT: [[IDX_EXT_PLUS_1:%.*]] = add nuw nsw i32 [[IDX:%.*]], 1113; CHECK-NEXT: [[IDX_EXT_PLUS_1_EXT:%.*]] = zext i32 [[IDX_EXT_PLUS_1]] to i64114; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 [[IDX_EXT_PLUS_1_EXT]], i32 0115; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr116; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]117; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]118; CHECK: if.then:119; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i64120; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 [[IDX_EXT]], i32 2121; CHECK-NEXT: ret i1 true122; CHECK: if.end:123; CHECK-NEXT: ret i1 true124;125entry:126 %idx.ext.plus.1 = add nuw nsw i32 %idx, 1127 %idx.ext.plus.1.ext = zext i32 %idx.ext.plus.1 to i64128 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext.plus.1.ext, i32 0129 %add.ptr.cast = bitcast ptr %add.ptr to ptr130 %c.1 = icmp ule ptr %add.ptr.cast, %high131 br i1 %c.1, label %if.then, label %if.end132 133if.then:134 %idx.ext = zext i32 %idx to i64135 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext, i32 2136 %c.0 = icmp ult ptr %start.0, %high137 ret i1 %c.0138 139if.end:140 ret i1 true141}142 143define i1 @test.ult.unknown.due.to.first.dimension(ptr %start, ptr %high) {144; CHECK-LABEL: @test.ult.unknown.due.to.first.dimension(145; CHECK-NEXT: entry:146; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 5, i32 0147; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr148; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]149; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]150; CHECK: if.then:151; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 6, i32 0152; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr153; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0_CAST]], [[HIGH]]154; CHECK-NEXT: ret i1 [[C_0]]155; CHECK: if.end:156; CHECK-NEXT: ret i1 true157;158entry:159 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 5, i32 0160 %add.ptr.cast = bitcast ptr %add.ptr to ptr161 %c.1 = icmp ule ptr %add.ptr.cast, %high162 br i1 %c.1, label %if.then, label %if.end163 164if.then:165 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 6, i32 0166 %start.0.cast = bitcast ptr %start.0 to ptr167 %c.0 = icmp ult ptr %start.0.cast, %high168 ret i1 %c.0169 170if.end:171 ret i1 true172}173 174define i1 @test.ult.true.due.to.second.dimension(ptr %start, ptr %high) {175; CHECK-LABEL: @test.ult.true.due.to.second.dimension(176; CHECK-NEXT: entry:177; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 5, i32 2178; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR]], [[HIGH:%.*]]179; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]180; CHECK: if.then:181; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 5, i32 1182; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr183; CHECK-NEXT: ret i1 true184; CHECK: if.end:185; CHECK-NEXT: ret i1 true186;187entry:188 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 5, i32 2189 %c.1 = icmp ule ptr %add.ptr, %high190 br i1 %c.1, label %if.then, label %if.end191 192if.then:193 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 5, i32 1194 %start.0.cast = bitcast ptr %start.0 to ptr195 %c.0 = icmp ult ptr %start.0.cast, %high196 ret i1 %c.0197 198if.end:199 ret i1 true200}201 202define i1 @test.ult.unknown.due.to.second.dimension(ptr %start, ptr %high) {203; CHECK-LABEL: @test.ult.unknown.due.to.second.dimension(204; CHECK-NEXT: entry:205; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 5, i32 2206; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR]], [[HIGH:%.*]]207; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]208; CHECK: if.then:209; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 5, i32 2210; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]211; CHECK-NEXT: ret i1 [[C_0]]212; CHECK: if.end:213; CHECK-NEXT: ret i1 true214;215entry:216 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 5, i32 2217 %c.1 = icmp ule ptr %add.ptr, %high218 br i1 %c.1, label %if.then, label %if.end219 220if.then:221 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 5, i32 2222 %c.0 = icmp ult ptr %start.0, %high223 ret i1 %c.0224 225if.end:226 ret i1 true227}228 229define i1 @test.ult.unknown.due.to.second.dimension.var.index.0(ptr %start, ptr %high, i32 %idx) {230; CHECK-LABEL: @test.ult.unknown.due.to.second.dimension.var.index.0(231; CHECK-NEXT: entry:232; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX:%.*]] to i64233; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 [[IDX_EXT]], i32 0234; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr235; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]236; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]237; CHECK: if.then:238; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 [[IDX_EXT]], i32 1239; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr240; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0_CAST]], [[HIGH]]241; CHECK-NEXT: ret i1 [[C_0]]242; CHECK: if.end:243; CHECK-NEXT: ret i1 true244;245entry:246 %idx.ext = zext i32 %idx to i64247 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext, i32 0248 %add.ptr.cast = bitcast ptr %add.ptr to ptr249 %c.1 = icmp ule ptr %add.ptr.cast, %high250 br i1 %c.1, label %if.then, label %if.end251 252if.then:253 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext, i32 1254 %start.0.cast = bitcast ptr %start.0 to ptr255 %c.0 = icmp ult ptr %start.0.cast, %high256 ret i1 %c.0257 258if.end:259 ret i1 true260}261 262define i1 @test.ult.unknown.due.to.second.dimension.var.index.1(ptr %start, ptr %high, i32 %idx) {263; CHECK-LABEL: @test.ult.unknown.due.to.second.dimension.var.index.1(264; CHECK-NEXT: entry:265; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX:%.*]] to i64266; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_1:%.*]], ptr [[START:%.*]], i64 [[IDX_EXT]], i32 1267; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr268; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]269; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]270; CHECK: if.then:271; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 [[IDX_EXT]], i32 2272; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]273; CHECK-NEXT: ret i1 [[C_0]]274; CHECK: if.end:275; CHECK-NEXT: ret i1 true276;277entry:278 %idx.ext = zext i32 %idx to i64279 %add.ptr = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext, i32 1280 %add.ptr.cast = bitcast ptr %add.ptr to ptr281 %c.1 = icmp ule ptr %add.ptr.cast, %high282 br i1 %c.1, label %if.then, label %if.end283 284if.then:285 %start.0 = getelementptr inbounds %struct.1, ptr %start, i64 %idx.ext, i32 2286 %c.0 = icmp ult ptr %start.0, %high287 ret i1 %c.0288 289if.end:290 ret i1 true291}292 293define i1 @ptr.int.struct.test.ult.true.due.to.first.dimension(ptr %start, ptr %high) {294; CHECK-LABEL: @ptr.int.struct.test.ult.true.due.to.first.dimension(295; CHECK-NEXT: entry:296; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_2:%.*]], ptr [[START:%.*]], i64 6, i32 1, i32 5297; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr298; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]299; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]300; CHECK: if.then:301; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[START]], i64 6, i32 0302; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr303; CHECK-NEXT: ret i1 true304; CHECK: if.end:305; CHECK-NEXT: ret i1 true306;307entry:308 %add.ptr = getelementptr inbounds %struct.2, ptr %start, i64 6, i32 1, i32 5309 %add.ptr.cast = bitcast ptr %add.ptr to ptr310 %c.1 = icmp ule ptr %add.ptr.cast, %high311 br i1 %c.1, label %if.then, label %if.end312 313if.then:314 %start.0 = getelementptr inbounds %struct.2, ptr %start, i64 6, i32 0315 %start.0.cast = bitcast ptr %start.0 to ptr316 %c.0 = icmp ult ptr %start.0.cast, %high317 ret i1 %c.0318 319if.end:320 ret i1 true321}322 323define i1 @ptr.int.struct.test.ult.true.due.to.third.dimension.var.index(ptr %start, ptr %high, i32 %idx) {324; CHECK-LABEL: @ptr.int.struct.test.ult.true.due.to.third.dimension.var.index(325; CHECK-NEXT: entry:326; CHECK-NEXT: [[IDX_EXT_PLUS_1:%.*]] = add nuw nsw i32 [[IDX:%.*]], 1327; CHECK-NEXT: [[IDX_EXT_PLUS_1_EXT:%.*]] = zext i32 [[IDX_EXT_PLUS_1]] to i64328; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_2:%.*]], ptr [[START:%.*]], i64 6, i32 1, i64 [[IDX_EXT_PLUS_1_EXT]]329; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr330; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]331; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]332; CHECK: if.then:333; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i64334; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[START]], i64 6, i32 1, i64 [[IDX_EXT]]335; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr336; CHECK-NEXT: ret i1 true337; CHECK: if.end:338; CHECK-NEXT: ret i1 true339;340entry:341 %idx.ext.plus.1 = add nuw nsw i32 %idx, 1342 %idx.ext.plus.1.ext = zext i32 %idx.ext.plus.1 to i64343 %add.ptr = getelementptr inbounds %struct.2, ptr %start, i64 6, i32 1, i64 %idx.ext.plus.1.ext344 %add.ptr.cast = bitcast ptr %add.ptr to ptr345 %c.1 = icmp ule ptr %add.ptr.cast, %high346 br i1 %c.1, label %if.then, label %if.end347 348if.then:349 %idx.ext = zext i32 %idx to i64350 %start.0 = getelementptr inbounds %struct.2, ptr %start, i64 6, i32 1, i64 %idx.ext351 %start.0.cast = bitcast ptr %start.0 to ptr352 %c.0 = icmp ult ptr %start.0.cast, %high353 ret i1 %c.0354 355if.end:356 ret i1 true357}358 359define i1 @ptr.int.struct.test.ult.due.to.second.dimension.var.index(ptr %start, ptr %high, i32 %idx) {360; CHECK-LABEL: @ptr.int.struct.test.ult.due.to.second.dimension.var.index(361; CHECK-NEXT: entry:362; CHECK-NEXT: [[IDX_EXT_PLUS_1:%.*]] = add nuw nsw i32 [[IDX:%.*]], 1363; CHECK-NEXT: [[IDX_EXT_PLUS_1_EXT:%.*]] = zext i32 [[IDX_EXT_PLUS_1]] to i64364; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_2:%.*]], ptr [[START:%.*]], i64 6, i32 1, i64 [[IDX_EXT_PLUS_1_EXT]]365; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr366; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]367; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]368; CHECK: if.then:369; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i64370; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[START]], i64 6, i32 0371; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr372; CHECK-NEXT: ret i1 true373; CHECK: if.end:374; CHECK-NEXT: ret i1 true375;376entry:377 %idx.ext.plus.1 = add nuw nsw i32 %idx, 1378 %idx.ext.plus.1.ext = zext i32 %idx.ext.plus.1 to i64379 %add.ptr = getelementptr inbounds %struct.2, ptr %start, i64 6, i32 1, i64 %idx.ext.plus.1.ext380 %add.ptr.cast = bitcast ptr %add.ptr to ptr381 %c.1 = icmp ule ptr %add.ptr.cast, %high382 br i1 %c.1, label %if.then, label %if.end383 384if.then:385 %idx.ext = zext i32 %idx to i64386 %start.0 = getelementptr inbounds %struct.2, ptr %start, i64 6, i32 0387 %start.0.cast = bitcast ptr %start.0 to ptr388 %c.0 = icmp ult ptr %start.0.cast, %high389 ret i1 %c.0390 391if.end:392 ret i1 true393}394 395define i1 @ptr.int.struct.test.ult.unknown.due.to.second.dimension.var.index(ptr %start, ptr %high, i32 %idx) {396; CHECK-LABEL: @ptr.int.struct.test.ult.unknown.due.to.second.dimension.var.index(397; CHECK-NEXT: entry:398; CHECK-NEXT: [[IDX_EXT_PLUS_1:%.*]] = add nuw nsw i32 [[IDX:%.*]], 1399; CHECK-NEXT: [[IDX_EXT_PLUS_1_EXT:%.*]] = zext i32 [[IDX_EXT_PLUS_1]] to i64400; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds [[STRUCT_2:%.*]], ptr [[START:%.*]], i64 6, i32 1, i64 [[IDX_EXT_PLUS_1_EXT]]401; CHECK-NEXT: [[ADD_PTR_CAST:%.*]] = bitcast ptr [[ADD_PTR]] to ptr402; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_CAST]], [[HIGH:%.*]]403; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]404; CHECK: if.then:405; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i64406; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[START]], i64 6, i32 2407; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]408; CHECK-NEXT: ret i1 [[C_0]]409; CHECK: if.end:410; CHECK-NEXT: ret i1 true411;412entry:413 %idx.ext.plus.1 = add nuw nsw i32 %idx, 1414 %idx.ext.plus.1.ext = zext i32 %idx.ext.plus.1 to i64415 %add.ptr = getelementptr inbounds %struct.2, ptr %start, i64 6, i32 1, i64 %idx.ext.plus.1.ext416 %add.ptr.cast = bitcast ptr %add.ptr to ptr417 %c.1 = icmp ule ptr %add.ptr.cast, %high418 br i1 %c.1, label %if.then, label %if.end419 420if.then:421 %idx.ext = zext i32 %idx to i64422 %start.0 = getelementptr inbounds %struct.2, ptr %start, i64 6, i32 2423 %c.0 = icmp ult ptr %start.0, %high424 ret i1 %c.0425 426if.end:427 ret i1 true428}429