@@ -382,3 +382,83 @@ define <4 x i32> @load_v2i32_v4i32_addrspacecast(ptr addrspace(5) align 16 deref
382
382
%s = shufflevector <2 x i32 > %l , <2 x i32 > poison, <4 x i32 > <i32 0 , i32 1 , i32 undef , i32 undef >
383
383
ret <4 x i32 > %s
384
384
}
385
+
386
+ ; Negative-negative tests with msan, which should be OK with widening.
387
+
388
+ define <4 x float > @load_v1f32_v4f32_msan (ptr dereferenceable (16 ) %p ) sanitize_memory {
389
+ ; CHECK-LABEL: @load_v1f32_v4f32_msan(
390
+ ; CHECK-NEXT: [[S:%.*]] = load <4 x float>, ptr [[P:%.*]], align 16
391
+ ; CHECK-NEXT: ret <4 x float> [[S]]
392
+ ;
393
+ %l = load <1 x float >, ptr %p , align 16
394
+ %s = shufflevector <1 x float > %l , <1 x float > poison, <4 x i32 > <i32 0 , i32 undef , i32 undef , i32 undef >
395
+ ret <4 x float > %s
396
+ }
397
+
398
+ ; Negative tests with sanitizers.
399
+
400
+ define <4 x float > @load_v1f32_v4f32_asan (ptr dereferenceable (16 ) %p ) sanitize_address {
401
+ ; CHECK-LABEL: @load_v1f32_v4f32_asan(
402
+ ; CHECK-NEXT: [[L:%.*]] = load <1 x float>, ptr [[P:%.*]], align 16
403
+ ; CHECK-NEXT: [[S:%.*]] = shufflevector <1 x float> [[L]], <1 x float> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>
404
+ ; CHECK-NEXT: ret <4 x float> [[S]]
405
+ ;
406
+ %l = load <1 x float >, ptr %p , align 16
407
+ %s = shufflevector <1 x float > %l , <1 x float > poison, <4 x i32 > <i32 0 , i32 undef , i32 undef , i32 undef >
408
+ ret <4 x float > %s
409
+ }
410
+
411
+ define <4 x float > @load_v2f32_v4f32_hwasan (ptr align 16 dereferenceable (16 ) %p ) sanitize_hwaddress {
412
+ ; CHECK-LABEL: @load_v2f32_v4f32_hwasan(
413
+ ; CHECK-NEXT: [[L:%.*]] = load <2 x float>, ptr [[P:%.*]], align 1
414
+ ; CHECK-NEXT: [[S:%.*]] = shufflevector <2 x float> [[L]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
415
+ ; CHECK-NEXT: ret <4 x float> [[S]]
416
+ ;
417
+ %l = load <2 x float >, ptr %p , align 1
418
+ %s = shufflevector <2 x float > %l , <2 x float > poison, <4 x i32 > <i32 0 , i32 1 , i32 undef , i32 undef >
419
+ ret <4 x float > %s
420
+ }
421
+
422
+ define <4 x float > @load_v3f32_v4f32_tsan (ptr dereferenceable (16 ) %p ) sanitize_thread {
423
+ ; CHECK-LABEL: @load_v3f32_v4f32_tsan(
424
+ ; CHECK-NEXT: [[L:%.*]] = load <3 x float>, ptr [[P:%.*]], align 1
425
+ ; CHECK-NEXT: [[S:%.*]] = shufflevector <3 x float> [[L]], <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
426
+ ; CHECK-NEXT: ret <4 x float> [[S]]
427
+ ;
428
+ %l = load <3 x float >, ptr %p , align 1
429
+ %s = shufflevector <3 x float > %l , <3 x float > poison, <4 x i32 > <i32 0 , i32 1 , i32 2 , i32 undef >
430
+ ret <4 x float > %s
431
+ }
432
+
433
+ define <8 x float > @load_v2f32_v8f32_hwasan (ptr dereferenceable (32 ) %p ) sanitize_hwaddress {
434
+ ; CHECK-LABEL: @load_v2f32_v8f32_hwasan(
435
+ ; CHECK-NEXT: [[L:%.*]] = load <2 x float>, ptr [[P:%.*]], align 1
436
+ ; CHECK-NEXT: [[S:%.*]] = shufflevector <2 x float> [[L]], <2 x float> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
437
+ ; CHECK-NEXT: ret <8 x float> [[S]]
438
+ ;
439
+ %l = load <2 x float >, ptr %p , align 1
440
+ %s = shufflevector <2 x float > %l , <2 x float > poison, <8 x i32 > <i32 0 , i32 1 , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef , i32 undef >
441
+ ret <8 x float > %s
442
+ }
443
+
444
+ define <4 x i32 > @load_v2i32_v4i32_asan (ptr dereferenceable (16 ) %p ) sanitize_address {
445
+ ; CHECK-LABEL: @load_v2i32_v4i32_asan(
446
+ ; CHECK-NEXT: [[L:%.*]] = load <2 x i32>, ptr [[P:%.*]], align 1
447
+ ; CHECK-NEXT: [[S:%.*]] = shufflevector <2 x i32> [[L]], <2 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>
448
+ ; CHECK-NEXT: ret <4 x i32> [[S]]
449
+ ;
450
+ %l = load <2 x i32 >, ptr %p , align 1
451
+ %s = shufflevector <2 x i32 > %l , <2 x i32 > poison, <4 x i32 > <i32 0 , i32 undef , i32 undef , i32 undef >
452
+ ret <4 x i32 > %s
453
+ }
454
+
455
+ define <4 x i32 > @load_v2i32_v4i32_non_canonical_mask_commute_hwasan (ptr dereferenceable (16 ) %p ) sanitize_hwaddress {
456
+ ; CHECK-LABEL: @load_v2i32_v4i32_non_canonical_mask_commute_hwasan(
457
+ ; CHECK-NEXT: [[L:%.*]] = load <2 x i32>, ptr [[P:%.*]], align 1
458
+ ; CHECK-NEXT: [[S:%.*]] = shufflevector <2 x i32> poison, <2 x i32> [[L]], <4 x i32> <i32 2, i32 3, i32 poison, i32 poison>
459
+ ; CHECK-NEXT: ret <4 x i32> [[S]]
460
+ ;
461
+ %l = load <2 x i32 >, ptr %p , align 1
462
+ %s = shufflevector <2 x i32 > poison, <2 x i32 > %l , <4 x i32 > <i32 2 , i32 3 , i32 undef , i32 undef >
463
+ ret <4 x i32 > %s
464
+ }
0 commit comments