brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 5803bd0 Raw
48 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=instcombine -S | FileCheck %s3 4declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind5declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind6 7; Same src/dest.8 9define void @test1(ptr %a) {10; CHECK-LABEL: @test1(11; CHECK-NEXT:    ret void12;13  tail call void @llvm.memcpy.p0.p0.i32(ptr %a, ptr %a, i32 100, i1 false)14  ret void15}16 17; PR8267 - same src/dest, but volatile.18 19define void @test2(ptr %a) {20; CHECK-LABEL: @test2(21; CHECK-NEXT:    tail call void @llvm.memcpy.p0.p0.i32(ptr [[A:%.*]], ptr [[A]], i32 100, i1 true)22; CHECK-NEXT:    ret void23;24  tail call void @llvm.memcpy.p0.p0.i32(ptr %a, ptr %a, i32 100, i1 true)25  ret void26}27 28; 17179869184 == 0x400000000 - make sure that doesn't get truncated to 32-bit.29 30define void @test3(ptr %d, ptr %s) {31; CHECK-LABEL: @test3(32; CHECK-NEXT:    tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(17179869184) [[D:%.*]], ptr noundef nonnull align 4 dereferenceable(17179869184) [[S:%.*]], i64 17179869184, i1 false)33; CHECK-NEXT:    ret void34;35  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %d, ptr align 4 %s, i64 17179869184, i1 false)36  ret void37}38 39@UnknownConstant = external constant i12840 41define void @memcpy_to_constant(ptr %src) {42; CHECK-LABEL: @memcpy_to_constant(43; CHECK-NEXT:    ret void44;45  call void @llvm.memcpy.p0.p0.i32(ptr @UnknownConstant, ptr %src, i32 16, i1 false)46  ret void47}48