1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Transforms/MemCpyOpt/profitable-memset.ll
Eric Christopher a62270de2c Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

llvm-svn: 358552
2019-04-17 04:52:47 +00:00

21 lines
571 B
LLVM

; RUN: opt < %s -memcpyopt -S | FileCheck %s
target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
; CHECK-LABEL: @foo(
; CHECK-NOT: store
; CHECK: call void @llvm.memset.p0i8.i64(i8* align 2 %2, i8 0, i64 8, i1 false)
define void @foo(i64* nocapture %P) {
entry:
%0 = bitcast i64* %P to i16*
%arrayidx = getelementptr inbounds i16, i16* %0, i64 1
%1 = bitcast i16* %arrayidx to i32*
%arrayidx1 = getelementptr inbounds i16, i16* %0, i64 3
store i16 0, i16* %0, align 2
store i32 0, i32* %1, align 4
store i16 0, i16* %arrayidx1, align 2
ret void
}