brintos

brintos / llvm-project-archived public Read only

0
0
Text · 628 B · dc017ec Raw
24 lines · plain
1; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s2 3; Regression test of PR31990. A memcpy of one byte, copying 0xff, was4; replaced with a single store of an i4 0xf.5 6@g = constant i8 -17 8define void @foo() {9entry:10  %0 = alloca i811  call void @bar(ptr %0)12  call void @llvm.memcpy.p0.p0.i32(ptr %0, ptr @g, i32 1, i1 false)13  call void @gaz(ptr %0)14  ret void15}16 17declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1)18declare void @bar(ptr)19declare void @gaz(ptr)20 21; The mempcy should be simplified to a single store of an i8, not i422; CHECK: store i8 -123; CHECK-NOT: store i4 -124