51 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s3 4; Make sure codegen doesn't try to inspect the use list of constants5 6; Make sure we do not try to make use of the uselist of a constant7; null when looking for the alignment of the pointer.8define <2 x i32> @no_uselist_null_isDereferenceableAndAlignedPointer(i1 %arg0, ptr align(4) %arg) {9; CHECK-LABEL: no_uselist_null_isDereferenceableAndAlignedPointer:10; CHECK: # %bb.0:11; CHECK-NEXT: xorl %eax, %eax12; CHECK-NEXT: testb $1, %dil13; CHECK-NEXT: cmoveq %rsi, %rax14; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero15; CHECK-NEXT: retq16 %select.ptr = select i1 %arg0, ptr null, ptr %arg17 %load = load i32, ptr %select.ptr18 %insert = insertelement <2 x i32> zeroinitializer, i32 %load, i64 019 ret <2 x i32> %insert20}21 22; Make sure we do not try to inspect the uselist of a constant null23; when processing a memcpy24define void @gep_nullptr_no_inspect_uselist(ptr %arg) {25; CHECK-LABEL: gep_nullptr_no_inspect_uselist:26; CHECK: # %bb.0:27; CHECK-NEXT: movzbl 16, %eax28; CHECK-NEXT: movb %al, (%rdi)29; CHECK-NEXT: retq30 %null_gep = getelementptr i8, ptr null, i64 1631 call void @llvm.memcpy.p0.p0.i64(ptr %arg, ptr %null_gep, i64 1, i1 false)32 ret void33}34 35define <16 x i8> @load_null_offset() {36; CHECK-LABEL: load_null_offset:37; CHECK: # %bb.0:38; CHECK-NEXT: movzbl 11, %eax39; CHECK-NEXT: movd %eax, %xmm040; CHECK-NEXT: pslld $8, %xmm041; CHECK-NEXT: retq42 %gep.null = getelementptr i8, ptr null, i64 1143 %load = load i8, ptr %gep.null, align 144 %insert = insertelement <16 x i8> zeroinitializer, i8 %load, i64 145 ret <16 x i8> %insert46}47 48declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #049 50attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }51