| OLD | NEW |
| 1 ; RUN: opt -constant-insert-extract-element-index %s -S | FileCheck %s | 1 ; RUN: opt -constant-insert-extract-element-index %s -S | FileCheck %s |
| 2 | 2 |
| 3 ; The datalayout is needed to determine the alignment of the load/stores. | 3 ; The datalayout is needed to determine the alignment of the load/stores. |
| 4 target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64
:64:64-p:32:32:32-v128:32:32" | 4 target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64
:64:64-p:32:32:32-v128:32:32" |
| 5 | 5 |
| 6 | 6 |
| 7 ; The following insert/extract elements are all indexed with an in-range | 7 ; The following insert/extract elements are all indexed with an in-range |
| 8 ; constant, they should remain unchanged. | 8 ; constant, they should remain unchanged. |
| 9 | 9 |
| 10 define void @test_16xi1_unchanged(<16 x i1> %in) { | 10 define void @test_16xi1_unchanged(<16 x i1> %in) { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 | 290 |
| 291 ; The following insert/extract elements are all indexed with a variable, | 291 ; The following insert/extract elements are all indexed with a variable, |
| 292 ; they should get modified. | 292 ; they should get modified. |
| 293 | 293 |
| 294 define <16 x i1> @test_16xi1_variable(<16 x i1> %in, i32 %idx) { | 294 define <16 x i1> @test_16xi1_variable(<16 x i1> %in, i32 %idx) { |
| 295 ; CHECK-LABEL: test_16xi1_variable | 295 ; CHECK-LABEL: test_16xi1_variable |
| 296 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i1, i32 16, align 16 | 296 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i1, i32 16, align 16 |
| 297 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i1* %[[EALLOCA]] to <16 x i1>* | 297 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i1* %[[EALLOCA]] to <16 x i1>* |
| 298 ; CHECK-NEXT: store <16 x i1> %in, <16 x i1>* %[[ECAST]], align 16 | 298 ; CHECK-NEXT: store <16 x i1> %in, <16 x i1>* %[[ECAST]], align 16 |
| 299 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i1* %[[EALLOCA]], i32 %idx | 299 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i1, i1* %[[EALLOCA]], i32 %idx |
| 300 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i1* %[[EGEP]], align 1 | 300 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i1, i1* %[[EGEP]], align 1 |
| 301 %e.16 = extractelement <16 x i1> %in, i32 %idx | 301 %e.16 = extractelement <16 x i1> %in, i32 %idx |
| 302 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i1, i32 16, align 16 | 302 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i1, i32 16, align 16 |
| 303 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i1* %[[IALLOCA]] to <16 x i1>* | 303 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i1* %[[IALLOCA]] to <16 x i1>* |
| 304 ; CHECK-NEXT: store <16 x i1> %in, <16 x i1>* %[[ICAST]], align 16 | 304 ; CHECK-NEXT: store <16 x i1> %in, <16 x i1>* %[[ICAST]], align 16 |
| 305 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i1* %[[IALLOCA]], i32 %idx | 305 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i1, i1* %[[IALLOCA]], i32 %idx |
| 306 ; CHECK-NEXT: store i1 %[[ELOAD]], i1* %[[IGEP]], align 1 | 306 ; CHECK-NEXT: store i1 %[[ELOAD]], i1* %[[IGEP]], align 1 |
| 307 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <16 x i1>* %[[ICAST]], align 16 | 307 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <16 x i1>, <16 x i1>* %[[ICAST]], align
16 |
| 308 %i.16 = insertelement <16 x i1> %in, i1 %e.16, i32 %idx | 308 %i.16 = insertelement <16 x i1> %in, i1 %e.16, i32 %idx |
| 309 ; CHECK-NEXT: ret <16 x i1> %[[ILOAD]] | 309 ; CHECK-NEXT: ret <16 x i1> %[[ILOAD]] |
| 310 ret <16 x i1> %i.16 | 310 ret <16 x i1> %i.16 |
| 311 } | 311 } |
| 312 | 312 |
| 313 define <8 x i1> @test_8xi1_variable(<8 x i1> %in, i32 %idx) { | 313 define <8 x i1> @test_8xi1_variable(<8 x i1> %in, i32 %idx) { |
| 314 ; CHECK-LABEL: test_8xi1_variable | 314 ; CHECK-LABEL: test_8xi1_variable |
| 315 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i1, i32 8, align 8 | 315 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i1, i32 8, align 8 |
| 316 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i1* %[[EALLOCA]] to <8 x i1>* | 316 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i1* %[[EALLOCA]] to <8 x i1>* |
| 317 ; CHECK-NEXT: store <8 x i1> %in, <8 x i1>* %[[ECAST]], align 8 | 317 ; CHECK-NEXT: store <8 x i1> %in, <8 x i1>* %[[ECAST]], align 8 |
| 318 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i1* %[[EALLOCA]], i32 %idx | 318 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i1, i1* %[[EALLOCA]], i32 %idx |
| 319 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i1* %[[EGEP]], align 1 | 319 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i1, i1* %[[EGEP]], align 1 |
| 320 %e.8 = extractelement <8 x i1> %in, i32 %idx | 320 %e.8 = extractelement <8 x i1> %in, i32 %idx |
| 321 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i1, i32 8, align 8 | 321 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i1, i32 8, align 8 |
| 322 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i1* %[[IALLOCA]] to <8 x i1>* | 322 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i1* %[[IALLOCA]] to <8 x i1>* |
| 323 ; CHECK-NEXT: store <8 x i1> %in, <8 x i1>* %[[ICAST]], align 8 | 323 ; CHECK-NEXT: store <8 x i1> %in, <8 x i1>* %[[ICAST]], align 8 |
| 324 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i1* %[[IALLOCA]], i32 %idx | 324 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i1, i1* %[[IALLOCA]], i32 %idx |
| 325 ; CHECK-NEXT: store i1 %[[ELOAD]], i1* %[[IGEP]], align 1 | 325 ; CHECK-NEXT: store i1 %[[ELOAD]], i1* %[[IGEP]], align 1 |
| 326 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <8 x i1>* %[[ICAST]], align 8 | 326 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <8 x i1>, <8 x i1>* %[[ICAST]], align 8 |
| 327 %i.8 = insertelement <8 x i1> %in, i1 %e.8, i32 %idx | 327 %i.8 = insertelement <8 x i1> %in, i1 %e.8, i32 %idx |
| 328 ; CHECK-NEXT: ret <8 x i1> %[[ILOAD]] | 328 ; CHECK-NEXT: ret <8 x i1> %[[ILOAD]] |
| 329 ret <8 x i1> %i.8 | 329 ret <8 x i1> %i.8 |
| 330 } | 330 } |
| 331 | 331 |
| 332 define <4 x i1> @test_4xi1_variable(<4 x i1> %in, i32 %idx) { | 332 define <4 x i1> @test_4xi1_variable(<4 x i1> %in, i32 %idx) { |
| 333 ; CHECK-LABEL: test_4xi1_variable | 333 ; CHECK-LABEL: test_4xi1_variable |
| 334 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i1, i32 4, align 4 | 334 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i1, i32 4, align 4 |
| 335 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i1* %[[EALLOCA]] to <4 x i1>* | 335 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i1* %[[EALLOCA]] to <4 x i1>* |
| 336 ; CHECK-NEXT: store <4 x i1> %in, <4 x i1>* %[[ECAST]], align 4 | 336 ; CHECK-NEXT: store <4 x i1> %in, <4 x i1>* %[[ECAST]], align 4 |
| 337 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i1* %[[EALLOCA]], i32 %idx | 337 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i1, i1* %[[EALLOCA]], i32 %idx |
| 338 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i1* %[[EGEP]], align 1 | 338 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i1, i1* %[[EGEP]], align 1 |
| 339 %e.4 = extractelement <4 x i1> %in, i32 %idx | 339 %e.4 = extractelement <4 x i1> %in, i32 %idx |
| 340 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i1, i32 4, align 4 | 340 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i1, i32 4, align 4 |
| 341 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i1* %[[IALLOCA]] to <4 x i1>* | 341 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i1* %[[IALLOCA]] to <4 x i1>* |
| 342 ; CHECK-NEXT: store <4 x i1> %in, <4 x i1>* %[[ICAST]], align 4 | 342 ; CHECK-NEXT: store <4 x i1> %in, <4 x i1>* %[[ICAST]], align 4 |
| 343 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i1* %[[IALLOCA]], i32 %idx | 343 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i1, i1* %[[IALLOCA]], i32 %idx |
| 344 ; CHECK-NEXT: store i1 %[[ELOAD]], i1* %[[IGEP]], align 1 | 344 ; CHECK-NEXT: store i1 %[[ELOAD]], i1* %[[IGEP]], align 1 |
| 345 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <4 x i1>* %[[ICAST]], align 4 | 345 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <4 x i1>, <4 x i1>* %[[ICAST]], align 4 |
| 346 %i.4 = insertelement <4 x i1> %in, i1 %e.4, i32 %idx | 346 %i.4 = insertelement <4 x i1> %in, i1 %e.4, i32 %idx |
| 347 ; CHECK-NEXT: ret <4 x i1> %[[ILOAD]] | 347 ; CHECK-NEXT: ret <4 x i1> %[[ILOAD]] |
| 348 ret <4 x i1> %i.4 | 348 ret <4 x i1> %i.4 |
| 349 } | 349 } |
| 350 | 350 |
| 351 define <16 x i8> @test_16xi8_variable(<16 x i8> %in, i32 %idx) { | 351 define <16 x i8> @test_16xi8_variable(<16 x i8> %in, i32 %idx) { |
| 352 ; CHECK-LABEL: test_16xi8_variable | 352 ; CHECK-LABEL: test_16xi8_variable |
| 353 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i8, i32 16, align 4 | 353 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i8, i32 16, align 4 |
| 354 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i8* %[[EALLOCA]] to <16 x i8>* | 354 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i8* %[[EALLOCA]] to <16 x i8>* |
| 355 ; CHECK-NEXT: store <16 x i8> %in, <16 x i8>* %[[ECAST]], align 4 | 355 ; CHECK-NEXT: store <16 x i8> %in, <16 x i8>* %[[ECAST]], align 4 |
| 356 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i8* %[[EALLOCA]], i32 %idx | 356 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i8, i8* %[[EALLOCA]], i32 %idx |
| 357 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i8* %[[EGEP]], align 1 | 357 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i8, i8* %[[EGEP]], align 1 |
| 358 %e.16 = extractelement <16 x i8> %in, i32 %idx | 358 %e.16 = extractelement <16 x i8> %in, i32 %idx |
| 359 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i8, i32 16, align 4 | 359 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i8, i32 16, align 4 |
| 360 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i8* %[[IALLOCA]] to <16 x i8>* | 360 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i8* %[[IALLOCA]] to <16 x i8>* |
| 361 ; CHECK-NEXT: store <16 x i8> %in, <16 x i8>* %[[ICAST]], align 4 | 361 ; CHECK-NEXT: store <16 x i8> %in, <16 x i8>* %[[ICAST]], align 4 |
| 362 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i8* %[[IALLOCA]], i32 %idx | 362 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i8, i8* %[[IALLOCA]], i32 %idx |
| 363 ; CHECK-NEXT: store i8 %[[ELOAD]], i8* %[[IGEP]], align 1 | 363 ; CHECK-NEXT: store i8 %[[ELOAD]], i8* %[[IGEP]], align 1 |
| 364 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <16 x i8>* %[[ICAST]], align 4 | 364 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <16 x i8>, <16 x i8>* %[[ICAST]], align
4 |
| 365 %i.16 = insertelement <16 x i8> %in, i8 %e.16, i32 %idx | 365 %i.16 = insertelement <16 x i8> %in, i8 %e.16, i32 %idx |
| 366 ; CHECK-NEXT: ret <16 x i8> %[[ILOAD]] | 366 ; CHECK-NEXT: ret <16 x i8> %[[ILOAD]] |
| 367 ret <16 x i8> %i.16 | 367 ret <16 x i8> %i.16 |
| 368 } | 368 } |
| 369 | 369 |
| 370 define <8 x i16> @test_8xi16_variable(<8 x i16> %in, i32 %idx) { | 370 define <8 x i16> @test_8xi16_variable(<8 x i16> %in, i32 %idx) { |
| 371 ; CHECK-LABEL: test_8xi16_variable | 371 ; CHECK-LABEL: test_8xi16_variable |
| 372 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i16, i32 8, align 4 | 372 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i16, i32 8, align 4 |
| 373 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i16* %[[EALLOCA]] to <8 x i16>* | 373 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i16* %[[EALLOCA]] to <8 x i16>* |
| 374 ; CHECK-NEXT: store <8 x i16> %in, <8 x i16>* %[[ECAST]], align 4 | 374 ; CHECK-NEXT: store <8 x i16> %in, <8 x i16>* %[[ECAST]], align 4 |
| 375 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i16* %[[EALLOCA]], i32 %idx | 375 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i16, i16* %[[EALLOCA]], i32 %id
x |
| 376 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i16* %[[EGEP]], align 2 | 376 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i16, i16* %[[EGEP]], align 2 |
| 377 %e.8 = extractelement <8 x i16> %in, i32 %idx | 377 %e.8 = extractelement <8 x i16> %in, i32 %idx |
| 378 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i16, i32 8, align 4 | 378 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i16, i32 8, align 4 |
| 379 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i16* %[[IALLOCA]] to <8 x i16>* | 379 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i16* %[[IALLOCA]] to <8 x i16>* |
| 380 ; CHECK-NEXT: store <8 x i16> %in, <8 x i16>* %[[ICAST]], align 4 | 380 ; CHECK-NEXT: store <8 x i16> %in, <8 x i16>* %[[ICAST]], align 4 |
| 381 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i16* %[[IALLOCA]], i32 %idx | 381 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i16, i16* %[[IALLOCA]], i32 %id
x |
| 382 ; CHECK-NEXT: store i16 %[[ELOAD]], i16* %[[IGEP]], align 2 | 382 ; CHECK-NEXT: store i16 %[[ELOAD]], i16* %[[IGEP]], align 2 |
| 383 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <8 x i16>* %[[ICAST]], align 4 | 383 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <8 x i16>, <8 x i16>* %[[ICAST]], align
4 |
| 384 %i.8 = insertelement <8 x i16> %in, i16 %e.8, i32 %idx | 384 %i.8 = insertelement <8 x i16> %in, i16 %e.8, i32 %idx |
| 385 ; CHECK-NEXT: ret <8 x i16> %[[ILOAD]] | 385 ; CHECK-NEXT: ret <8 x i16> %[[ILOAD]] |
| 386 ret <8 x i16> %i.8 | 386 ret <8 x i16> %i.8 |
| 387 } | 387 } |
| 388 | 388 |
| 389 define <4 x i32> @test_4xi32_variable(<4 x i32> %in, i32 %idx) { | 389 define <4 x i32> @test_4xi32_variable(<4 x i32> %in, i32 %idx) { |
| 390 ; CHECK-LABEL: test_4xi32_variable | 390 ; CHECK-LABEL: test_4xi32_variable |
| 391 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i32, i32 4, align 4 | 391 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca i32, i32 4, align 4 |
| 392 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i32* %[[EALLOCA]] to <4 x i32>* | 392 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast i32* %[[EALLOCA]] to <4 x i32>* |
| 393 ; CHECK-NEXT: store <4 x i32> %in, <4 x i32>* %[[ECAST]], align 4 | 393 ; CHECK-NEXT: store <4 x i32> %in, <4 x i32>* %[[ECAST]], align 4 |
| 394 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i32* %[[EALLOCA]], i32 %idx | 394 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr i32, i32* %[[EALLOCA]], i32 %id
x |
| 395 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i32* %[[EGEP]], align 4 | 395 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load i32, i32* %[[EGEP]], align 4 |
| 396 %e.4 = extractelement <4 x i32> %in, i32 %idx | 396 %e.4 = extractelement <4 x i32> %in, i32 %idx |
| 397 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i32, i32 4, align 4 | 397 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca i32, i32 4, align 4 |
| 398 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i32* %[[IALLOCA]] to <4 x i32>* | 398 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast i32* %[[IALLOCA]] to <4 x i32>* |
| 399 ; CHECK-NEXT: store <4 x i32> %in, <4 x i32>* %[[ICAST]], align 4 | 399 ; CHECK-NEXT: store <4 x i32> %in, <4 x i32>* %[[ICAST]], align 4 |
| 400 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i32* %[[IALLOCA]], i32 %idx | 400 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr i32, i32* %[[IALLOCA]], i32 %id
x |
| 401 ; CHECK-NEXT: store i32 %[[ELOAD]], i32* %[[IGEP]], align 4 | 401 ; CHECK-NEXT: store i32 %[[ELOAD]], i32* %[[IGEP]], align 4 |
| 402 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <4 x i32>* %[[ICAST]], align 4 | 402 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <4 x i32>, <4 x i32>* %[[ICAST]], align
4 |
| 403 %i.4 = insertelement <4 x i32> %in, i32 %e.4, i32 %idx | 403 %i.4 = insertelement <4 x i32> %in, i32 %e.4, i32 %idx |
| 404 ; CHECK-NEXT: ret <4 x i32> %[[ILOAD]] | 404 ; CHECK-NEXT: ret <4 x i32> %[[ILOAD]] |
| 405 ret <4 x i32> %i.4 | 405 ret <4 x i32> %i.4 |
| 406 } | 406 } |
| 407 | 407 |
| 408 define <4 x float> @test_4xfloat_variable(<4 x float> %in, i32 %idx) { | 408 define <4 x float> @test_4xfloat_variable(<4 x float> %in, i32 %idx) { |
| 409 ; CHECK-LABEL: test_4xfloat_variable | 409 ; CHECK-LABEL: test_4xfloat_variable |
| 410 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca float, i32 4, align 4 | 410 ; CHECK-NEXT: %[[EALLOCA:[0-9]+]] = alloca float, i32 4, align 4 |
| 411 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast float* %[[EALLOCA]] to <4 x float>* | 411 ; CHECK-NEXT: %[[ECAST:[0-9]+]] = bitcast float* %[[EALLOCA]] to <4 x float>* |
| 412 ; CHECK-NEXT: store <4 x float> %in, <4 x float>* %[[ECAST]], align 4 | 412 ; CHECK-NEXT: store <4 x float> %in, <4 x float>* %[[ECAST]], align 4 |
| 413 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr float* %[[EALLOCA]], i32 %idx | 413 ; CHECK-NEXT: %[[EGEP:[0-9]+]] = getelementptr float, float* %[[EALLOCA]], i32
%idx |
| 414 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load float* %[[EGEP]], align 4 | 414 ; CHECK-NEXT: %[[ELOAD:[0-9]+]] = load float, float* %[[EGEP]], align 4 |
| 415 %e.4 = extractelement <4 x float> %in, i32 %idx | 415 %e.4 = extractelement <4 x float> %in, i32 %idx |
| 416 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca float, i32 4, align 4 | 416 ; CHECK-NEXT: %[[IALLOCA:[0-9]+]] = alloca float, i32 4, align 4 |
| 417 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast float* %[[IALLOCA]] to <4 x float>* | 417 ; CHECK-NEXT: %[[ICAST:[0-9]+]] = bitcast float* %[[IALLOCA]] to <4 x float>* |
| 418 ; CHECK-NEXT: store <4 x float> %in, <4 x float>* %[[ICAST]], align 4 | 418 ; CHECK-NEXT: store <4 x float> %in, <4 x float>* %[[ICAST]], align 4 |
| 419 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr float* %[[IALLOCA]], i32 %idx | 419 ; CHECK-NEXT: %[[IGEP:[0-9]+]] = getelementptr float, float* %[[IALLOCA]], i32
%idx |
| 420 ; CHECK-NEXT: store float %[[ELOAD]], float* %[[IGEP]], align 4 | 420 ; CHECK-NEXT: store float %[[ELOAD]], float* %[[IGEP]], align 4 |
| 421 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <4 x float>* %[[ICAST]], align 4 | 421 ; CHECK-NEXT: %[[ILOAD:[0-9]+]] = load <4 x float>, <4 x float>* %[[ICAST]], a
lign 4 |
| 422 %i.4 = insertelement <4 x float> %in, float %e.4, i32 %idx | 422 %i.4 = insertelement <4 x float> %in, float %e.4, i32 %idx |
| 423 ; CHECK-NEXT: ret <4 x float> %[[ILOAD]] | 423 ; CHECK-NEXT: ret <4 x float> %[[ILOAD]] |
| 424 ret <4 x float> %i.4 | 424 ret <4 x float> %i.4 |
| 425 } | 425 } |
| OLD | NEW |